Ahmed Raza Ur Rehman
11/10/2024, 2:38 PMVapi
11/10/2024, 2:41 PMVapi
11/10/2024, 2:41 PMpython
from your_voice_api_sdk import VoiceAPIClient # Replace with the actual import from the SDK
# Initialize the Voice API client with your credentials
client = VoiceAPIClient(api_key='your_api_key')
# Define the configuration for the non-persistent assistant
assistant_config = {
'first_message': 'Hello, how can I assist you today?',
# Add other configuration settings as needed
}
# Create a non-persistent assistant on the go
assistant = client.create_assistant(config=assistant_config, persistent=False)
# Start a web call and connect it to the non-persistent assistant
web_call = client.start_web_call(assistant_id=assistant.id)
# Output the web call details
print(f"Web call started with ID: {web_call.id}")
Please replace 'your_voice_api_key'
with your actual API key and your_voice_api_sdk
with the correct import path for the Server SDK you are using. The create_assistant
and start_web_call
functions are placeholders for the actual functions provided by the SDK, which you would need to replace with the correct function calls based on the SDK's documentation.
If you need more specific details or if you encounter any issues, please let me know, and I'll be happy to assist further!Shubham Bajaj
11/11/2024, 12:23 PM