Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
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
ai-tech
dify
Commits
2de7f5d2
Commit
2de7f5d2
authored
Jul 24, 2023
by
John Wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: Agent run failed error
parent
70c5d1aa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
agent_executor.py
api/core/agent/agent_executor.py
+6
-1
completion.py
api/core/completion.py
+1
-1
No files found.
api/core/agent/agent_executor.py
View file @
2de7f5d2
import
enum
import
logging
from
typing
import
Union
,
Optional
from
langchain.agents
import
BaseSingleActionAgent
,
BaseMultiActionAgent
...
...
@@ -107,7 +108,11 @@ class AgentExecutor:
callbacks
=
self
.
configuration
.
callbacks
)
output
=
agent_executor
.
run
(
query
)
try
:
output
=
agent_executor
.
run
(
query
)
except
Exception
:
logging
.
exception
(
"agent_executor run failed"
)
output
=
None
return
AgentExecuteResult
(
output
=
output
,
...
...
api/core/completion.py
View file @
2de7f5d2
...
...
@@ -126,7 +126,7 @@ class Completion:
memory
:
Optional
[
ReadOnlyConversationTokenDBBufferSharedMemory
],
streaming
:
bool
):
# When no extra pre prompt is specified,
# the output of the agent can be used directly as the main output content without calling LLM again
if
not
app_model_config
.
pre_prompt
and
agent_execute_result
\
if
not
app_model_config
.
pre_prompt
and
agent_execute_result
and
agent_execute_result
.
output
\
and
agent_execute_result
.
strategy
!=
PlanningStrategy
.
ROUTER
:
final_llm
=
FakeLLM
(
response
=
agent_execute_result
.
output
,
origin_llm
=
agent_execute_result
.
configuration
.
llm
,
...
...
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