fix(m12): correct environment dependencies and package imports
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
from agents.mcp import MCPServerStdio, MCPServerStdioParams
|
from agents.mcp import MCPServerStdio, MCPServerStdioParams
|
||||||
from openai import AsyncOpenAI
|
from openai import AsyncOpenAI
|
||||||
from agents import Agent, OpenAIChatCompletionsModel
|
from agents.agent import Agent
|
||||||
|
from agents.models.openai_chatcompletions import OpenAIChatCompletionsModel
|
||||||
from config import OPENAI_API_KEY
|
from config import OPENAI_API_KEY
|
||||||
from m12_agents_sdk_swarm.tools import execute_refund, check_seat
|
from m12_agents_sdk_swarm.tools import execute_refund, check_seat
|
||||||
from config import AMAP_MAPS_API_KEY
|
from config import AMAP_MAPS_API_KEY
|
||||||
|
|||||||
@@ -1,23 +1,16 @@
|
|||||||
# 问题
|
|
||||||
# 1. 命名不能中文
|
|
||||||
# 2. chatgpt默认启用smith,要关闭它
|
|
||||||
# 3. 如果不想关闭,需要配置一个api_key
|
|
||||||
# 4. 哪怕配置好,chatgpt与这边连接延迟较高,tracing追踪也不稳定,而且之前我们已经讲了一个langsmith,所以这里不用它其实更好。
|
|
||||||
|
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from openai.types.responses import ResponseTextDeltaEvent
|
from openai.types.responses import ResponseTextDeltaEvent
|
||||||
from agents import Runner
|
from agents.run import Runner
|
||||||
from m12_agents_sdk_swarm.agent import triage_agent,amap_server
|
from m12_agents_sdk_swarm.agent import triage_agent,amap_server
|
||||||
from m12_agents_sdk_swarm.tools import context_variables
|
from m12_agents_sdk_swarm.tools import context_variables
|
||||||
|
|
||||||
# 不启用Chatgpt官方提供的Tracing(无需配置api_key)
|
# 不启用Chatgpt官方提供的Tracing(无需配置api_key)
|
||||||
from agents import set_tracing_disabled
|
from agents.tracing import set_tracing_disabled
|
||||||
set_tracing_disabled(True)
|
set_tracing_disabled(True)
|
||||||
|
|
||||||
# 启用Chatgpt官方提供的Tracing(需要配置api_key)
|
# 启用Chatgpt官方提供的Tracing(需要配置api_key)
|
||||||
# from config import CHATGPT_API_KEY
|
# from config import CHATGPT_API_KEY
|
||||||
# from agents import set_tracing_export_api_key
|
# from agents.tracing import set_tracing_export_api_key
|
||||||
# set_tracing_export_api_key(CHATGPT_API_KEY)
|
# set_tracing_export_api_key(CHATGPT_API_KEY)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
from agents import function_tool
|
# 修改导入方式以使用正确的openai-agents包
|
||||||
|
from agents.tool import function_tool
|
||||||
|
|
||||||
# 全局上下文,所有 Agent 共享
|
# 全局上下文,所有 Agent 共享
|
||||||
context_variables = {
|
context_variables = {
|
||||||
|
|||||||
+6
-6
@@ -1,19 +1,19 @@
|
|||||||
agents==1.4.0
|
openai-agents==0.6.4
|
||||||
httpx==0.28.1
|
httpx==0.28.1
|
||||||
huggingface_hub==1.2.1
|
huggingface_hub==1.2.3
|
||||||
langchain==1.2.0
|
langchain==1.2.0
|
||||||
langchain_chroma==1.1.0
|
langchain_chroma==1.1.0
|
||||||
langchain_classic==1.0.0
|
langchain_classic==1.0.0
|
||||||
langchain_community==0.4.1
|
langchain_community==0.4.1
|
||||||
langchain_core==1.2.2
|
langchain_core==1.2.4
|
||||||
langchain_huggingface==1.2.0
|
langchain_huggingface==1.2.0
|
||||||
langchain_mcp_adapters==0.2.1
|
langchain_mcp_adapters==0.2.1
|
||||||
langchain_openai==1.1.5
|
langchain_openai==1.1.6
|
||||||
langchain_text_splitters==1.1.0
|
langchain_text_splitters==1.1.0
|
||||||
langgraph==1.0.5
|
langgraph==1.0.5
|
||||||
langsmith==0.5.0
|
langsmith==0.5.0
|
||||||
mcp==1.24.0
|
mcp==1.25.0
|
||||||
openai==2.13.0
|
openai==2.14.0
|
||||||
pydantic==2.12.5
|
pydantic==2.12.5
|
||||||
python-dotenv==1.2.1
|
python-dotenv==1.2.1
|
||||||
Requests==2.32.5
|
Requests==2.32.5
|
||||||
|
|||||||
Reference in New Issue
Block a user