feat: 换一个模型:huoshan-think-pro
This commit is contained in:
@@ -44,6 +44,11 @@ ai_configs = {
|
||||
'url': 'https://ark.cn-beijing.volces.com/api/v3/chat/completions',
|
||||
'key': env.llm_key_huoshan,
|
||||
},
|
||||
'huoshan-think-pro': {
|
||||
'model': 'doubao-1-5-thinking-pro-250415',
|
||||
'url': 'https://ark.cn-beijing.volces.com/api/v3/chat/completions',
|
||||
'key': env.llm_key_huoshan,
|
||||
},
|
||||
'huoshan-doubao-seed': {
|
||||
'model': 'doubao-seed-1-6-250615',
|
||||
'url': 'https://ark.cn-beijing.volces.com/api/v3/chat/completions',
|
||||
|
||||
@@ -98,8 +98,18 @@ async def tool_book_hotel(config: RunnableConfig) -> str:
|
||||
response_data = response.json()
|
||||
# print("================ response_data ================")
|
||||
# print(response_data)
|
||||
approve_id = response_data.get('graph_state').get('input_approve_id')
|
||||
|
||||
return "预定成功," + response_data.get('message')
|
||||
return [
|
||||
"预定成功," + response_data.get('message'),
|
||||
{
|
||||
"component": "Link",
|
||||
"props": {
|
||||
"to": f"/pages/approve/approve-detail?id={approve_id}",
|
||||
"children": "点击查看审批进度"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
class ChatMessage(BaseModel):
|
||||
@@ -121,7 +131,7 @@ class ChatAgent:
|
||||
async def get_agent() -> CompiledStateGraph:
|
||||
if not ChatAgent.agent:
|
||||
ChatAgent.agent = create_react_agent(
|
||||
model=create_llm(),
|
||||
model=create_llm("huoshan-think-pro"),
|
||||
tools=[
|
||||
tool_book_hotel,
|
||||
tool_get_datetime,
|
||||
@@ -130,9 +140,9 @@ class ChatAgent:
|
||||
],
|
||||
checkpointer=await PostgresCheckpointerManager.get_instance(),
|
||||
prompt="""
|
||||
你是一名擅长使用工具的智能助手,你需要根据用户问题来进行回答,请使用中文进行回答。
|
||||
当用户问题需要调用工具时再调用工具,否则按照你的知识来回答问题。
|
||||
某些工具会触发中断让用户来编辑工具执行参数,这些工具会将新的执行参数作为信息返回,你需要回复用户最新的信息
|
||||
- 你是一名擅长使用工具的智能助手,你需要根据用户问题来进行回答,请使用中文进行回答。
|
||||
- 当用户问题需要调用工具时再调用工具,否则按照你的知识来回答问题。
|
||||
- 特别注意,特别注意,特别注意,如果工具的返回结果是一个数组,你只能回复“工具已经执行完毕”
|
||||
"""
|
||||
)
|
||||
return ChatAgent.agent
|
||||
|
||||
Reference in New Issue
Block a user