tool calling not completing sentence
# support
k
calling the tools work, but it doesnt complete the sentence following the repos on github it returns
Copy code
{
            "type": "request-complete",
            "content": "The weather in location is"
          },
but it doesnt end up doing anything after that I am returning a valid weather info as
Copy code
return res.status(200).json({
      results: [
        {
          toolCallId: toolCallId,
          result: weather.description
        }
      ]

    });
https://cdn.discordapp.com/attachments/1261139364210278411/1261139653923438673/Screenshot_2024-07-12_at_10.58.32_AM.png?ex=6691df54&is=66908dd4&hm=966e63e302ddcef16eac83cd8b612f532b2b134ca8fa54555caf7400c4377de8&
v
@kyeshmz It seems like there might be an issue with how the response is being handled after calling the tool. To ensure that the complete sentence with the weather information is returned, you may need to check the integration between the tool that fetches the weather information and the system that constructs the final sentence. Please ensure that the
weather.description
in your response contains the full weather information you want to convey, and that the system which receives this response is correctly appending it to the incomplete sentence "The weather in location is". If you've verified that the
weather.description
is correct and the issue persists, there might be a problem with the response parsing or sentence construction logic in the system that's supposed to complete the sentence. In that case, you might need to debug the code responsible for this part of the process. If you need further assistance with the specifics of the code or the system, please provide more details or ask support for more info on this.
You can continue this conversation by mentioning me in the message.
Got it. Tagging @User for additional help.
k
weather returns
Copy code
weather {
  id: 804,
  main: 'Clouds',
  description: 'overcast clouds',
  icon: '04n'
}
so in this case I am returning overcast clouds
s
you have to return it as stringified.
k
I return only the description in the format that is required with the chatid
s
share the call id with timestamp
k
just made a new one @Shubham Bajaj createdAt: "2024-07-15T13:32:43.511Z" ​ id: "3cda7a34-2d23-4fc8-96ec-3f859ab7aa59" ​ orgId: "563362b3-06df-486d-8c71-b0cc154d82e7"
s
@kyeshmz you have defined three tools with same name and returning wrong tool call id.
instead define a single function and pass user input parameter to it and return the correct tool call id it wiill work.
k
I don't understand, when using the sdk and defining a assistant with a tool, does that create a tool each time? It should be ephemeral right?
Are there documentation on how to debug which tools are being made through the sdk?
s
No it doesn't but by mistake you have done it.
Your passing them with transient assistant right?
k
Yes, so I don't know how I have done it
It wouldn't matter if all the tools do the same thing though
@Shubham Bajaj any heads-up on what I should be doing instead?
s
did you define the tool with unique names and returning correct tool call id if yes the please share the call id i will look if no then please do it ita a request
its just using the ts sdk
s
How your returning the response?
is the toolid not the same?
s
yes
@kyeshmz check DM.
k
Yeah just figured that I should make everything through GUI and not make the actual tool through declaration since it doesn't work
s
please check the DM.
k
You haven't sent any
s
done * 3
@kyeshmz is it resolved now?
k
Yeah I just don't use the sdk to make tools anymore
s
to check your code i have sent you dms but closing this post for now.
5 Views