feat:完成大部分数据文件上传解析功能
This commit is contained in:
@@ -7,6 +7,7 @@ import json
|
||||
|
||||
from langchain_core.messages import HumanMessage
|
||||
|
||||
from app.agent.data_tools import DataContext
|
||||
from app.agent.screen_agent import AgentReply, get_screen_agent
|
||||
from app.agent.tools import ScreenAgentContext
|
||||
from app.processor.base import BaseNode
|
||||
@@ -53,7 +54,7 @@ class ScreenAgentNode(BaseNode):
|
||||
return updated_state
|
||||
|
||||
context = state["input_context"]
|
||||
agent = await get_screen_agent()
|
||||
agent = await get_screen_agent(with_data=bool(context.data_files))
|
||||
result = await agent.ainvoke(
|
||||
{
|
||||
# 会话历史作为此前的对话消息,本次请求是最后一条用户消息
|
||||
@@ -64,7 +65,11 @@ class ScreenAgentNode(BaseNode):
|
||||
),
|
||||
]
|
||||
},
|
||||
context=ScreenAgentContext(screen=context.screen, catalog=catalog),
|
||||
context=ScreenAgentContext(
|
||||
screen=context.screen,
|
||||
catalog=catalog,
|
||||
data=DataContext(tuple(context.data_files)),
|
||||
),
|
||||
)
|
||||
if result.get("structured_response") is None:
|
||||
last = result["messages"][-1]
|
||||
|
||||
Reference in New Issue
Block a user