refac
This commit is contained in:
@@ -1164,6 +1164,15 @@ async def process_tool_result(
|
||||
'url': file_url,
|
||||
}
|
||||
)
|
||||
elif item.get('type') == 'resource':
|
||||
resource = item.get('resource', {})
|
||||
text = resource.get('text', '')
|
||||
if isinstance(text, str) and text:
|
||||
try:
|
||||
text = json.loads(text)
|
||||
except json.JSONDecodeError:
|
||||
pass
|
||||
tool_response.append(text)
|
||||
tool_result = tool_response[0] if len(tool_response) == 1 else tool_response
|
||||
else: # OpenAPI
|
||||
for item in tool_result:
|
||||
|
||||
Reference in New Issue
Block a user