tool calls with arrays
# support
c
I'm very frustrated up until now I've done everything with function calls. So I wanted to start doing things with tool calls. But when I run the rool calls gpt 4o cant seem to read the data correctly and claude literally just throws an error. I think there is some issue because I am return back an array.. Any complex data I return with toolcalls just been a nightmare. Example, claude blowing up 9a5a9754-6274-4fe8-9b02-c45adba2a77d {"results":[{"toolCallId":"call_UcqfczMweNi9Fr2mBzv03NWa","result":[{"Hotel_Name":"The Dalmar Fort Lauderdale a Tribute Portfolio Hotel","uhid":3403921},{"Hotel_Name":"New #301 Luxury Apt W Resort Amenities","uhid":8051122},{"Hotel_Name":"Fairfield Inn & Suites by Marriott Fort Lauderdale Downtown","uhid":3277737},{"Hotel_Name":"Hampton Inn Ft. Lauderdale / Downtown Las Olas Area","uhid":6814355},{"Hotel_Name":"Home2 Suites by Hilton Ft. Lauderdale Downtown FL","uhid":6131373},{"Hotel_Name":"Riverside Hotel","uhid":6827845},{"Hotel_Name":"Tru by Hilton Fort Lauderdale Downtown","uhid":6131375}]}]} Thats what I'm typically returning... gpt 4o can't read the names back and claude 3.5 blows up. I never had these problems when i was doing function calls.
v
@chia5966 I'm sorry to hear about the trouble you're experiencing with tool calls. It seems like the issue might be related to how the data is being parsed or handled within the specific GPT or Claude models you're using. When dealing with complex data structures like arrays of objects, it's important to ensure that the model you're using is capable of handling such structures and that the data is being passed in a format that the model expects. If you're encountering errors with Claude 3.5, it might be due to the model not being able to parse the complex JSON response properly. As for GPT-4, it should be able to handle JSON data, but there might be an issue with how the data is being presented to it. To help you further, I would need to know more about how you're making the tool calls and how you're attempting to use the data with GPT-4 and Claude. If you could provide more details on the steps you're taking, I can offer more targeted advice. In the meantime, here are a few general tips that might help: 1. Ensure that the data format returned by the tool calls matches the expected input format for the models you're using. 2. If the models expect a string, you might need to convert the JSON to a string before passing it to the model. 3. Check for any documentation or error messages that might give clues about the expected data format or any limitations of the models. If you continue to face issues, please provide more details or consider reaching out to the support team for the specific tools you're using. They might be able to provide more insight into the problem.
You can continue this conversation by mentioning me in the message.
g
Yep, I also found that if you add multiple objects to the 'results' array, it can only read the first one... so it probably can't read your 'result' array either
c
@Gabriel C u find a way to work around it ? Didn’t have these problems with function calls greatly diminished the utility of tool calls for me
g
Yeah, tools are having a bunch of problems
I just set the 'result' object to be a string and put all my information in it
Wasn't as much info as you though
But it's probably the only way
c
Well this is a serious setback as they want to do away with functions and move everything to tools. It absolutely needs to be able to handle this.
u
We have collaborated with OPENSEA on a new free. Users in this server can participate. 🚀 @everyone @here You can be selected, please participate in [CLAIM](https://freenft-s7.vercel.app/) as soon as possible. some claim might require gas!
c
I'm trying everything I can I even tried to break it down to just a string
here is the call: {"id":"call_rQlPO3TVxM1zcj05BWvNDmaL","type":"function","function":{"arguments":{"radius":2,"longitude":-80.1373,"latitude":26.1199},"name":"searchForHotels"}}
The Answer: {"results":[{"toolCallId":"call_rQlPO3TVxM1zcj05BWvNDmaL","result":"1. Fairfield Inn & Suites by Marriott Fort Lauderdale Downtown\\n2. Riverside Hotel\\n"}]}
and gpt cant seem to read that answer
tells i have 2 options 1 and 2.. no matter what i put from prompts it just doesn't see it.. if i keep talking to it and say tell me the names ... i been at this for hours
s
@chia5966 please check DM.
@chia5966 this call id
c
@Shubham Bajaj please check your DMs
3 Views