Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: custom tool input number fail (#6200)

guogeer4fdcb30ff84c
diff --git a/api/core/app/apps/advanced_chat/app_runner.py b/api/core/app/apps/advanced_chat/app_runner.py
index 96e9319dda5..38566217007 100644
--- a/api/core/app/apps/advanced_chat/app_runner.py
+++ b/api/core/app/apps/advanced_chat/app_runner.py
@@ -255,6 +255,12 @@ class AdvancedChatAppRunner(AppRunner):
)
index += 1
time.sleep(0.01)
+ else:
+ queue_manager.publish(
+ QueueTextChunkEvent(
+ text=text
+ ), PublishFrom.APPLICATION_MANAGER
+ )
queue_manager.publish(
QueueStopEvent(stopped_by=stopped_by),
diff --git a/api/core/tools/tool/api_tool.py b/api/core/tools/tool/api_tool.py
index c8b683f9ef1..69e3dfa0612 100644
--- a/api/core/tools/tool/api_tool.py
+++ b/api/core/tools/tool/api_tool.py
@@ -238,7 +238,7 @@ class ApiTool(Tool):
return int(value)
elif property['type'] == 'number':
# check if it is a float
- if '.' in value:
+ if '.' in str(value):
return float(value)
else:
return int(value)