Skip to content

Commit

Permalink
fix: custom tool input number fail (#6200)
Browse files Browse the repository at this point in the history
Co-authored-by: jinqi.guo <[email protected]>
  • Loading branch information
guogeer and jinqi.guo authored Jul 14, 2024
1 parent 07add06 commit 4fdcb30
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions api/core/app/apps/advanced_chat/app_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,12 @@ def _stream_output(self, queue_manager: AppQueueManager,
)
index += 1
time.sleep(0.01)
else:
queue_manager.publish(
QueueTextChunkEvent(
text=text
), PublishFrom.APPLICATION_MANAGER
)

queue_manager.publish(
QueueStopEvent(stopped_by=stopped_by),
Expand Down
2 changes: 1 addition & 1 deletion api/core/tools/tool/api_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def _convert_body_property_type(self, property: dict[str, Any], value: Any) -> A
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)
Expand Down

0 comments on commit 4fdcb30

Please sign in to comment.