Package: retell
retell🏗Welcome to your new SDK!🏗It has been generated successfully based on your OpenAPI spec. However, it is not yet ready for production use. Here are some next steps:🛠 Make your SDK feel handcrafted bycustomizing it♻️ Refine your SDK quickly by iterating locally with theSpeakeasy CLI🎁 Publish your SDK to package managers byconfiguring automatic publishing✨ When ready to productionize, delete this section from the READMESDK InstallationpipinstallretellSDK Example UsageCreate an outbound phone callInitiate an outbound phone call.importsdkfromsdk.modelsimportoperationss=sdk.SDK(api_key="<YOUR_BEARER_TOKEN_HERE>",)req=operations.CreatePhoneCallRequestBody(phone_number=operations.PhoneNumber(from_='+14159095857',to='+14159095858',),)res=s.create_phone_call(req)ifres.objectisnotNone:# handle responsepassRetrieve a on-going or finished callRetrieve details of a specific callimportsdks=sdk.SDK(api_key="<YOUR_BEARER_TOKEN_HERE>",)res=s.get_call(call_id='119c3f8e47135a29e65947eeb34cf12d')ifres.call_detailisnotNone:# handle responsepassList all web or phone callsRetrieve call detailsimportsdkfromsdk.modelsimportoperationss=sdk.SDK(api_key="<YOUR_BEARER_TOKEN_HERE>",)res=s.list_calls(filter_criteria=operations.FilterCriteria(agent_id=['oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',],call_type=[operations.CallType.INBOUND_PHONE_CALL,operations.CallType.OUTBOUND_PHONE_CALL,],before_start_timestamp=1703302407399,after_start_timestamp=1703302407300,before_end_timestamp=1703302428899,after_end_timestamp=1703302428800,),sort_order=operations.SortOrder.DESCENDING,limit=850344)ifres.call_detailsisnotNone:# handle responsepassCreate a new voice AI agentCreate a new agentimportsdkfromsdk.modelsimportoperationss=sdk.SDK(api_key="<YOUR_BEARER_TOKEN_HERE>",)req=operations.CreateAgentRequestBody(prompt='You are a marketing assistant. You help come up with creative content ideas and content like marketing emails, blog posts, tweets, ad copy and product descriptions. You respond concisely, with filler words in it.',voice_id='elevenlabs-xxcrwXReTKMHWjqi7Q27',agent_name='Jarvis',enable_begin_message=True,begin_message='Hello there, how can I help you?',enable_end_call=True,enable_end_message=False,end_message='Hope you have a good day, goodbye.',)res=s.create_agent(req)ifres.agentisnotNone:# handle responsepassRetrieve details of an agentRetrieve details of a specific agentimportsdks=sdk.SDK(api_key="<YOUR_BEARER_TOKEN_HERE>",)res=s.get_agent(agent_id='16b980523634a6dc504898cda492e939')ifres.agentisnotNone:# handle responsepassList all agentsList all agentsimportsdks=sdk.SDK(api_key="<YOUR_BEARER_TOKEN_HERE>",)res=s.list_agents()ifres.agentsisnotNone:# handle responsepassUpdate an existing agentUpdate an existing agentimportsdkfromsdk.modelsimportcomponentss=sdk.SDK(api_key="<YOUR_BEARER_TOKEN_HERE>",)res=s.update_agent(agent_id='16b980523634a6dc504898cda492e939',agent_no_default_no_required=components.AgentNoDefaultNoRequired(prompt='You are a marketing assistant. You help come up with creative content ideas and content like marketing emails, blog posts, tweets, ad copy and product descriptions. You respond concisely, with filler words in it.',voice_id='elevenlabs-xxcrwXReTKMHWjqi7Q27',agent_name='Jarvis',enable_begin_message=True,begin_message='Hello there, how can I help you.',enable_end_call=True,enable_end_message=False,end_message='Hope you have a good day, goodbye.',))ifres.agentisnotNone:# handle responsepassDelete an existing agentDelete an existing agentimportsdks=sdk.SDK(api_key="<YOUR_BEARER_TOKEN_HERE>",)res=s.delete_agent(agent_id='oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD')ifres.status_code==200:# handle responsepassCreate a new phone numberCreate a new phone numberimportsdkfromsdk.modelsimportoperationss=sdk.SDK(api_key="<YOUR_BEARER_TOKEN_HERE>",)req=operations.CreatePhoneNumberRequestBody(agent_id='oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',area_code=415,)res=s.create_phone_number(req)ifres.phone_numberisnotNone:# handle responsepassRetrieve info about a specific numberRetrieve info about a specific numberimportsdks=sdk.SDK(api_key="<YOUR_BEARER_TOKEN_HERE>",)res=s.get_phone_number(phone_number='+14159095857')ifres.phone_numberisnotNone:# handle responsepassList all purchased and active phone numbersList all purchased and active phone numbersimportsdks=sdk.SDK(api_key="<YOUR_BEARER_TOKEN_HERE>",)res=s.list_phone_numbers()ifres.phone_numbersisnotNone:# handle responsepassUpdate an existing phone numberUpdate an existing phone numberimportsdkfromsdk.modelsimportoperationss=sdk.SDK(api_key="<YOUR_BEARER_TOKEN_HERE>",)res=s.update_phone_agent(phone_number='+14159095857',request_body=operations.UpdatePhoneAgentRequestBody(agent_id='+14159095857',))ifres.phone_numberisnotNone:# handle responsepassDelete a specific phone numberDelete a specific phone numberimportsdks=sdk.SDK(api_key="<YOUR_BEARER_TOKEN_HERE>",)res=s.delete_phone_number(phone_number='<value>')ifres.status_code==200:# handle responsepassAvailable Resources and OperationsSDKcreate_phone_call- Initiate an outbound phone call.get_call- Retrieve details of a specific calllist_calls- Retrieve call detailscreate_agent- Create a new agentget_agent- Retrieve details of a specific agentlist_agents- List all agentsupdate_agent- Update an existing agentdelete_agent- Delete an existing agentcreate_phone_number- Create a new phone numberget_phone_number- Retrieve info about a specific numberlist_phone_numbers- List all purchased and active phone numbersupdate_phone_agent- Update an existing phone numberdelete_phone_number- Delete a specific phone numberError HandlingHandling errors in this SDK should largely match your expectations.  All operations return a response object or raise an error.  If Error objects are specified in your OpenAPI Spec, the SDK will raise the appropriate Error type.Error ObjectStatus CodeContent Typeerrors.CreatePhoneCallResponseBody400,401,402,422,429,500application/jsonerrors.SDKError4x-5xx/Exampleimportsdkfromsdk.modelsimporterrors,operationss=sdk.SDK(api_key="<YOUR_BEARER_TOKEN_HERE>",)req=operations.CreatePhoneCallRequestBody(phone_number=operations.PhoneNumber(from_='+14159095857',to='+14159095858',),)res=Nonetry:res=s.create_phone_call(req)excepterrors.CreatePhoneCallResponseBodyase:# handle exceptionraise(e)excepterrors.SDKErrorase:# handle exceptionraise(e)ifres.objectisnotNone:# handle responsepassServer SelectionSelect Server by IndexYou can override the default server globally by passing a server index to theserver_idx: intoptional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:#ServerVariables0https://api.re-tell.aiNoneExampleimportsdkfromsdk.modelsimportoperationss=sdk.SDK(server_idx=0,api_key="<YOUR_BEARER_TOKEN_HERE>",)req=operations.CreatePhoneCallRequestBody(phone_number=operations.PhoneNumber(from_='+14159095857',to='+14159095858',),)res=s.create_phone_call(req)ifres.objectisnotNone:# handle responsepassOverride Server URL Per-ClientThe default server can also be overridden globally by passing a URL to theserver_url: stroptional parameter when initializing the SDK client instance. For example:importsdkfromsdk.modelsimportoperationss=sdk.SDK(server_url="https://api.re-tell.ai",api_key="<YOUR_BEARER_TOKEN_HERE>",)req=operations.CreatePhoneCallRequestBody(phone_number=operations.PhoneNumber(from_='+14159095857',to='+14159095858',),)res=s.create_phone_call(req)ifres.objectisnotNone:# handle responsepassCustom HTTP ClientThe Python SDK makes API calls using therequestsHTTP library.  In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with a customrequests.Sessionobject.For example, you could specify a header for every request that this sdk makes as follows:importsdkimportrequestshttp_client=requests.Session()http_client.headers.update({'x-custom-header':'someValue'})s=sdk.SDK(client:http_client)AuthenticationPer-Client Security SchemesThis SDK supports the following security scheme globally:NameTypeSchemeapi_keyhttpHTTP BearerTo authenticate with the API theapi_keyparameter must be set when initializing the SDK client instance. For example:importsdkfromsdk.modelsimportoperationss=sdk.SDK(api_key="<YOUR_BEARER_TOKEN_HERE>",)req=operations.CreatePhoneCallRequestBody(phone_number=operations.PhoneNumber(from_='+14159095857',to='+14159095858',),)res=s.create_phone_call(req)ifres.objectisnotNone:# handle responsepassDevelopmentMaturityThis SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage
to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally
looking for the latest version.ContributionsWhile we value open-source contributions to this SDK, this library is generated programmatically.
Feel free to open a PR or a Github issue as a proof of concept and we'll do our best to include it in a future release!SDK Created bySpeakeasy