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
a9eb1f9e
Commit
a9eb1f9e
authored
8 months ago
by
tinywell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
agent 接入新工具 warntool
parent
991ebf04
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
5 deletions
+9
-5
api.py
src/controller/api.py
+2
-2
agent_rate.py
src/server/agent_rate.py
+3
-1
logger.py
src/utils/logger.py
+4
-2
No files found.
src/controller/api.py
View file @
a9eb1f9e
...
...
@@ -79,8 +79,8 @@ class AgentManager:
verbose
=
True
)
self
.
agent
=
new_rate_agent
(
self
.
llm
,
verbose
=
True
,
tool_base_url
=
tool_base_url
)
#
self.rate_agent = RateAgentV3(self.llm, tool_base_url=tool_base_url,version="v0")
self
.
rate_agent
=
RateAgentV3
(
self
.
llm
,
tool_base_url
=
tool_base_url
)
self
.
rate_agent
=
RateAgentV3
(
self
.
llm
,
tool_base_url
=
tool_base_url
,
version
=
"v0"
)
#
self.rate_agent = RateAgentV3(self.llm, tool_base_url=tool_base_url)
self
.
router_llm
=
new_router_llm
(
self
.
llm
)
self
.
re_rewriter_llm
=
new_re_rewriter_llm
(
self
.
llm
)
...
...
This diff is collapsed.
Click to expand it.
src/server/agent_rate.py
View file @
a9eb1f9e
...
...
@@ -15,6 +15,7 @@ from langchain import hub
from
src.agent.tool_rate
import
RegionRateTool
,
RankingRateTool
from
src.agent.tool_monitor
import
MonitorPointTool
from
src.agent.tool_warn
import
WarningTool
from
src.server.tool_picker
import
ToolPicker
,
ToolRunner
# def create_rate_agent(llm, tools: List[BaseTool],prompt: PromptTemplate = None,
...
...
@@ -174,7 +175,8 @@ class RateAgentV3:
tools
=
[
RegionRateTool
(
base_url
=
tool_base_url
),
RankingRateTool
(
base_url
=
tool_base_url
),
MonitorPointTool
(
base_url
=
tool_base_url
)
MonitorPointTool
(
base_url
=
tool_base_url
),
WarningTool
(
base_url
=
tool_base_url
)
]
self
.
picker
=
ToolPicker
(
llm
,
tools
)
tools_dict
=
{}
...
...
This diff is collapsed.
Click to expand it.
src/utils/logger.py
View file @
a9eb1f9e
...
...
@@ -30,8 +30,10 @@ def setup_logging(log_level=logging.INFO, log_dir="logs"):
)
# 设置第三方库的日志级别
# logging.getLogger("httpx").setLevel(logging.WARNING)
# logging.getLogger("urllib3").setLevel(logging.WARNING)
logging
.
getLogger
(
"httpx"
)
.
setLevel
(
logging
.
INFO
)
logging
.
getLogger
(
"urllib3"
)
.
setLevel
(
logging
.
INFO
)
logging
.
getLogger
(
"openai"
)
.
setLevel
(
logging
.
INFO
)
logging
.
getLogger
(
"httpcore"
)
.
setLevel
(
logging
.
INFO
)
logging
.
info
(
f
"日志配置完成,日志文件: {log_file}"
)
...
...
This diff is collapsed.
Click to expand it.
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