指的是1版第2刷之后改正了的
llm_config llm_config 改为 llm_config=llm_config
parse_response(rsp) 都改为 rsp.strip()
指的是1版第3刷之后改正
语音输出框 改为 语音输入框
Openai的key的字符串是OpenAI_API_KEY,正确的是:OPENAI_API_KEY
P38 - 两处 (正数第6行(正文)和倒数第6行(代码))
P58 - 一处 代码第3行
代码空格错误,
from[空格]llama_index.[空格]coreimport...,
应为
from[空格]llama_index.core[空格]import
图中的(a)Plan-and-Solve和(b)Zero-Shot-CoT反了
指的是1版第4刷之后改正
pip install LlamaIndex
改为
pip install llama-index
query_engine = index.as_query_engine()
改为
agent = index.as_query_engine()
for Step Into steps: 中的 Step Into 改为小写
指的是1版第5刷之后改正
输出难度 改为 输出维度
过程6中的 LangChain Agent 改为 LlamaIndex Agent
语句
from llama_index import VectorStoreIndex
改为
from llama_index.core import VectorStoreIndex
表5.6第4行 Queue 改为 queue
if tool_calls: 代码下面的
messages.append(response_message)
以及后面的注释行应该有缩进。
代码中的 new_messages 应该改为 messages
指的是1版第6刷之后改正
图中间加个箭头:
- 大模型调用工具 / 工具返回结果
- 工具行动改变环境 / 环境吧结果传回工具
指的是1版第7刷之后改正
tools = [check_inventory, calculate_price]
改为
tools = [check_inventory, calculate_price, schedule_delivery]
之前schedule_delivery没有被传入工具中。
删去 However, we don't have the base price and markup percentage yet. We need to check if we have that information or if we need to ask the user for it. - 这明显是大模型的幻觉。
class TaskPrioritizationChain(llmChain): 应为:class TaskPrioritizationChain(LLMChain):