feat: 查询周报日报的工具
This commit is contained in:
@@ -13,6 +13,7 @@ from starlette.responses import StreamingResponse
|
||||
|
||||
from app.model.ConversationModel import ConversationService
|
||||
from app.tools.tool_list import tool_list
|
||||
from app.tools.tool_project_report import tool_project_report
|
||||
from app.utils.db_utils import AsyncSessionDep
|
||||
from app.utils.llm_utils import create_llm
|
||||
from app.utils.postgres_checkpointer import PostgresCheckpointerManager, AsyncPostgresSaverDep
|
||||
@@ -43,6 +44,7 @@ class ChatAgent:
|
||||
prompt="""
|
||||
- 你是一名擅长使用工具的智能助手,你需要根据用户问题来进行回答,请使用中文进行回答。
|
||||
- 当用户问题需要调用工具时再调用工具,否则按照你的知识来回答问题。
|
||||
- 你每次只能调用一个工具
|
||||
- 特别注意,特别注意,特别注意,如果工具的返回结果是一个数组,你只能回复“工具已经执行完毕”
|
||||
"""
|
||||
)
|
||||
@@ -63,8 +65,12 @@ class ChatAgent:
|
||||
def add_langgraph_chat_route(app: FastAPI):
|
||||
@app.post("/project/analysis")
|
||||
async def project_analysis(body: dict):
|
||||
project_name = body.get('name')
|
||||
return {}
|
||||
|
||||
return await tool_project_report.ainvoke({
|
||||
"project_name": body.get('project_name'),
|
||||
"start_time": body.get("start_time", None),
|
||||
"end_time": body.get("end_time", None),
|
||||
})
|
||||
|
||||
# 流式对话接口
|
||||
@app.post("/langgraph/stream")
|
||||
|
||||
Reference in New Issue
Block a user