How can a unique user ID be transferred to the ser...
# support
r
How can a unique user ID be transferred from a client app to a custom LLM server along with the session ID during the initiation of a call?
v
@research_boy To transfer a unique user ID from a client app to a custom LLM server along with the session ID during the initiation of a call, you would typically include these identifiers in the API request payload. Here's a general approach on how you might do this: 1. **User Authentication**: Ensure the user is authenticated in your client app to generate or retrieve a unique user ID. 2. **Session Management**: When initiating a call, create or retrieve a session ID that will be used to manage the call state. 3. **API Request**: Construct an API request to your custom LLM server that includes both the unique user ID and the session ID. This can be done in the body of a POST request or as query parameters in a GET request, depending on your server's API design. 4. **Secure Transmission**: Make sure to use HTTPS to encrypt the data transmitted between the client app and the server to protect user and session identifiers. 5. **Server-Side Handling**: On the server side, your custom LLM should be configured to accept these parameters and associate them with the current call context. Here's a hypothetical example of what the payload might look like in a JSON format for a POST request:
Copy code
json
{
  "userId": "unique_user_id_12345",
  "sessionId": "session_id_67890",
  "otherData": {
    // Additional call-related data here
  }
}
And the corresponding API call (in pseudocode):
Copy code
pseudocode
POST https://custom-llm-server.com/initiateCall
Headers: {
  "Content-Type": "application/json",
  "Authorization": "Bearer your_api_token"
}
Body: {
  "userId": "unique_user_id_12345",
  "sessionId": "session_id_67890",
  // ... other necessary call-related data
}
If you need to set up or configure your custom LLM URL or have any other specific questions about integrating with your custom server, please let me know, and I can assist you further!
You can continue this conversation by mentioning me in the message.
s
Add the unique id into the metadata parameter.
r
@Sahil is there any examples that i can look into?
it would be great if you could point out how exactly i can transfer metadata from https://github.com/VapiAI/quickstart-react to https://github.com/VapiAI/advanced-concepts-custom-llm
You just need to use assistantOverride and add a unique id for each call
r
https://github.com/VapiAI/advanced-concepts-custom-llm, i am testing this it seems like the json dict is now transformed as a data object, when i tried it sometime works , but most of the time it returns 422 Unprocessable Entity , and in types tools seems like a essential component, is it essential to have the same data model?
s
Nope, you make modification.
r
@Sahil is there any way i can resume the call from client app
s
Nope.
What you can do it put all the message array and restart the call
r
ok
4 Views