Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
LAE
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
文靖昊
LAE
Commits
dbb5a777
Commit
dbb5a777
authored
Nov 14, 2024
by
tinywell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
在线率排名工具参数描述优化
parent
696bd09e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
4 deletions
+10
-4
tool_rate.py
src/agent/tool_rate.py
+1
-1
api.py
src/controller/api.py
+2
-2
agent_rate.py
src/server/agent_rate.py
+7
-1
No files found.
src/agent/tool_rate.py
View file @
dbb5a777
...
@@ -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
):
"""查询在线率排名的工具"""
"""查询在线率排名的工具"""
...
...
src/controller/api.py
View file @
dbb5a777
...
@@ -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
{
...
...
src/server/agent_rate.py
View file @
dbb5a777
...
@@ -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"
]
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment