how to send back tools call response in case of cu...
# support
m
hey can you please share example of how to send back response in case of function call thank you
m
@Shubham Bajaj
@Sahil
we are using custom llm
v
@mukul Certainly! When a function call is made, the server should respond with a JSON object containing the function's response. Here's an example of how a response would look after a successful function call:
Copy code
json
{ "result": "The operation was successful." }
If the function call returns an object with multiple fields, the response would include those fields in the JSON object, like so:
Copy code
json
{
  "result": {
    "message": "The operation was successful.",
    "additional_info": "Some more details about the operation."
  }
}
These responses are then appended to the conversation, and the assistant will decide what to do with the response based on its system prompt. If you have a specific function in mind that you'd like to call or need more information on how to format the response for a particular scenario, please let me know!
You can continue this conversation by mentioning me in the message.
s
@mukul @Mayank Sharma Are you using Vapi tools or LLM native tools?
m
llm native(function call)
s
@mukul You can use the following code as an example for LLM native function calling: https://github.com/ArtemPolydom/advanced-concepts-custom-llm. I will write the complete documentation for custom LLM with native tools calling and VAPI tools calling, and then let you know. Please let me know how it goes.
11 Views