forked from langgenius/dify
-
Notifications
You must be signed in to change notification settings - Fork 0
Cursx patch 1 fix workflow tool 1 #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Cursx
wants to merge
43
commits into
main
Choose a base branch
from
Cursx-patch-1-fix-workflow-tool-1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
6f8153f
Update fc_agent_runner.py
Cursx 8f13ea0
Update cot_agent_runner.py
Cursx ac68456
Update tool_entities.py
Cursx c3e09b4
Update tool_engine.py
Cursx 00f49e1
Update api/core/agent/fc_agent_runner.py
Cursx f51e8b0
Update api/core/agent/fc_agent_runner.py
Cursx 94bad9c
Update api/core/agent/fc_agent_runner.py
Cursx 9a8b333
Update tool.py
Cursx f48435f
Update tool.py
Cursx 925aef3
Apply suggestions from code review
Cursx ee93805
Update fc_agent_runner.py
Cursx faa979b
Update fc_agent_runner.py
Cursx 944ba64
Update api/core/agent/fc_agent_runner.py
Cursx 5687103
Update fc_agent_runner.py
Cursx f164760
Update tool.py
Cursx ff108d4
Update tool.py
Cursx 32d08f7
Update tool_engine.py
Cursx 81a95f5
Update tool_engine.py
Cursx d237d8b
Update tool.py
Cursx 3f79986
Update fc_agent_runner.py
Cursx 1c113b4
Update tool.py
Cursx 72e9288
Update cot_agent_runner.py
Cursx 8fe4fbc
Update cot_agent_runner.py
Cursx f390578
Update fc_agent_runner.py
Cursx 02e2d30
Update tool.py
Cursx 8b8423a
Update fc_agent_runner.py
Cursx 528f740
Update fc_agent_runner.py
Cursx 1baa4d4
Update tool.py
Cursx 2033831
Update fc_agent_runner.py
Cursx 3c8ea64
Update fc_agent_runner.py
Cursx 924a8e6
Update tool_engine.py
Cursx 07c9652
Update fc_agent_runner.py
Cursx 6ca8e92
Simplify condition for direct text retrieval
Cursx 4d64aca
Update fc_agent_runner.py
Cursx c85ad29
Update tool.py
Cursx 398ab38
Update tool.py
Cursx 2725ea7
Update cot_agent_runner.py
Cursx a70e5f2
Update cot_agent_runner.py
Cursx 4dce6c8
Update cot_agent_runner.py
Cursx 990cf84
Update fc_agent_runner.py
Cursx 9917609
Apply suggestion from @gemini-code-assist[bot]
Cursx dc5bc33
Update tool_engine.py
Cursx 29d3193
Refactor final_answer construction using list append
Cursx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -114,10 +114,24 @@ def _invoke( | |
| for file in files: | ||
| yield self.create_file_message(file) # type: ignore | ||
|
|
||
| return_direct_flag = isinstance(outputs, dict) and outputs.pop("return_direct", None) is True | ||
|
|
||
| self._latest_usage = self._derive_usage_from_result(data) | ||
|
|
||
| yield self.create_text_message(json.dumps(outputs, ensure_ascii=False)) | ||
| direct_text = None | ||
| if return_direct_flag: | ||
| string_values = [v for k, v in sorted(outputs.items()) if isinstance(v, str)] | ||
| if string_values: | ||
| direct_text = "\n".join(string_values) | ||
|
|
||
| if direct_text is not None: | ||
| yield self.create_text_message(direct_text) | ||
| else: | ||
| yield self.create_text_message(json.dumps(outputs, ensure_ascii=False)) | ||
|
Cursx marked this conversation as resolved.
Comment on lines
+121
to
+130
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The logic for determining the text output can be simplified to improve readability and reduce redundancy. You can determine the text_output = json.dumps(outputs, ensure_ascii=False)
if return_direct_flag:
string_values = [v for _, v in sorted(outputs.items()) if isinstance(v, str)]
if string_values:
text_output = "\n".join(string_values)
yield self.create_text_message(text_output) |
||
|
|
||
| yield self.create_json_message(outputs, suppress_output=True) | ||
| if return_direct_flag: | ||
| yield self.create_variable_message("return_direct", True) | ||
|
|
||
| @property | ||
| def latest_usage(self) -> LLMUsage: | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.