diff --git a/01_agent_introduction/agent-demo.py b/01_agent_introduction/agent-demo.py index 4ad167f..84411f2 100644 --- a/01_agent_introduction/agent-demo.py +++ b/01_agent_introduction/agent-demo.py @@ -6,7 +6,7 @@ from langchain_openai import ChatOpenAI llm = ChatOpenAI( model="deepseek-chat", api_key=OPENAI_API_KEY, - # 注:在.env里把OPENAI_API_KEY改成你自己的api-key即可 + # 注:在.env里把OPENAI_API_KEY改成你自己的api-key即可 base_url="https://api.deepseek.com" ) diff --git a/02_llm_fundamentals/01_basic_llm_invocation.py b/02_llm_fundamentals/01_basic_llm_invocation.py index 7ea4829..307fffe 100644 --- a/02_llm_fundamentals/01_basic_llm_invocation.py +++ b/02_llm_fundamentals/01_basic_llm_invocation.py @@ -11,7 +11,7 @@ response = client.chat.completions.create( {"role": "system", "content": "You are a helpful assistant"}, # 提示词角色 {"role": "user", "content": "Hello"}, # 用户输入的对话 ], - stream=False # 非流式输出,只会等语句全部生成才返回 + stream=False # 非流式输出, 只会等语句全部生成才返回 ) print(response.choices[0].message.content) \ No newline at end of file diff --git a/03_function_calling_tools/01_custom_function_calling.py b/03_function_calling_tools/01_custom_function_calling.py index 740a9c6..bf0f8d0 100644 --- a/03_function_calling_tools/01_custom_function_calling.py +++ b/03_function_calling_tools/01_custom_function_calling.py @@ -76,7 +76,7 @@ def chat_loop(agent_client, tools): print('已调用工具...') print(f'回答:{final_res.choices[0].message.content}') else: - # 模型没有要调用工具,直接返回 + # 模型没有要调用工具, 直接返回 print('未调用工具...') print(f'回答:{response.choices[0].message.content}') diff --git a/05_langchain_advanced/01_define_toolbox.py b/05_langchain_advanced/01_define_toolbox.py index 9ecc9b2..9b2f645 100644 --- a/05_langchain_advanced/01_define_toolbox.py +++ b/05_langchain_advanced/01_define_toolbox.py @@ -11,6 +11,6 @@ def get_user_name(user): return f'用户名字是:{user}' -# 封装好我们要用的工具 +# 封装好要用的工具 tools = [get_weather,get_user_name] print('工具箱已封装完毕!') \ No newline at end of file