Extracting Function Names and Arguments for ToolExecutor Not Working with ChatVertexAI, Despite Success with ChatOpenAI and ChatAnthropicTools #19400
Closed
jorge2najo
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Issue Description:
I'm attempting to extract the function_name and associated arguments using a specific structure that integrates seamlessly with ChatOpenAI or ChatAnthropicTools. This process facilitates the utilization of the ToolExecutor module from langgraph.prebuilt.tool_executor to execute the extracted function and arguments.
However, when trying to apply the same methodology with ChatVertexAI, I encounter difficulties. Could you confirm if this functionality is currently supported or implemented for ChatVertexAI? If so, guidance on how to properly achieve this would be greatly appreciated.
Script I would like to use:
Expected output:
Output ChatOpenAI
'''
content='' additional_kwargs={'function_call': {'arguments': '{"name":"Fido","color":"black","fav_food":"bones"}', 'name': 'record_dog_tool'}} response_metadata={'finish_reason': 'function_call', 'logprobs': None}
'''
Output ChatAnthropicTools
'''
content='' additional_kwargs={'tool_calls': [{'function': {'name': 'record_dog_tool', 'arguments': '{"name": "Fido", "color": "black", "fav_food": "bones"}'}, 'type': 'function'}]}
'''
For ChatVertexAI should be something similar like this:
Output ChatVertexAI
content= additional_kwargs={name: 'record_dog_tool', 'arguments':{'name': 'Fido', 'color': 'black', 'fav_food': 'bones', 'type': function'}}
Beta Was this translation helpful? Give feedback.
All reactions