Skip to content
Merged
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):
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)
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:
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
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ 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)
return rsp.output.video_url
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ def generate_image(self, prompt: str, negative_prompt: str = None):

return file_urls
except Exception as e:
raise f"OpenAI generate image error: {e}"
raise RuntimeError(f"OpenAI generate image error: {e}") from e
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ def generate_image(self, prompt: str, negative_prompt: str = None):
file_urls.append(url)
return file_urls
except Exception as e:
raise f"RegoloTextToImage generate_image error: {e}"
raise RuntimeError(f"RegoloTextToImage generate_image error: {e}") from e
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ def generate_image(self, prompt: str, negative_prompt: str = None):
return file_urls
except TencentCloudSDKException as err:
maxkb_logger.error(f"Tencent Text to Image API call failed: {err}")
raise f"Tencent Text to Image API call failed: {err}"
raise RuntimeError(f"Tencent Text to Image API call failed: {err}") from err
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ 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')),
label=_('vector text list'))


class EmbedQuery(serializers.Serializer):
Expand Down
4 changes: 2 additions & 2 deletions apps/oss/serializers/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,9 @@ def _is_unsafe_ip(self, ip: str) -> bool:
def get_url_content(url, application_id: str):
application = Application.objects.filter(id=application_id).first()
if application is None:
return AppApiException(500, _('Application does not exist'))
raise AppApiException(500, _('Application does not exist'))
if not application.file_upload_enable:
return AppApiException(500, _('File upload is not enabled'))
raise AppApiException(500, _('File upload is not enabled'))
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.

关键字错误,这个方法并不是一个返回异常对象的方法。

file_limit = 50 * 1024 * 1024
if application.file_upload_setting and application.file_upload_setting.get('fileLimit'):
file_limit = application.file_upload_setting.get('fileLimit') * 1024 * 1024
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 @@ -188,7 +188,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
5 changes: 2 additions & 3 deletions ui/src/workflow/nodes/intent-classify-node/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,11 @@ class IntentModel extends AppNodeModel {
})

if (branch_condition_list) {

const FORM_ITEMS_HEIGHT = 397 // 上方表单占用高度

for (let index = 0; index < branch_condition_list.length; index++) {
const element = branch_condition_list[index]

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.

fix style

anchors.push({
x: x + width / 2 - 10,
y: showNode
Expand Down
Loading