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
75467574
Commit
75467574
authored
a year ago
by
tinywell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: Update agent.py to fix prompt handling and remove unused import
parent
9a5edb67
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
agent.py
src/server/agent.py
+5
-6
No files found.
src/server/agent.py
View file @
75467574
...
...
@@ -3,7 +3,7 @@ from typing import Any, List, Sequence, Union
from
langchain_core.prompts
import
PromptTemplate
from
langchain.agents
import
AgentExecutor
,
create_tool_calling_agent
,
create_structured_chat_agent
from
langchain.tools
import
BaseTool
from
langgraph.prebuilt
import
create_react_agent
#
from langgraph.prebuilt import create_react_agent
from
langchain_core.language_models
import
BaseLanguageModel
...
...
@@ -115,11 +115,10 @@ class Agent:
self
.
prompt
=
prompt
if
not
prompt
:
agent
=
create_react_agent
(
llm
,
tools
,
debug
=
verbose
)
self
.
agent_executor
=
agent
else
:
agent
=
create_chart_agent
(
llm
,
tools
,
prompt
,
**
args
)
self
.
agent_executor
=
AgentExecutor
(
agent
=
agent
,
tools
=
tools
,
verbose
=
verbose
)
raise
ValueError
(
"PromptTemplate is required"
)
agent
=
create_chart_agent
(
llm
,
tools
,
prompt
,
**
args
)
self
.
agent_executor
=
AgentExecutor
(
agent
=
agent
,
tools
=
tools
,
verbose
=
verbose
)
def
exec
(
self
,
prompt_args
:
dict
=
{},
stream
:
bool
=
False
):
# if stream:
...
...
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