-
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
base: v2
Are you sure you want to change the base?
Changes from all commits
fc5b607
ec3d5fa
b09d0ca
134ed9a
75f239d
b9a02b1
27fc513
afacd7f
46218ef
2e8dced
b3e7b65
078bda5
ad2aff2
fbbdb70
1a72ba2
66ccc3a
8b94350
418ac71
d4527de
2817aee
2feaa9a
5ae0a84
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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))] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -250,6 +250,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 {} | ||
|
|
@@ -258,8 +259,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 | ||
| ToolRecord( | ||
| id=task_record_id, | ||
| workspace_id=tool_lib.workspace_id, | ||
|
|
||
| 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 | ||
|
|
||
|
|
||
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.
此方法调用前,已经执行过,无需重复执行。