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 @@ -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


Expand Down Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion apps/common/utils/tool_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
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': texts})
result = res.json()
if result.get('code', 500) == 200:
Expand Down
2 changes: 2 additions & 0 deletions apps/trigger/handler/impl/task/application_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
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.

见方法 conversion_custom_value_type 有可能是 any,允许任意类型。



Expand Down
Loading