diff --git a/apps/application/flow/step_node/application_node/impl/base_application_node.py b/apps/application/flow/step_node/application_node/impl/base_application_node.py index 7d033e08884..330bae66441 100644 --- a/apps/application/flow/step_node/application_node/impl/base_application_node.py +++ b/apps/application/flow/step_node/application_node/impl/base_application_node.py @@ -8,6 +8,7 @@ from application.flow.common import Answer from application.flow.i_step_node import NodeResult, INode from application.flow.step_node.application_node.i_application_node import IApplicationNode +from common.utils.logger import maxkb_logger from application.models import Chat, ChatSourceChoices @@ -141,7 +142,7 @@ def reset_application_node_dict(application_node_dict, runtime_node_id, node_dat '${value}', content) application_node['content'] = res.replace('${value}', value) except Exception as e: - pass + maxkb_logger.warning(f'reset_application_node_dict error: {e}', exc_info=True) class BaseApplicationNode(IApplicationNode): diff --git a/apps/common/utils/tool_code.py b/apps/common/utils/tool_code.py index 6b16e8ed1af..1f44a9741be 100644 --- a/apps/common/utils/tool_code.py +++ b/apps/common/utils/tool_code.py @@ -73,7 +73,7 @@ def init_sandbox_dir(): local_ip = socket.gethostbyname(hostname) banned_hosts = f"{banned_hosts},{local_ip}" banned_hosts = ",".join(s.strip() for s in banned_hosts.split(",") if s.strip() and s.strip().lower() != hostname.lower()) - with open(sandbox_conf_file_path, "w") as f: + with open(sandbox_conf_file_path, "w", encoding='utf-8') as f: f.write(f"SANDBOX_PYTHON_BANNED_HOSTS={banned_hosts}\n") f.write(f"SANDBOX_PYTHON_ALLOW_DL_PATHS={','.join(sorted(set(filter(None, sys.path + _sandbox_python_sys_path + allow_dl_paths.split(',')))))}\n") f.write(f"SANDBOX_PYTHON_ALLOW_DL_OPEN={allow_dl_open}\n") diff --git a/apps/models_provider/impl/local_model_provider/model/embedding/web.py b/apps/models_provider/impl/local_model_provider/model/embedding/web.py index bfc22bc9ba6..42c780adc04 100644 --- a/apps/models_provider/impl/local_model_provider/model/embedding/web.py +++ b/apps/models_provider/impl/local_model_provider/model/embedding/web.py @@ -46,7 +46,7 @@ def embed_documents(self, texts: List[str]) -> List[List[float]]: bind = f'{CONFIG.get("LOCAL_MODEL_HOST")}:{CONFIG.get("LOCAL_MODEL_PORT")}' prefix = CONFIG.get_admin_path() res = requests.post( - f'{CONFIG.get("LOCAL_MODEL_PROTOCOL")}://{bind}/{prefix}/api/model/{self.model_id}/embed_documents', + f'{CONFIG.get("LOCAL_MODEL_PROTOCOL")}://{bind}{prefix}/api/model/{self.model_id}/embed_documents', {'texts': texts}) result = res.json() if result.get('code', 500) == 200: diff --git a/apps/trigger/handler/impl/task/application_task.py b/apps/trigger/handler/impl/task/application_task.py index 29ec3d478a7..1b6b200f592 100644 --- a/apps/trigger/handler/impl/task/application_task.py +++ b/apps/trigger/handler/impl/task/application_task.py @@ -51,6 +51,8 @@ def valid_value_type(value, _type): return isinstance(value, int) if _type == 'boolean': return isinstance(value, bool) + if _type == 'any': + return True return isinstance(value, str)