-
Notifications
You must be signed in to change notification settings - Fork 2.7k
fix: Fix some minor problems #4923
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
wangliang181230
wants to merge
25
commits into
1Panel-dev:v2
Choose a base branch
from
wangliang181230:perf
base: v2
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
25 commits
Select commit
Hold shift + click to select a range
fc5b607
perf: system prompt double-generating
wangliang181230 ec3d5fa
Merge remote-tracking branch 'upstream/v2' into perf
wangliang181230 b09d0ca
Merge remote-tracking branch 'upstream/v2' into perf
wangliang181230 134ed9a
Merge remote-tracking branch 'upstream/v2' into perf
wangliang181230 75f239d
fix: Fix some minor problem
wangliang181230 b9a02b1
fix
wangliang181230 27fc513
小调整。
wangliang181230 afacd7f
Merge remote-tracking branch 'upstream/v2' into perf
wangliang181230 46218ef
文件处理,使用 with ... as file 语法,避免文件未关闭。
wangliang181230 2e8dced
修正错误字符串
wangliang181230 b3e7b65
fix bugs: invalid regex escape sequences, and resource leaks
wangliang181230 078bda5
Merge remote-tracking branch 'upstream/v2' into perf
wangliang181230 ad2aff2
fix bugs: invalid regex escape sequences, and resource leaks
wangliang181230 fbbdb70
撤回对正则的修正。
wangliang181230 1a72ba2
Merge remote-tracking branch 'upstream/v2' into perf
wangliang181230 66ccc3a
operation
wangliang181230 8b94350
小调整
wangliang181230 418ac71
Merge remote-tracking branch 'upstream/v2' into perf
wangliang181230 d4527de
小调整
wangliang181230 2817aee
Merge remote-tracking branch 'upstream/v2' into perf
wangliang181230 2feaa9a
小调整
wangliang181230 5ae0a84
revert
wangliang181230 6383670
Merge remote-tracking branch 'upstream/v2' into perf
wangliang181230 4761094
Merge remote-tracking branch 'upstream/v2' into perf
wangliang181230 a17aee7
revert
wangliang181230 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -136,7 +136,7 @@ def generate_prompt_question(self, prompt): | |
|
|
||
| def generate_message_list(self, system: str, prompt: str, history_message): | ||
| if system is not None and len(system) > 0: | ||
| return [SystemMessage(self.workflow_manage.generate_prompt(system)), *history_message, | ||
| return [SystemMessage(system), *history_message, | ||
|
Contributor
Author
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.
|
||
| HumanMessage(self.workflow_manage.generate_prompt(prompt))] | ||
| else: | ||
| return [*history_message, HumanMessage(self.workflow_manage.generate_prompt(prompt))] | ||
|
|
||
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 |
|---|---|---|
|
|
@@ -251,6 +251,7 @@ def execute(self, tool_lib_id, input_field_list, **kwargs) -> NodeResult: | |
| def tool_exec_record(self, tool_lib, all_params): | ||
| task_record_id = uuid.uuid7() | ||
| start_time = time.time() | ||
| filtered_args = all_params | ||
|
Contributor
Author
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.
|
||
| try: | ||
| # 过滤掉 tool_init_params 中的参数 | ||
| tool_init_params = json.loads(rsa_long_decrypt(tool_lib.init_params)) if tool_lib.init_params else {} | ||
|
|
@@ -259,8 +260,6 @@ def tool_exec_record(self, tool_lib, all_params): | |
| k: v for k, v in all_params.items() | ||
| if k not in tool_init_params | ||
| } | ||
| else: | ||
| filtered_args = all_params | ||
| if [WorkflowMode.KNOWLEDGE, WorkflowMode.KNOWLEDGE_LOOP].__contains__( | ||
| self.workflow_manage.flow.workflow_mode): | ||
| source_id = self.workflow_manage.params.get('knowledge_id') | ||
|
|
||
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 |
|---|---|---|
|
|
@@ -382,10 +382,10 @@ def get_chat_record(chat_info, chat_record_id): | |
| str(chat_record.id) == str(chat_record_id)] | ||
| if chat_record_list is not None and len(chat_record_list): | ||
| return chat_record_list[-1] | ||
| chat_record = QuerySet(ChatRecord).filter(id=chat_record_id, chat_id=chat_info.chat_id).first() | ||
| if chat_record is None: | ||
| if not is_valid_uuid(chat_record_id): | ||
| raise ChatException(500, _("Conversation record does not exist")) | ||
| chat_record = QuerySet(ChatRecord).filter(id=chat_record_id, chat_id=chat_info.chat_id).first() | ||
| if chat_record is None: | ||
| if not is_valid_uuid(chat_record_id): | ||
| raise ChatException(500, _("Conversation record does not exist")) | ||
|
Contributor
Author
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.
|
||
| chat_record = QuerySet(ChatRecord).filter(id=chat_record_id).first() | ||
| return chat_record | ||
|
|
||
|
|
||
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generate_message_list方法调用前,已经执行过,无需重复执行。