Commit dbb5a777 by tinywell

在线率排名工具参数描述优化

parent 696bd09e
...@@ -118,7 +118,7 @@ class RegionRateTool(BaseRateTool): ...@@ -118,7 +118,7 @@ class RegionRateTool(BaseRateTool):
class RankingRateArgs(BaseModel): class RankingRateArgs(BaseModel):
"""排名查询参数""" """排名查询参数"""
rate_type: int = Field(..., description="排序类型:1-省份排名,2-厂商排名") rate_type: int = Field(..., description="排序类型,用于指定查询的排名类别。1表示省份排名,2表示厂商排名")
class RankingRateTool(BaseRateTool): class RankingRateTool(BaseRateTool):
"""查询在线率排名的工具""" """查询在线率排名的工具"""
......
...@@ -105,8 +105,8 @@ def rate(chat_request: GeoAgentRateRequest, token: str = Header(None)): ...@@ -105,8 +105,8 @@ def rate(chat_request: GeoAgentRateRequest, token: str = Header(None)):
agent = agent_manager.get_agent() agent = agent_manager.get_agent()
rate_agent = agent_manager.get_rate_agent() rate_agent = agent_manager.get_rate_agent()
try: try:
res = agent.exec(prompt_args={"input": chat_request.query}) # res = agent.exec(prompt_args={"input": chat_request.query})
# res = rate_agent.run(chat_request.query) res = rate_agent.run(chat_request.query)
except Exception as e: except Exception as e:
print(f"处理请求失败, 错误信息: {str(e)},请重新提问") print(f"处理请求失败, 错误信息: {str(e)},请重新提问")
return { return {
......
...@@ -184,5 +184,11 @@ class RateAgentV3: ...@@ -184,5 +184,11 @@ class RateAgentV3:
def run(self, input: str): def run(self, input: str):
picker_result = self.picker.pick(input) picker_result = self.picker.pick(input)
return self.runner.run(input, picker_result["tool"], picker_result["params"]) res = self.runner.run(input, picker_result["tool"], picker_result["params"])
return {
"input": input,
"output": res.content,
"tool": picker_result["tool"],
"params": picker_result["params"]
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment