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
714e68cd
Commit
714e68cd
authored
Jul 26, 2023
by
John Wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: catch return_stopped_response exception
parent
0e4db4f7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
openai_function_call.py
api/core/agent/agent/openai_function_call.py
+11
-0
No files found.
api/core/agent/agent/openai_function_call.py
View file @
714e68cd
...
@@ -107,3 +107,14 @@ class AutoSummarizingOpenAIFunctionCallAgent(OpenAIFunctionsAgent, OpenAIFunctio
...
@@ -107,3 +107,14 @@ class AutoSummarizingOpenAIFunctionCallAgent(OpenAIFunctionsAgent, OpenAIFunctio
"Current time: {}
\n
"
"Current time: {}
\n
"
"Respond directly if appropriate."
.
format
(
"Respond directly if appropriate."
.
format
(
current_time
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S
%
Z
%
z"
)))
current_time
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S
%
Z
%
z"
)))
def
return_stopped_response
(
self
,
early_stopping_method
:
str
,
intermediate_steps
:
List
[
Tuple
[
AgentAction
,
str
]],
**
kwargs
:
Any
,
)
->
AgentFinish
:
try
:
return
super
()
.
return_stopped_response
(
early_stopping_method
,
intermediate_steps
,
**
kwargs
)
except
ValueError
:
return
AgentFinish
({
"output"
:
"I'm sorry, I don't know how to respond to that."
},
""
)
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