Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,9 @@ def handle_variables(self, tool_params):
for k, v in tool_params.items():
if type(v) == str:
tool_params[k] = self.workflow_manage.generate_prompt(tool_params[k])
if type(v) == dict:
elif type(v) == dict:
self.handle_variables(v)
if (type(v) == list) and (type(v[0]) == str):
elif (type(v) == list) and len(v) > 0 and type(v[0]) == str:
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

避免 v[0] 报空指针

tool_params[k] = self.get_reference_content(v)
return tool_params

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Copy Markdown
Contributor Author

@wangliang181230 wangliang181230 Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

避免 except 代码段中的 meta={'input': filtered_args, 'output': 'Error: ' + str(e)} 导致 meta.input 为空

try:
# 过滤掉 tool_init_params 中的参数
tool_init_params = json.loads(rsa_long_decrypt(tool_lib.init_params)) if tool_lib.init_params else {}
Expand All @@ -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')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
jsonpath_expr_cache = MemCache('parse_path', {
'TIMEOUT': 3600, # 缓存有效期为 1 小时
'OPTIONS': {
'MAX_ENTRIES': 1000, # 最多缓存 500 个条目
'MAX_ENTRIES': 1000, # 最多缓存 1000 个条目
'CULL_FREQUENCY': 10, # 达到上限时,删除约 1/10 的缓存
},
})
Expand Down
8 changes: 4 additions & 4 deletions apps/chat/serializers/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Copy link
Copy Markdown
Contributor Author

@wangliang181230 wangliang181230 Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

避免 chat_info.chat_idchat_info is None 而报空指针异常

chat_record = QuerySet(ChatRecord).filter(id=chat_record_id).first()
return chat_record

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def convert_to_down_model_chunk(row_str: str, chunk_index: int):
if row.get('status').__contains__("pulling"):
progress = 0
status = DownModelChunkStatus.pulling
if 'total' in row and 'completed' in row:
if 'total' in row and 'completed' in row and row.get('total'):
Copy link
Copy Markdown
Contributor Author

@wangliang181230 wangliang181230 Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

避免 除以0 的情况

progress = (row.get('completed') / row.get('total') * 100)
elif 'error' in row:
status = DownModelChunkStatus.error
Expand Down
2 changes: 1 addition & 1 deletion apps/trigger/handler/impl/trigger/event_trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def execute(trigger, request=None, **kwargs):
trigger_setting = trigger.get('trigger_setting')
if trigger_setting.get('token'):
token = request.META.get('HTTP_AUTHORIZATION')
if trigger_setting.get('token') != token.replace('Bearer ', ''):
if not token or trigger_setting.get('token') != token.replace('Bearer ', ''):
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

避免 token.replace 报空指针异常

raise AppAuthenticationFailed(1002, _('Authentication information is incorrect'))
is_active = trigger.get('is_active')
if not is_active:
Expand Down
Loading