← 返回刚才阅读的位置

知识卡片

普通读书笔记卡 · 8692 · 生成模型:GPT-6

查询生成应绑定当前库结构

理解等级:高级

生成SQL需要对应表、列、类型和关联约束,表多时可先检索相关结构。历史查询微调不保证记住最新schema,成功解析也不代表业务含义正确;生成与执行之间仍要进行只读权限、范围和语义检查。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • · 查看原书依据

      tool call can be more complex than just returning the name of a function and its arguments. An example of this is querying a database. For the LLM to generate the right SQL query, you should provide the schema of the database tables in the system prompt. If the database has too many tables, then their schema can be retrieved on demand by the LLM.

    参考来源

    - 位置:《Designing Large Language Model Applications》第10章《外部工具与智能体》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Designing Large Language Model Applications/_epub-src/OEBPS/ch10.html) - 结论依据:摘录中关于查询生成应绑定当前库结构的定义、比较或条件支撑卡片;原书表述不严谨的范围已在覆盖记录逐项限定,不把案例结果外推为普遍结论。 - 原始内容:tool call can be more complex than just returning the name of a function and its arguments. An example of this is querying a database. For the LLM to generate the right SQL query, you should provide the schema of the database tables in the system prompt. If the database has too many tables, then their schema can be retrieved on demand by the LLM.