Function call
# support
s
How can i set up "wait" messages in function calling with custom-llm implementation?
v
@Sergio S To set up "wait" messages in function calling with a custom LLM implementation, you would typically need to implement a delay mechanism that triggers a message to the user after a certain period of time has passed without a response from the LLM. Here's a general approach you can take: 1. Determine the appropriate delay time after which you want to send a "wait" message. This could be based on the
llmRequestDelaySeconds
parameter. 2. Set up a timer or delay function in your code that starts when you send a request to the LLM. 3. If the LLM response is not received within the specified delay time, trigger a message to the user indicating that the system is still processing their request. 4. Once the LLM response is received, you can either cancel the timer if it's still running or proceed with handling the response if the "wait" message has already been sent. If you need to configure or change the
llmRequestDelaySeconds
parameter, you can do so by providing a new value for it. If you'd like to proceed with setting or updating this parameter, please provide the desired number of seconds for the delay, and I can assist you with that.
You can continue this conversation by mentioning me in the message.
s
can you eloborate more with example?
s
Sure, I want my Custom-LLM to handle everything, so function calling won't be on the VAPI side. What I want to achieve is a flow like this: 1. VAPI makes a request to the model (Custom-LLM). 2. My Custom-LLM decides to use a function. 3. If the function takes too long to retrieve the response, I want to send interim messages to VAPI such as "Please wait a moment" or "We are searching for the information." 4. Once the function gets the response, send the result data to VAPI. I’m not sure how to handle step 3 because if I return something as the Custom-LLM response, it would be considered as the final response.
Like the interim messages of request-start and request-response-delayed from tool calling
s
as of now interim messages are not available for functions calling.
4 Views