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 @@ -364,7 +364,7 @@ def handle_variables(self, tool_params):
tool_params[k] = self.workflow_manage.generate_prompt(tool_params[k])
elif type(v) == dict:
self.handle_variables(v)
elif (type(v) == list) and len(v) > 0 and type(v[0]) == str:
elif (type(v) == list) and len(v) > 0 and (type(v[0]) == str):
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 @@ -51,9 +51,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

@wangliang181230 wangliang181230 Apr 21, 2026

Choose a reason for hiding this comment

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

避免 v[0] 空指针(以前合并的PR漏改的一处问题)

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

Expand Down
3 changes: 1 addition & 2 deletions apps/chat/serializers/chat_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ def vote(self, instance: Dict, with_valid=True):
chat_record_details_model.vote_status = VoteChoices.STAR
chat_record_details_model.vote_reason = vote_reason
chat_record_details_model.vote_other_content = vote_other_content

if vote_status == VoteChoices.TRAMPLE:
elif vote_status == VoteChoices.TRAMPLE:
# 点踩
chat_record_details_model.vote_status = VoteChoices.TRAMPLE
chat_record_details_model.vote_reason = vote_reason
Expand Down
10 changes: 4 additions & 6 deletions apps/common/auth/handle/impl/user_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,10 @@ def get_role_list(user,
"""
version = Cache_Version.ROLE_LIST.get_version()
key = Cache_Version.ROLE_LIST.get_key(user_id=user.id)
workspace_list = cache.get(key, version=version)
role_list = cache.get(key, version=version)
# 获取权限列表
is_query_model = workspace_user_role_mapping_model is not None and workspace_model is not None and role_model is not None and role_permission_mapping_model is not None
if workspace_list is None:
if role_list is None:
if is_query_model:
# 获取工作空间 用户 角色映射数据
workspace_user_role_mapping_list = QuerySet(workspace_user_role_mapping_model).filter(user_id=user.id)
Expand All @@ -274,16 +274,14 @@ def get_role_list(user,
for
workspace_user_role_mapping in
workspace_user_role_mapping_list], [])))
cache.set(key, workspace_list, version=version)
return role_list
cache.set(key, role_list, version=version)
Copy link
Copy Markdown
Contributor Author

@wangliang181230 wangliang181230 Apr 21, 2026

Choose a reason for hiding this comment

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

workspace_list 始终为 None,直接重命名变量,解决缓存为空的问题,同时使变量名更加合理。

else:
if user.role == RoleConstants.ADMIN.value.__str__():
role_list = [user.role, get_role_permission(RoleConstants.WORKSPACE_MANAGE, 'default')]
else:
role_list = [user.role, get_role_permission(RoleConstants.USER, 'default')]
cache.set(key, role_list, version=version)
return role_list
return workspace_list
return role_list


def get_auth(user):
Expand Down
8 changes: 4 additions & 4 deletions apps/common/handle/base_parse_qa_handle.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def get_title_row_index_dict(title_row_list):
title_row_index_dict = {}
if len(title_row_list) == 1:
title_row_index_dict['content'] = 0
elif len(title_row_list) == 1:
elif len(title_row_list) == 2:
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.

修正错误的判断值

title_row_index_dict['title'] = 0
title_row_index_dict['content'] = 1
else:
Expand All @@ -33,11 +33,11 @@ def get_title_row_index_dict(title_row_list):
title_row = title_row_list[index]
if title_row is None:
title_row = ''
if title_row.startswith('分段标题'):
elif title_row.startswith('分段标题'):
title_row_index_dict['title'] = index
if title_row.startswith('分段内容'):
elif title_row.startswith('分段内容'):
title_row_index_dict['content'] = index
if title_row.startswith('问题'):
elif title_row.startswith('问题'):
title_row_index_dict['problem_list'] = index
return title_row_index_dict

Expand Down
2 changes: 1 addition & 1 deletion apps/common/handle/impl/qa/csv_parse_qa_handle.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

def read_csv_standard(file_path):
data = []
with open(file_path, 'r') as file:
with open(file_path, 'r', encoding='utf-8') as file:
reader = csv.reader(file)
for row in reader:
data.append(row)
Expand Down
6 changes: 3 additions & 3 deletions apps/local_model/serializers/model_apply_serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ def get_embedding_model(model_id):


class EmbedDocuments(serializers.Serializer):
texts = serializers.ListField(required=True, child=serializers.CharField(required=True,
label=_('vector text')),
label=_('vector text list')),
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.

多了一个逗号,导致 texts 属性变成了 tuple 类型,真正的属性值被包装了一层。

texts = serializers.ListField(required=True,
child=serializers.CharField(required=True, label=_('vector text')),
label=_('vector text list'))


class EmbedQuery(serializers.Serializer):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,12 @@ def generate_video(self, prompt, negative_prompt=None, first_frame_url=None, las
# --- 等待任务完成 ---
rsp = self._safe_call(VideoSynthesis.wait, task=rsp, api_key=self.api_key)
if rsp.status_code == HTTPStatus.OK:
maxkb_logger.info("视频生成完成!视频 URL:", rsp.output.video_url)
if rsp.output.task_status == "SUCCEEDED":
maxkb_logger.info("视频生成完成!视频 URL:", rsp.output.video_url)
maxkb_logger.info(f'视频生成完成!视频 URL: {rsp.output.video_url}')
Copy link
Copy Markdown
Contributor Author

@wangliang181230 wangliang181230 Apr 21, 2026

Choose a reason for hiding this comment

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

上面重复记录了日志,删除掉上面的,保存 if 里面的成功日志, else 里另外有记录失败的日志。

return rsp.output.video_url
else:
maxkb_logger.error("视频生成失败!")
raise RuntimeError(f'生成失败, message: {rsp.output.message}')
maxkb_logger.error(f'视频生成失败: {rsp.output.message}')
raise RuntimeError(f'视频生成失败, message: {rsp.output.message}')
else:
maxkb_logger.error(f'生成失败,status_code: {rsp.status_code}, code: {rsp.code}, message: {rsp.message}')
raise RuntimeError(f'生成失败,status_code: {rsp.status_code}, code: {rsp.code}, message: {rsp.message}')
6 changes: 3 additions & 3 deletions apps/models_provider/serializers/model_apply_serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ def get_embedding_model(model_id):


class EmbedDocuments(serializers.Serializer):
texts = serializers.ListField(required=True, child=serializers.CharField(required=True,
label=_('vector text')),
label=_('vector text list')),
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.

同上:多了一个逗号,导致 texts 属性变成了 tuple 类型,真正的属性值被包装了一层。

texts = serializers.ListField(required=True,
child=serializers.CharField(required=True, label=_('vector text')),
label=_('vector text list'))


class EmbedQuery(serializers.Serializer):
Expand Down
2 changes: 1 addition & 1 deletion ui/src/locales/lang/en-US/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export default {
result: 'Search Results',
searchParam: 'Search Parameters',
select_variable: 'Select Variable',
valueMessage: `Value or name `,
valueMessage: 'Value or name',

searchQuestion: {
label: 'Search Question',
Expand Down
Loading