فهرست منبع

fix: custom tool input number fail (#6200)

Co-authored-by: jinqi.guo <jinqi.guo@ubtrobot.com>
guogeer 9 ماه پیش
والد
کامیت
4fdcb30ff8
2فایلهای تغییر یافته به همراه7 افزوده شده و 1 حذف شده
  1. 6 0
      api/core/app/apps/advanced_chat/app_runner.py
  2. 1 1
      api/core/tools/tool/api_tool.py

+ 6 - 0
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),

+ 1 - 1
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)