diff --git a/.fernignore b/.fernignore index 31de670..068ed9f 100644 --- a/.fernignore +++ b/.fernignore @@ -5,8 +5,4 @@ src/vapi/assistants/types/update_assistant_dto_server_messages_item.py src/vapi/types/assistant_overrides_server_messages_item.py src/vapi/types/assistant_server_messages_item.py src/vapi/types/create_assistant_dto_server_messages_item.py -src/vapi/core/__init__.py -# Reduce size of the imports -src/vapi/__init__.py -src/vapi/types/__init__.py diff --git a/poetry.lock b/poetry.lock index 3ddef64..c2ddd86 100644 --- a/poetry.lock +++ b/poetry.lock @@ -38,13 +38,13 @@ trio = ["trio (>=0.26.1)"] [[package]] name = "certifi" -version = "2025.6.15" +version = "2025.8.3" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.7" files = [ - {file = "certifi-2025.6.15-py3-none-any.whl", hash = "sha256:2e0c7ce7cb5d8f8634ca55d2ba7e6ec2689a2fd6537d8dec1296a477a4910057"}, - {file = "certifi-2025.6.15.tar.gz", hash = "sha256:d747aa5a8b9bbbb1bb8c22bb13e22bd1f18e9796defa16bab421f7f7a317323b"}, + {file = "certifi-2025.8.3-py3-none-any.whl", hash = "sha256:f6c12493cfb1b06ba2ff328595af9350c65d6644968e5d3a2ffd78699af217a5"}, + {file = "certifi-2025.8.3.tar.gz", hash = "sha256:e564105f78ded564e3ae7c923924435e1daa7463faeab5bb932bc53ffae63407"}, ] [[package]] diff --git a/pyproject.toml b/pyproject.toml index 85f6000..f4df395 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ name = "vapi_server_sdk" [tool.poetry] name = "vapi_server_sdk" -version = "1.7.0" +version = "1.7.1" description = "" readme = "README.md" authors = [] diff --git a/reference.md b/reference.md index 1d057da..4f63537 100644 --- a/reference.md +++ b/reference.md @@ -1,6 +1,6 @@ # Reference -## Calls -
client.calls.list(...) +## Assistants +
client.assistants.list(...)
@@ -18,7 +18,7 @@ from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) -client.calls.list() +client.assistants.list() ```
@@ -34,34 +34,6 @@ client.calls.list()
-**id:** `typing.Optional[str]` — This is the unique identifier for the call. - -
-
- -
-
- -**assistant_id:** `typing.Optional[str]` — This will return calls with the specified assistantId. - -
-
- -
-
- -**phone_number_id:** `typing.Optional[str]` - -This is the phone number that will be used for the call. To use a transient number, use `phoneNumber` instead. - -Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type. - -
-
- -
-
- **limit:** `typing.Optional[float]` — This is the maximum number of items to return. Defaults to 100.
@@ -146,7 +118,7 @@ Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type.
-
client.calls.create(...) +
client.assistants.create(...)
@@ -164,7 +136,7 @@ from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) -client.calls.create() +client.assistants.create() ```
@@ -180,11 +152,15 @@ client.calls.create()
-**customers:** `typing.Optional[typing.Sequence[CreateCustomerDto]]` +**transcriber:** `typing.Optional[CreateAssistantDtoTranscriber]` — These are the options for the assistant's transcriber. + +
+
-This is used to issue batch calls to multiple customers. +
+
-Only relevant for `outboundPhoneCall`. To call a single customer, use `customer` instead. +**model:** `typing.Optional[CreateAssistantDtoModel]` — These are the options for the assistant's LLM.
@@ -192,7 +168,7 @@ Only relevant for `outboundPhoneCall`. To call a single customer, use `customer`
-**name:** `typing.Optional[str]` — This is the name of the call. This is just for your own reference. +**voice:** `typing.Optional[CreateAssistantDtoVoice]` — These are the options for the assistant's voice.
@@ -200,7 +176,11 @@ Only relevant for `outboundPhoneCall`. To call a single customer, use `customer`
-**schedule_plan:** `typing.Optional[SchedulePlan]` — This is the schedule plan of the call. +**first_message:** `typing.Optional[str]` + +This is the first message that the assistant will say. This can also be a URL to a containerized audio file (mp3, wav, etc.). + +If unspecified, assistant will wait for user to speak and use the model to respond once they speak.
@@ -208,7 +188,7 @@ Only relevant for `outboundPhoneCall`. To call a single customer, use `customer`
-**transport:** `typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]` — This is the transport of the call. +**first_message_interruptions_enabled:** `typing.Optional[bool]`
@@ -216,14 +196,16 @@ Only relevant for `outboundPhoneCall`. To call a single customer, use `customer`
-**assistant_id:** `typing.Optional[str]` +**first_message_mode:** `typing.Optional[CreateAssistantDtoFirstMessageMode]` -This is the assistant ID that will be used for the call. To use a transient assistant, use `assistant` instead. +This is the mode for the first message. Default is 'assistant-speaks-first'. -To start a call with: -- Assistant, use `assistantId` or `assistant` -- Squad, use `squadId` or `squad` -- Workflow, use `workflowId` or `workflow` +Use: +- 'assistant-speaks-first' to have the assistant speak first. +- 'assistant-waits-for-user' to have the assistant wait for the user to speak first. +- 'assistant-speaks-first-with-model-generated-message' to have the assistant speak first with a message generated by the model based on the conversation state. (`assistant.model.messages` at call start, `call.messages` at squad transfer points). + +@default 'assistant-speaks-first'
@@ -231,14 +213,11 @@ To start a call with:
-**assistant:** `typing.Optional[CreateAssistantDto]` - -This is the assistant that will be used for the call. To use an existing assistant, use `assistantId` instead. +**voicemail_detection:** `typing.Optional[CreateAssistantDtoVoicemailDetection]` -To start a call with: -- Assistant, use `assistant` -- Squad, use `squad` -- Workflow, use `workflow` +These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=[VoicemailTool]. +This uses Twilio's built-in detection while the VoicemailTool relies on the model to detect if a voicemail was reached. +You can use neither of them, one of them, or both of them. By default, Twilio built-in detection is enabled while VoicemailTool is not.
@@ -246,7 +225,7 @@ To start a call with:
-**assistant_overrides:** `typing.Optional[AssistantOverrides]` — These are the overrides for the `assistant` or `assistantId`'s settings and template variables. +**client_messages:** `typing.Optional[typing.Sequence[CreateAssistantDtoClientMessagesItem]]` — These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transfer-update,transcript,tool-calls,user-interrupted,voice-input,workflow.node.started. You can check the shape of the messages in ClientMessage schema.
@@ -254,14 +233,7 @@ To start a call with:
-**squad_id:** `typing.Optional[str]` - -This is the squad that will be used for the call. To use a transient squad, use `squad` instead. - -To start a call with: -- Assistant, use `assistant` or `assistantId` -- Squad, use `squad` or `squadId` -- Workflow, use `workflow` or `workflowId` +**server_messages:** `typing.Optional[typing.Sequence[CreateAssistantDtoServerMessagesItem]]` — These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,handoff-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema.
@@ -269,14 +241,11 @@ To start a call with:
-**squad:** `typing.Optional[CreateSquadDto]` +**max_duration_seconds:** `typing.Optional[float]` -This is a squad that will be used for the call. To use an existing squad, use `squadId` instead. +This is the maximum number of seconds that the call will last. When the call reaches this duration, it will be ended. -To start a call with: -- Assistant, use `assistant` or `assistantId` -- Squad, use `squad` or `squadId` -- Workflow, use `workflow` or `workflowId` +@default 600 (10 minutes)
@@ -284,14 +253,10 @@ To start a call with:
-**workflow_id:** `typing.Optional[str]` - -This is the workflow that will be used for the call. To use a transient workflow, use `workflow` instead. +**background_sound:** `typing.Optional[CreateAssistantDtoBackgroundSound]` -To start a call with: -- Assistant, use `assistant` or `assistantId` -- Squad, use `squad` or `squadId` -- Workflow, use `workflow` or `workflowId` +This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'. +You can also provide a custom sound by providing a URL to an audio file.
@@ -299,14 +264,13 @@ To start a call with:
-**workflow:** `typing.Optional[CreateWorkflowDto]` +**model_output_in_messages_enabled:** `typing.Optional[bool]` -This is a workflow that will be used for the call. To use an existing workflow, use `workflowId` instead. +This determines whether the model's output is used in conversation history rather than the transcription of assistant's speech. -To start a call with: -- Assistant, use `assistant` or `assistantId` -- Squad, use `squad` or `squadId` -- Workflow, use `workflow` or `workflowId` +Default `false` while in beta. + +@default false
@@ -314,7 +278,7 @@ To start a call with:
-**workflow_overrides:** `typing.Optional[WorkflowOverrides]` — These are the overrides for the `workflow` or `workflowId`'s settings and template variables. +**transport_configurations:** `typing.Optional[typing.Sequence[TransportConfigurationTwilio]]` — These are the configurations to be passed to the transport providers of assistant's calls, like Twilio. You can store multiple configurations for different transport providers. For a call, only the configuration matching the call transport provider is used.
@@ -322,11 +286,11 @@ To start a call with:
-**phone_number_id:** `typing.Optional[str]` +**observability_plan:** `typing.Optional[LangfuseObservabilityPlan]` -This is the phone number that will be used for the call. To use a transient number, use `phoneNumber` instead. +This is the plan for observability of assistant's calls. -Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type. +Currently, only Langfuse is supported.
@@ -334,11 +298,7 @@ Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type.
-**phone_number:** `typing.Optional[ImportTwilioPhoneNumberDto]` - -This is the phone number that will be used for the call. To use an existing number, use `phoneNumberId` instead. - -Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type. +**credentials:** `typing.Optional[typing.Sequence[CreateAssistantDtoCredentialsItem]]` — These are dynamic credentials that will be used for the assistant calls. By default, all the credentials are available for use in the call but you can supplement an additional credentials using this. Dynamic credentials override existing credentials.
@@ -346,11 +306,7 @@ Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type.
-**customer_id:** `typing.Optional[str]` - -This is the customer that will be called. To call a transient customer , use `customer` instead. - -Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type. +**hooks:** `typing.Optional[typing.Sequence[CreateAssistantDtoHooksItem]]` — This is a set of actions that will be performed on certain events.
@@ -358,11 +314,11 @@ Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type.
-**customer:** `typing.Optional[CreateCustomerDto]` +**name:** `typing.Optional[str]` -This is the customer that will be called. To call an existing customer, use `customerId` instead. +This is the name of the assistant. -Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type. +This is required when you want to transfer between assistants in a call.
@@ -370,55 +326,31 @@ Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type.
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
- -
+**voicemail_message:** `typing.Optional[str]` +This is the message that the assistant will say if the call is forwarded to voicemail. +If unspecified, it will hang up. + -
- -
client.calls.get(...) -
-
- -#### 🔌 Usage - -
-
-```python -from vapi import Vapi +**end_call_message:** `typing.Optional[str]` -client = Vapi( - token="YOUR_TOKEN", -) -client.calls.get( - id="id", -) +This is the message that the assistant will say if it ends the call. -``` -
-
+If unspecified, it will hang up without saying anything. +
-#### ⚙️ Parameters - -
-
-
-**id:** `str` +**end_call_phrases:** `typing.Optional[typing.Sequence[str]]` — This list contains phrases that, if spoken by the assistant, will trigger the call to be hung up. Case insensitive.
@@ -426,55 +358,43 @@ client.calls.get(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**compliance_plan:** `typing.Optional[CompliancePlan]`
-
-
+
+
+**metadata:** `typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]` — This is for metadata you want to store on the assistant. +
-
-
client.calls.delete(...)
-#### 🔌 Usage - -
-
+**background_speech_denoising_plan:** `typing.Optional[BackgroundSpeechDenoisingPlan]` -
-
+This enables filtering of noise and background speech while the user is talking. -```python -from vapi import Vapi +Features: +- Smart denoising using Krisp +- Fourier denoising -client = Vapi( - token="YOUR_TOKEN", -) -client.calls.delete( - id="id", -) +Smart denoising can be combined with or used independently of Fourier denoising. -``` -
-
+Order of precedence: +- Smart denoising +- Fourier denoising +
-#### ⚙️ Parameters - -
-
-
-**id:** `str` +**analysis_plan:** `typing.Optional[AnalysisPlan]` — This is the plan for analysis of assistant's calls. Stored in `call.analysis`.
@@ -482,2048 +402,30 @@ client.calls.delete(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**artifact_plan:** `typing.Optional[ArtifactPlan]` — This is the plan for artifacts generated during assistant's calls. Stored in `call.artifact`.
-
-
+
+
+ +**start_speaking_plan:** `typing.Optional[StartSpeakingPlan]` + +This is the plan for when the assistant should start talking. +You should configure this if you're running into these issues: +- The assistant is too slow to start talking after the customer is done speaking. +- The assistant is too fast to start talking after the customer is done speaking. +- The assistant is so fast that it's actually interrupting the customer. +
-
-
client.calls.update(...)
-#### 🔌 Usage - -
-
- -
-
- -```python -from vapi import Vapi - -client = Vapi( - token="YOUR_TOKEN", -) -client.calls.update( - id="id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `str` - -
-
- -
-
- -**name:** `typing.Optional[str]` — This is the name of the call. This is just for your own reference. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Chats -
client.chats.list(...) -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vapi import Vapi - -client = Vapi( - token="YOUR_TOKEN", -) -client.chats.list() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**assistant_id:** `typing.Optional[str]` — This is the unique identifier for the assistant that will be used for the chat. - -
-
- -
-
- -**workflow_id:** `typing.Optional[str]` — This is the unique identifier for the workflow that will be used for the chat. - -
-
- -
-
- -**session_id:** `typing.Optional[str]` — This is the unique identifier for the session that will be used for the chat. - -
-
- -
-
- -**page:** `typing.Optional[float]` — This is the page number to return. Defaults to 1. - -
-
- -
-
- -**sort_order:** `typing.Optional[ChatsListRequestSortOrder]` — This is the sort order for pagination. Defaults to 'DESC'. - -
-
- -
-
- -**limit:** `typing.Optional[float]` — This is the maximum number of items to return. Defaults to 100. - -
-
- -
-
- -**created_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than the specified value. - -
-
- -
-
- -**created_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than the specified value. - -
-
- -
-
- -**created_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than or equal to the specified value. - -
-
- -
-
- -**created_at_le:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than or equal to the specified value. - -
-
- -
-
- -**updated_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than the specified value. - -
-
- -
-
- -**updated_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than the specified value. - -
-
- -
-
- -**updated_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than or equal to the specified value. - -
-
- -
-
- -**updated_at_le:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than or equal to the specified value. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.chats.create(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Creates a new chat. Requires at least one of: assistantId/assistant, sessionId, or previousChatId. Note: sessionId and previousChatId are mutually exclusive. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vapi import Vapi - -client = Vapi( - token="YOUR_TOKEN", -) -client.chats.create( - input="input", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**input:** `CreateChatDtoInput` - -This is the input text for the chat. -Can be a string or an array of chat messages. -This field is REQUIRED for chat creation. - -
-
- -
-
- -**assistant_id:** `typing.Optional[str]` — This is the assistant that will be used for the chat. To use an existing assistant, use `assistantId` instead. - -
-
- -
-
- -**assistant:** `typing.Optional[CreateAssistantDto]` — This is the assistant that will be used for the chat. To use an existing assistant, use `assistantId` instead. - -
-
- -
-
- -**assistant_overrides:** `typing.Optional[AssistantOverrides]` - -These are the variable values that will be used to replace template variables in the assistant messages. -Only variable substitution is supported in chat contexts - other assistant properties cannot be overridden. - -
-
- -
-
- -**name:** `typing.Optional[str]` — This is the name of the chat. This is just for your own reference. - -
-
- -
-
- -**session_id:** `typing.Optional[str]` - -This is the ID of the session that will be used for the chat. -Mutually exclusive with previousChatId. - -
-
- -
-
- -**stream:** `typing.Optional[bool]` - -This is a flag that determines whether the response should be streamed. -When true, the response will be sent as chunks of text. - -
-
- -
-
- -**previous_chat_id:** `typing.Optional[str]` - -This is the ID of the chat that will be used as context for the new chat. -The messages from the previous chat will be used as context. -Mutually exclusive with sessionId. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.chats.get(...) -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vapi import Vapi - -client = Vapi( - token="YOUR_TOKEN", -) -client.chats.get( - id="id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `str` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.chats.delete(...) -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vapi import Vapi - -client = Vapi( - token="YOUR_TOKEN", -) -client.chats.delete( - id="id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `str` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.chats.create_response(...) -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vapi import Vapi - -client = Vapi( - token="YOUR_TOKEN", -) -client.chats.create_response( - input="input", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**input:** `OpenAiResponsesRequestInput` - -This is the input text for the chat. -Can be a string or an array of chat messages. -This field is REQUIRED for chat creation. - -
-
- -
-
- -**assistant_id:** `typing.Optional[str]` — This is the assistant that will be used for the chat. To use an existing assistant, use `assistantId` instead. - -
-
- -
-
- -**assistant:** `typing.Optional[CreateAssistantDto]` — This is the assistant that will be used for the chat. To use an existing assistant, use `assistantId` instead. - -
-
- -
-
- -**assistant_overrides:** `typing.Optional[AssistantOverrides]` - -These are the variable values that will be used to replace template variables in the assistant messages. -Only variable substitution is supported in chat contexts - other assistant properties cannot be overridden. - -
-
- -
-
- -**name:** `typing.Optional[str]` — This is the name of the chat. This is just for your own reference. - -
-
- -
-
- -**session_id:** `typing.Optional[str]` - -This is the ID of the session that will be used for the chat. -Mutually exclusive with previousChatId. - -
-
- -
-
- -**stream:** `typing.Optional[bool]` — Whether to stream the response or not. - -
-
- -
-
- -**previous_chat_id:** `typing.Optional[str]` - -This is the ID of the chat that will be used as context for the new chat. -The messages from the previous chat will be used as context. -Mutually exclusive with sessionId. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Campaigns -
client.campaigns.campaign_controller_find_all(...) -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vapi import Vapi - -client = Vapi( - token="YOUR_TOKEN", -) -client.campaigns.campaign_controller_find_all() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `typing.Optional[str]` - -
-
- -
-
- -**status:** `typing.Optional[CampaignControllerFindAllRequestStatus]` - -
-
- -
-
- -**page:** `typing.Optional[float]` — This is the page number to return. Defaults to 1. - -
-
- -
-
- -**sort_order:** `typing.Optional[CampaignControllerFindAllRequestSortOrder]` — This is the sort order for pagination. Defaults to 'DESC'. - -
-
- -
-
- -**limit:** `typing.Optional[float]` — This is the maximum number of items to return. Defaults to 100. - -
-
- -
-
- -**created_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than the specified value. - -
-
- -
-
- -**created_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than the specified value. - -
-
- -
-
- -**created_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than or equal to the specified value. - -
-
- -
-
- -**created_at_le:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than or equal to the specified value. - -
-
- -
-
- -**updated_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than the specified value. - -
-
- -
-
- -**updated_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than the specified value. - -
-
- -
-
- -**updated_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than or equal to the specified value. - -
-
- -
-
- -**updated_at_le:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than or equal to the specified value. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.campaigns.campaign_controller_create(...) -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vapi import CreateCustomerDto, Vapi - -client = Vapi( - token="YOUR_TOKEN", -) -client.campaigns.campaign_controller_create( - name="Q2 Sales Campaign", - phone_number_id="phoneNumberId", - customers=[CreateCustomerDto()], -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**name:** `str` — This is the name of the campaign. This is just for your own reference. - -
-
- -
-
- -**phone_number_id:** `str` — This is the phone number ID that will be used for the campaign calls. - -
-
- -
-
- -**customers:** `typing.Sequence[CreateCustomerDto]` — These are the customers that will be called in the campaign. - -
-
- -
-
- -**assistant_id:** `typing.Optional[str]` — This is the assistant ID that will be used for the campaign calls. Note: Either assistantId or workflowId can be used, but not both. - -
-
- -
-
- -**workflow_id:** `typing.Optional[str]` — This is the workflow ID that will be used for the campaign calls. Note: Either assistantId or workflowId can be used, but not both. - -
-
- -
-
- -**schedule_plan:** `typing.Optional[SchedulePlan]` — This is the schedule plan for the campaign. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.campaigns.campaign_controller_find_one(...) -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vapi import Vapi - -client = Vapi( - token="YOUR_TOKEN", -) -client.campaigns.campaign_controller_find_one( - id="id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `str` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.campaigns.campaign_controller_remove(...) -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vapi import Vapi - -client = Vapi( - token="YOUR_TOKEN", -) -client.campaigns.campaign_controller_remove( - id="id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `str` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.campaigns.campaign_controller_update(...) -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vapi import Vapi - -client = Vapi( - token="YOUR_TOKEN", -) -client.campaigns.campaign_controller_update( - id="id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `str` - -
-
- -
-
- -**name:** `typing.Optional[str]` — This is the name of the campaign. This is just for your own reference. - -
-
- -
-
- -**assistant_id:** `typing.Optional[str]` - -This is the assistant ID that will be used for the campaign calls. -Can only be updated if campaign is not in progress or has ended. - -
-
- -
-
- -**workflow_id:** `typing.Optional[str]` - -This is the workflow ID that will be used for the campaign calls. -Can only be updated if campaign is not in progress or has ended. - -
-
- -
-
- -**phone_number_id:** `typing.Optional[str]` - -This is the phone number ID that will be used for the campaign calls. -Can only be updated if campaign is not in progress or has ended. - -
-
- -
-
- -**schedule_plan:** `typing.Optional[SchedulePlan]` - -This is the schedule plan for the campaign. -Can only be updated if campaign is not in progress or has ended. - -
-
- -
-
- -**status:** `typing.Optional[typing.Literal["ended"]]` - -This is the status of the campaign. -Can only be updated to 'ended' if you want to end the campaign. -When set to 'ended', it will delete all scheduled calls. Calls in progress will be allowed to complete. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Sessions -
client.sessions.list(...) -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vapi import Vapi - -client = Vapi( - token="YOUR_TOKEN", -) -client.sessions.list() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**name:** `typing.Optional[str]` — This is the name of the session to filter by. - -
-
- -
-
- -**assistant_id:** `typing.Optional[str]` — This is the ID of the assistant to filter sessions by. - -
-
- -
-
- -**workflow_id:** `typing.Optional[str]` — This is the ID of the workflow to filter sessions by. - -
-
- -
-
- -**page:** `typing.Optional[float]` — This is the page number to return. Defaults to 1. - -
-
- -
-
- -**sort_order:** `typing.Optional[SessionsListRequestSortOrder]` — This is the sort order for pagination. Defaults to 'DESC'. - -
-
- -
-
- -**limit:** `typing.Optional[float]` — This is the maximum number of items to return. Defaults to 100. - -
-
- -
-
- -**created_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than the specified value. - -
-
- -
-
- -**created_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than the specified value. - -
-
- -
-
- -**created_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than or equal to the specified value. - -
-
- -
-
- -**created_at_le:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than or equal to the specified value. - -
-
- -
-
- -**updated_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than the specified value. - -
-
- -
-
- -**updated_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than the specified value. - -
-
- -
-
- -**updated_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than or equal to the specified value. - -
-
- -
-
- -**updated_at_le:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than or equal to the specified value. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.sessions.create(...) -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vapi import Vapi - -client = Vapi( - token="YOUR_TOKEN", -) -client.sessions.create() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**name:** `typing.Optional[str]` — This is a user-defined name for the session. Maximum length is 40 characters. - -
-
- -
-
- -**status:** `typing.Optional[CreateSessionDtoStatus]` — This is the current status of the session. Can be either 'active' or 'completed'. - -
-
- -
-
- -**expiration_seconds:** `typing.Optional[float]` — Session expiration time in seconds. Defaults to 24 hours (86400 seconds) if not set. - -
-
- -
-
- -**assistant_id:** `typing.Optional[str]` — This is the ID of the assistant associated with this session. Use this when referencing an existing assistant. - -
-
- -
-
- -**assistant:** `typing.Optional[CreateAssistantDto]` - -This is the assistant configuration for this session. Use this when creating a new assistant configuration. -If assistantId is provided, this will be ignored. - -
-
- -
-
- -**messages:** `typing.Optional[typing.Sequence[CreateSessionDtoMessagesItem]]` — This is an array of chat messages in the session. - -
-
- -
-
- -**customer:** `typing.Optional[CreateCustomerDto]` — This is the customer information associated with this session. - -
-
- -
-
- -**phone_number_id:** `typing.Optional[str]` — This is the ID of the phone number associated with this session. - -
-
- -
-
- -**phone_number:** `typing.Optional[ImportTwilioPhoneNumberDto]` — This is the phone number configuration for this session. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.sessions.get(...) -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vapi import Vapi - -client = Vapi( - token="YOUR_TOKEN", -) -client.sessions.get( - id="id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `str` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.sessions.delete(...) -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vapi import Vapi - -client = Vapi( - token="YOUR_TOKEN", -) -client.sessions.delete( - id="id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `str` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.sessions.update(...) -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vapi import Vapi - -client = Vapi( - token="YOUR_TOKEN", -) -client.sessions.update( - id="id", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `str` - -
-
- -
-
- -**name:** `typing.Optional[str]` — This is the new name for the session. Maximum length is 40 characters. - -
-
- -
-
- -**status:** `typing.Optional[UpdateSessionDtoStatus]` — This is the new status for the session. - -
-
- -
-
- -**expiration_seconds:** `typing.Optional[float]` — Session expiration time in seconds. Defaults to 24 hours (86400 seconds) if not set. - -
-
- -
-
- -**messages:** `typing.Optional[typing.Sequence[UpdateSessionDtoMessagesItem]]` — This is the updated array of chat messages. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Assistants -
client.assistants.list(...) -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vapi import Vapi - -client = Vapi( - token="YOUR_TOKEN", -) -client.assistants.list() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**limit:** `typing.Optional[float]` — This is the maximum number of items to return. Defaults to 100. - -
-
- -
-
- -**created_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than the specified value. - -
-
- -
-
- -**created_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than the specified value. - -
-
- -
-
- -**created_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than or equal to the specified value. - -
-
- -
-
- -**created_at_le:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than or equal to the specified value. - -
-
- -
-
- -**updated_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than the specified value. - -
-
- -
-
- -**updated_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than the specified value. - -
-
- -
-
- -**updated_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than or equal to the specified value. - -
-
- -
-
- -**updated_at_le:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than or equal to the specified value. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.assistants.create(...) -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vapi import Vapi - -client = Vapi( - token="YOUR_TOKEN", -) -client.assistants.create() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**transcriber:** `typing.Optional[CreateAssistantDtoTranscriber]` — These are the options for the assistant's transcriber. - -
-
- -
-
- -**model:** `typing.Optional[CreateAssistantDtoModel]` — These are the options for the assistant's LLM. - -
-
- -
-
- -**voice:** `typing.Optional[CreateAssistantDtoVoice]` — These are the options for the assistant's voice. - -
-
- -
-
- -**first_message:** `typing.Optional[str]` - -This is the first message that the assistant will say. This can also be a URL to a containerized audio file (mp3, wav, etc.). - -If unspecified, assistant will wait for user to speak and use the model to respond once they speak. - -
-
- -
-
- -**first_message_interruptions_enabled:** `typing.Optional[bool]` - -
-
- -
-
- -**first_message_mode:** `typing.Optional[CreateAssistantDtoFirstMessageMode]` - -This is the mode for the first message. Default is 'assistant-speaks-first'. - -Use: -- 'assistant-speaks-first' to have the assistant speak first. -- 'assistant-waits-for-user' to have the assistant wait for the user to speak first. -- 'assistant-speaks-first-with-model-generated-message' to have the assistant speak first with a message generated by the model based on the conversation state. (`assistant.model.messages` at call start, `call.messages` at squad transfer points). - -@default 'assistant-speaks-first' - -
-
- -
-
- -**voicemail_detection:** `typing.Optional[CreateAssistantDtoVoicemailDetection]` - -These are the settings to configure or disable voicemail detection. Alternatively, voicemail detection can be configured using the model.tools=[VoicemailTool]. -This uses Twilio's built-in detection while the VoicemailTool relies on the model to detect if a voicemail was reached. -You can use neither of them, one of them, or both of them. By default, Twilio built-in detection is enabled while VoicemailTool is not. - -
-
- -
-
- -**client_messages:** `typing.Optional[typing.Sequence[CreateAssistantDtoClientMessagesItem]]` — These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transfer-update,transcript,tool-calls,user-interrupted,voice-input,workflow.node.started. You can check the shape of the messages in ClientMessage schema. - -
-
- -
-
- -**server_messages:** `typing.Optional[typing.Sequence[CreateAssistantDtoServerMessagesItem]]` — These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema. - -
-
- -
-
- -**silence_timeout_seconds:** `typing.Optional[float]` - -How many seconds of silence to wait before ending the call. Defaults to 30. - -@default 30 - -
-
- -
-
- -**max_duration_seconds:** `typing.Optional[float]` - -This is the maximum number of seconds that the call will last. When the call reaches this duration, it will be ended. - -@default 600 (10 minutes) - -
-
- -
-
- -**background_sound:** `typing.Optional[CreateAssistantDtoBackgroundSound]` - -This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'. -You can also provide a custom sound by providing a URL to an audio file. - -
-
- -
-
- -**background_denoising_enabled:** `typing.Optional[bool]` - -This enables filtering of noise and background speech while the user is talking. - -Default `false` while in beta. - -@default false - -
-
- -
-
- -**model_output_in_messages_enabled:** `typing.Optional[bool]` - -This determines whether the model's output is used in conversation history rather than the transcription of assistant's speech. - -Default `false` while in beta. - -@default false - -
-
- -
-
- -**transport_configurations:** `typing.Optional[typing.Sequence[TransportConfigurationTwilio]]` — These are the configurations to be passed to the transport providers of assistant's calls, like Twilio. You can store multiple configurations for different transport providers. For a call, only the configuration matching the call transport provider is used. - -
-
- -
-
- -**observability_plan:** `typing.Optional[LangfuseObservabilityPlan]` - -This is the plan for observability of assistant's calls. - -Currently, only Langfuse is supported. - -
-
- -
-
- -**credentials:** `typing.Optional[typing.Sequence[CreateAssistantDtoCredentialsItem]]` — These are dynamic credentials that will be used for the assistant calls. By default, all the credentials are available for use in the call but you can supplement an additional credentials using this. Dynamic credentials override existing credentials. - -
-
- -
-
- -**hooks:** `typing.Optional[typing.Sequence[CreateAssistantDtoHooksItem]]` — This is a set of actions that will be performed on certain events. - -
-
- -
-
- -**name:** `typing.Optional[str]` - -This is the name of the assistant. - -This is required when you want to transfer between assistants in a call. - -
-
- -
-
- -**voicemail_message:** `typing.Optional[str]` - -This is the message that the assistant will say if the call is forwarded to voicemail. - -If unspecified, it will hang up. - -
-
- -
-
- -**end_call_message:** `typing.Optional[str]` - -This is the message that the assistant will say if it ends the call. - -If unspecified, it will hang up without saying anything. - -
-
- -
-
- -**end_call_phrases:** `typing.Optional[typing.Sequence[str]]` — This list contains phrases that, if spoken by the assistant, will trigger the call to be hung up. Case insensitive. - -
-
- -
-
- -**compliance_plan:** `typing.Optional[CompliancePlan]` - -
-
- -
-
- -**metadata:** `typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]` — This is for metadata you want to store on the assistant. - -
-
- -
-
- -**background_speech_denoising_plan:** `typing.Optional[BackgroundSpeechDenoisingPlan]` - -This enables filtering of noise and background speech while the user is talking. - -Features: -- Smart denoising using Krisp -- Fourier denoising - -Smart denoising can be combined with or used independently of Fourier denoising. - -Order of precedence: -- Smart denoising -- Fourier denoising - -
-
- -
-
- -**analysis_plan:** `typing.Optional[AnalysisPlan]` — This is the plan for analysis of assistant's calls. Stored in `call.analysis`. - -
-
- -
-
- -**artifact_plan:** `typing.Optional[ArtifactPlan]` — This is the plan for artifacts generated during assistant's calls. Stored in `call.artifact`. - -
-
- -
-
- -**message_plan:** `typing.Optional[MessagePlan]` - -This is the plan for static predefined messages that can be spoken by the assistant during the call, like `idleMessages`. - -Note: `firstMessage`, `voicemailMessage`, and `endCallMessage` are currently at the root level. They will be moved to `messagePlan` in the future, but will remain backwards compatible. - -
-
- -
-
- -**start_speaking_plan:** `typing.Optional[StartSpeakingPlan]` - -This is the plan for when the assistant should start talking. - -You should configure this if you're running into these issues: -- The assistant is too slow to start talking after the customer is done speaking. -- The assistant is too fast to start talking after the customer is done speaking. -- The assistant is so fast that it's actually interrupting the customer. - -
-
- -
-
- -**stop_speaking_plan:** `typing.Optional[StopSpeakingPlan]` +**stop_speaking_plan:** `typing.Optional[StopSpeakingPlan]` This is the plan for when assistant should stop talking on customer interruption. @@ -2835,19 +737,7 @@ You can use neither of them, one of them, or both of them. By default, Twilio bu
-**server_messages:** `typing.Optional[typing.Sequence[UpdateAssistantDtoServerMessagesItem]]` — These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema. - -
-
- -
-
- -**silence_timeout_seconds:** `typing.Optional[float]` - -How many seconds of silence to wait before ending the call. Defaults to 30. - -@default 30 +**server_messages:** `typing.Optional[typing.Sequence[UpdateAssistantDtoServerMessagesItem]]` — These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,handoff-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema.
@@ -2878,20 +768,6 @@ You can also provide a custom sound by providing a URL to an audio file.
-**background_denoising_enabled:** `typing.Optional[bool]` - -This enables filtering of noise and background speech while the user is talking. - -Default `false` while in beta. - -@default false - -
-
- -
-
- **model_output_in_messages_enabled:** `typing.Optional[bool]` This determines whether the model's output is used in conversation history rather than the transcription of assistant's speech. @@ -3038,18 +914,6 @@ Order of precedence:
-**message_plan:** `typing.Optional[MessagePlan]` - -This is the plan for static predefined messages that can be spoken by the assistant during the call, like `idleMessages`. - -Note: `firstMessage`, `voicemailMessage`, and `endCallMessage` are currently at the root level. They will be moved to `messagePlan` in the future, but will remain backwards compatible. - -
-
- -
-
- **start_speaking_plan:** `typing.Optional[StartSpeakingPlan]` This is the plan for when the assistant should start talking. @@ -3140,8 +1004,8 @@ The order of precedence is:
-## PhoneNumbers -
client.phone_numbers.list(...) +## Squads +
client.squads.list(...)
@@ -3159,7 +1023,7 @@ from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) -client.phone_numbers.list() +client.squads.list() ```
@@ -3259,7 +1123,7 @@ client.phone_numbers.list()
-
client.phone_numbers.create(...) +
client.squads.create(...)
@@ -3272,15 +1136,13 @@ client.phone_numbers.list()
```python -from vapi import CreateByoPhoneNumberDto, Vapi +from vapi import SquadMemberDto, Vapi client = Vapi( token="YOUR_TOKEN", ) -client.phone_numbers.create( - request=CreateByoPhoneNumberDto( - credential_id="credentialId", - ), +client.squads.create( + members=[SquadMemberDto()], ) ``` @@ -3297,7 +1159,31 @@ client.phone_numbers.create(
-**request:** `PhoneNumbersCreateRequest` +**members:** `typing.Sequence[SquadMemberDto]` + +This is the list of assistants that make up the squad. + +The call will start with the first assistant in the list. + +
+
+ +
+
+ +**name:** `typing.Optional[str]` — This is the name of the squad. + +
+
+ +
+
+ +**members_overrides:** `typing.Optional[AssistantOverrides]` + +This can be used to override all the assistants' settings and provide values for their template variables. + +Both `membersOverrides` and `members[n].assistantOverrides` can be used together. First, `members[n].assistantOverrides` is applied. Then, `membersOverrides` is applied as a global override.
@@ -3317,7 +1203,7 @@ client.phone_numbers.create(
-
client.phone_numbers.get(...) +
client.squads.get(...)
@@ -3335,7 +1221,7 @@ from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) -client.phone_numbers.get( +client.squads.get( id="id", ) @@ -3373,7 +1259,7 @@ client.phone_numbers.get(
-
client.phone_numbers.delete(...) +
client.squads.delete(...)
@@ -3391,7 +1277,7 @@ from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) -client.phone_numbers.delete( +client.squads.delete( id="id", ) @@ -3429,7 +1315,7 @@ client.phone_numbers.delete(
-
client.phone_numbers.update(...) +
client.squads.update(...)
@@ -3442,14 +1328,14 @@ client.phone_numbers.delete(
```python -from vapi import UpdateByoPhoneNumberDto, Vapi +from vapi import SquadMemberDto, Vapi client = Vapi( token="YOUR_TOKEN", ) -client.phone_numbers.update( +client.squads.update( id="id", - request=UpdateByoPhoneNumberDto(), + members=[SquadMemberDto()], ) ``` @@ -3474,7 +1360,31 @@ client.phone_numbers.update(
-**request:** `PhoneNumbersUpdateRequest` +**members:** `typing.Sequence[SquadMemberDto]` + +This is the list of assistants that make up the squad. + +The call will start with the first assistant in the list. + +
+
+ +
+
+ +**name:** `typing.Optional[str]` — This is the name of the squad. + +
+
+ +
+
+ +**members_overrides:** `typing.Optional[AssistantOverrides]` + +This can be used to override all the assistants' settings and provide values for their template variables. + +Both `membersOverrides` and `members[n].assistantOverrides` can be used together. First, `members[n].assistantOverrides` is applied. Then, `membersOverrides` is applied as a global override.
@@ -3494,8 +1404,8 @@ client.phone_numbers.update(
-## Tools -
client.tools.list(...) +## Calls +
client.calls.list(...)
@@ -3513,7 +1423,7 @@ from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) -client.tools.list() +client.calls.list() ```
@@ -3529,7 +1439,7 @@ client.tools.list()
-**limit:** `typing.Optional[float]` — This is the maximum number of items to return. Defaults to 100. +**id:** `typing.Optional[str]` — This is the unique identifier for the call.
@@ -3537,7 +1447,7 @@ client.tools.list()
-**created_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than the specified value. +**assistant_id:** `typing.Optional[str]` — This will return calls with the specified assistantId.
@@ -3545,7 +1455,11 @@ client.tools.list()
-**created_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than the specified value. +**phone_number_id:** `typing.Optional[str]` + +This is the phone number that will be used for the call. To use a transient number, use `phoneNumber` instead. + +Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type.
@@ -3553,7 +1467,7 @@ client.tools.list()
-**created_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than or equal to the specified value. +**limit:** `typing.Optional[float]` — This is the maximum number of items to return. Defaults to 100.
@@ -3561,7 +1475,7 @@ client.tools.list()
-**created_at_le:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than or equal to the specified value. +**created_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than the specified value.
@@ -3569,7 +1483,7 @@ client.tools.list()
-**updated_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than the specified value. +**created_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than the specified value.
@@ -3577,7 +1491,7 @@ client.tools.list()
-**updated_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than the specified value. +**created_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than or equal to the specified value.
@@ -3585,7 +1499,7 @@ client.tools.list()
-**updated_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than or equal to the specified value. +**created_at_le:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than or equal to the specified value.
@@ -3593,7 +1507,7 @@ client.tools.list()
-**updated_at_le:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than or equal to the specified value. +**updated_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than the specified value.
@@ -3601,58 +1515,23 @@ client.tools.list()
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**updated_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than the specified value.
- -
- - - - -
- -
client.tools.create(...) -
-
- -#### 🔌 Usage - -
-
-```python -from vapi import CreateApiRequestToolDto, Vapi - -client = Vapi( - token="YOUR_TOKEN", -) -client.tools.create( - request=CreateApiRequestToolDto( - method="POST", - url="url", - ), -) - -``` -
-
+**updated_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than or equal to the specified value. +
-#### ⚙️ Parameters - -
-
-
-**request:** `ToolsCreateRequest` +**updated_at_le:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than or equal to the specified value.
@@ -3672,7 +1551,7 @@ client.tools.create(
-
client.tools.get(...) +
client.calls.create(...)
@@ -3690,9 +1569,7 @@ from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) -client.tools.get( - id="id", -) +client.calls.create() ```
@@ -3708,7 +1585,11 @@ client.tools.get(
-**id:** `str` +**customers:** `typing.Optional[typing.Sequence[CreateCustomerDto]]` + +This is used to issue batch calls to multiple customers. + +Only relevant for `outboundPhoneCall`. To call a single customer, use `customer` instead.
@@ -3716,55 +1597,76 @@ client.tools.get(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**name:** `typing.Optional[str]` — This is the name of the call. This is just for your own reference.
- -
+
+
+**schedule_plan:** `typing.Optional[SchedulePlan]` — This is the schedule plan of the call. +
-
-
client.tools.delete(...)
-#### 🔌 Usage +**transport:** `typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]` — This is the transport of the call. + +
+
+**assistant_id:** `typing.Optional[str]` + +This is the assistant ID that will be used for the call. To use a transient assistant, use `assistant` instead. + +To start a call with: +- Assistant, use `assistantId` or `assistant` +- Squad, use `squadId` or `squad` +- Workflow, use `workflowId` or `workflow` + +
+
+
-```python -from vapi import Vapi +**assistant:** `typing.Optional[CreateAssistantDto]` -client = Vapi( - token="YOUR_TOKEN", -) -client.tools.delete( - id="id", -) +This is the assistant that will be used for the call. To use an existing assistant, use `assistantId` instead. -``` -
-
+To start a call with: +- Assistant, use `assistant` +- Squad, use `squad` +- Workflow, use `workflow` + -#### ⚙️ Parameters -
+**assistant_overrides:** `typing.Optional[AssistantOverrides]` — These are the overrides for the `assistant` or `assistantId`'s settings and template variables. + +
+
+
-**id:** `str` +**squad_id:** `typing.Optional[str]` + +This is the squad that will be used for the call. To use a transient squad, use `squad` instead. + +To start a call with: +- Assistant, use `assistant` or `assistantId` +- Squad, use `squad` or `squadId` +- Workflow, use `workflow` or `workflowId`
@@ -3772,56 +1674,88 @@ client.tools.delete(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**squad:** `typing.Optional[CreateSquadDto]` + +This is a squad that will be used for the call. To use an existing squad, use `squadId` instead. + +To start a call with: +- Assistant, use `assistant` or `assistantId` +- Squad, use `squad` or `squadId` +- Workflow, use `workflow` or `workflowId`
- - +
+
+ +**workflow_id:** `typing.Optional[str]` + +This is the workflow that will be used for the call. To use a transient workflow, use `workflow` instead. +To start a call with: +- Assistant, use `assistant` or `assistantId` +- Squad, use `squad` or `squadId` +- Workflow, use `workflow` or `workflowId` +
-
-
client.tools.update(...)
-#### 🔌 Usage +**workflow:** `typing.Optional[CreateWorkflowDto]` + +This is a workflow that will be used for the call. To use an existing workflow, use `workflowId` instead. + +To start a call with: +- Assistant, use `assistant` or `assistantId` +- Squad, use `squad` or `squadId` +- Workflow, use `workflow` or `workflowId` + +
+
+**workflow_overrides:** `typing.Optional[WorkflowOverrides]` — These are the overrides for the `workflow` or `workflowId`'s settings and template variables. + +
+
+
-```python -from vapi import UpdateApiRequestToolDto, Vapi +**phone_number_id:** `typing.Optional[str]` -client = Vapi( - token="YOUR_TOKEN", -) -client.tools.update( - id="id", - request=UpdateApiRequestToolDto(), -) +This is the phone number that will be used for the call. To use a transient number, use `phoneNumber` instead. -``` -
-
+Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type. + -#### ⚙️ Parameters -
+**phone_number:** `typing.Optional[ImportTwilioPhoneNumberDto]` + +This is the phone number that will be used for the call. To use an existing number, use `phoneNumberId` instead. + +Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type. + +
+
+
-**id:** `str` +**customer_id:** `typing.Optional[str]` + +This is the customer that will be called. To call a transient customer , use `customer` instead. + +Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type.
@@ -3829,7 +1763,11 @@ client.tools.update(
-**request:** `ToolsUpdateRequest` +**customer:** `typing.Optional[CreateCustomerDto]` + +This is the customer that will be called. To call an existing customer, use `customerId` instead. + +Only relevant for `outboundPhoneCall` and `inboundPhoneCall` type.
@@ -3849,8 +1787,7 @@ client.tools.update(
-## Files -
client.files.list() +
client.calls.get(...)
@@ -3868,7 +1805,9 @@ from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) -client.files.list() +client.calls.get( + id="id", +) ```
@@ -3884,6 +1823,14 @@ client.files.list()
+**id:** `str` + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -3896,7 +1843,7 @@ client.files.list()
-
client.files.create(...) +
client.calls.delete(...)
@@ -3914,7 +1861,9 @@ from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) -client.files.create() +client.calls.delete( + id="id", +) ```
@@ -3930,9 +1879,7 @@ client.files.create()
-**file:** `from __future__ import annotations - -core.File` — See core.File for more documentation +**id:** `str`
@@ -3952,7 +1899,7 @@ core.File` — See core.File for more documentation
-
client.files.get(...) +
client.calls.update(...)
@@ -3970,7 +1917,7 @@ from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) -client.files.get( +client.calls.update( id="id", ) @@ -3996,6 +1943,14 @@ client.files.get(
+**name:** `typing.Optional[str]` — This is the name of the call. This is just for your own reference. + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -4008,7 +1963,8 @@ client.files.get(
-
client.files.delete(...) +## Chats +
client.chats.list(...)
@@ -4026,9 +1982,7 @@ from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) -client.files.delete( - id="id", -) +client.chats.list() ```
@@ -4044,7 +1998,7 @@ client.files.delete(
-**id:** `str` +**assistant_id:** `typing.Optional[str]` — This is the unique identifier for the assistant that will be used for the chat.
@@ -4052,55 +2006,95 @@ client.files.delete(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**workflow_id:** `typing.Optional[str]` — This is the unique identifier for the workflow that will be used for the chat. + +
+
+ +
+
+ +**session_id:** `typing.Optional[str]` — This is the unique identifier for the session that will be used for the chat.
+ +
+
+ +**page:** `typing.Optional[float]` — This is the page number to return. Defaults to 1. +
+
+
+**sort_order:** `typing.Optional[ChatsListRequestSortOrder]` — This is the sort order for pagination. Defaults to 'DESC'. +
-
-
client.files.update(...)
-#### 🔌 Usage +**limit:** `typing.Optional[float]` — This is the maximum number of items to return. Defaults to 100. + +
+
+**created_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than the specified value. + +
+
+
-```python -from vapi import Vapi +**created_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than the specified value. + +
+
-client = Vapi( - token="YOUR_TOKEN", -) -client.files.update( - id="id", -) +
+
-``` +**created_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than or equal to the specified value. + +
+
+ +
+
+ +**created_at_le:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than or equal to the specified value. +
+ +
+
+ +**updated_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than the specified value. +
-#### ⚙️ Parameters -
+**updated_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than the specified value. + +
+
+
-**id:** `str` +**updated_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than or equal to the specified value.
@@ -4108,7 +2102,7 @@ client.files.update(
-**name:** `typing.Optional[str]` — This is the name of the file. This is just for your own reference. +**updated_at_le:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than or equal to the specified value.
@@ -4128,11 +2122,24 @@ client.files.update(
-## KnowledgeBases -
client.knowledge_bases.list(...) +
client.chats.create(...) +
+
+ +#### 📝 Description + +
+
+
+Creates a new chat. Requires at least one of: assistantId/assistant, sessionId, or previousChatId. Note: sessionId and previousChatId are mutually exclusive. +
+
+
+
+ #### 🔌 Usage
@@ -4147,7 +2154,9 @@ from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) -client.knowledge_bases.list() +client.chats.create( + input="input", +) ```
@@ -4163,15 +2172,11 @@ client.knowledge_bases.list()
-**limit:** `typing.Optional[float]` — This is the maximum number of items to return. Defaults to 100. - -
-
- -
-
+**input:** `CreateChatDtoInput` -**created_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than the specified value. +This is the input text for the chat. +Can be a string or an array of chat messages. +This field is REQUIRED for chat creation.
@@ -4179,7 +2184,7 @@ client.knowledge_bases.list()
-**created_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than the specified value. +**assistant_id:** `typing.Optional[str]` — This is the assistant that will be used for the chat. To use an existing assistant, use `assistantId` instead.
@@ -4187,7 +2192,7 @@ client.knowledge_bases.list()
-**created_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than or equal to the specified value. +**assistant:** `typing.Optional[CreateAssistantDto]` — This is the assistant that will be used for the chat. To use an existing assistant, use `assistantId` instead.
@@ -4195,7 +2200,10 @@ client.knowledge_bases.list()
-**created_at_le:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than or equal to the specified value. +**assistant_overrides:** `typing.Optional[AssistantOverrides]` + +These are the variable values that will be used to replace template variables in the assistant messages. +Only variable substitution is supported in chat contexts - other assistant properties cannot be overridden.
@@ -4203,7 +2211,7 @@ client.knowledge_bases.list()
-**updated_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than the specified value. +**name:** `typing.Optional[str]` — This is the name of the chat. This is just for your own reference.
@@ -4211,7 +2219,10 @@ client.knowledge_bases.list()
-**updated_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than the specified value. +**session_id:** `typing.Optional[str]` + +This is the ID of the session that will be used for the chat. +Mutually exclusive with previousChatId.
@@ -4219,7 +2230,10 @@ client.knowledge_bases.list()
-**updated_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than or equal to the specified value. +**stream:** `typing.Optional[bool]` + +This is a flag that determines whether the response should be streamed. +When true, the response will be sent as chunks of text.
@@ -4227,7 +2241,11 @@ client.knowledge_bases.list()
-**updated_at_le:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than or equal to the specified value. +**previous_chat_id:** `typing.Optional[str]` + +This is the ID of the chat that will be used as context for the new chat. +The messages from the previous chat will be used as context. +Mutually exclusive with sessionId.
@@ -4247,7 +2265,7 @@ client.knowledge_bases.list()
-
client.knowledge_bases.create(...) +
client.chats.get(...)
@@ -4260,13 +2278,13 @@ client.knowledge_bases.list()
```python -from vapi import CreateTrieveKnowledgeBaseDto, Vapi +from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) -client.knowledge_bases.create( - request=CreateTrieveKnowledgeBaseDto(), +client.chats.get( + id="id", ) ``` @@ -4283,7 +2301,7 @@ client.knowledge_bases.create(
-**request:** `KnowledgeBasesCreateRequest` +**id:** `str`
@@ -4303,7 +2321,7 @@ client.knowledge_bases.create(
-
client.knowledge_bases.get(...) +
client.chats.delete(...)
@@ -4321,7 +2339,7 @@ from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) -client.knowledge_bases.get( +client.chats.delete( id="id", ) @@ -4359,7 +2377,7 @@ client.knowledge_bases.get(
-
client.knowledge_bases.delete(...) +
client.chats.create_response(...)
@@ -4377,8 +2395,8 @@ from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) -client.knowledge_bases.delete( - id="id", +client.chats.create_response( + input="input", ) ``` @@ -4395,7 +2413,11 @@ client.knowledge_bases.delete(
-**id:** `str` +**input:** `OpenAiResponsesRequestInput` + +This is the input text for the chat. +Can be a string or an array of chat messages. +This field is REQUIRED for chat creation.
@@ -4403,56 +2425,53 @@ client.knowledge_bases.delete(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**assistant_id:** `typing.Optional[str]` — This is the assistant that will be used for the chat. To use an existing assistant, use `assistantId` instead.
-
-
+
+
+**assistant:** `typing.Optional[CreateAssistantDto]` — This is the assistant that will be used for the chat. To use an existing assistant, use `assistantId` instead. +
-
-
client.knowledge_bases.update(...)
-#### 🔌 Usage +**assistant_overrides:** `typing.Optional[AssistantOverrides]` -
-
+These are the variable values that will be used to replace template variables in the assistant messages. +Only variable substitution is supported in chat contexts - other assistant properties cannot be overridden. + +
+
-```python -from vapi import UpdateTrieveKnowledgeBaseDto, Vapi - -client = Vapi( - token="YOUR_TOKEN", -) -client.knowledge_bases.update( - id="id", - request=UpdateTrieveKnowledgeBaseDto(), -) - -``` -
-
+**name:** `typing.Optional[str]` — This is the name of the chat. This is just for your own reference. +
-#### ⚙️ Parameters -
+**session_id:** `typing.Optional[str]` + +This is the ID of the session that will be used for the chat. +Mutually exclusive with previousChatId. + +
+
+
-**id:** `str` +**stream:** `typing.Optional[bool]` — Whether to stream the response or not.
@@ -4460,7 +2479,11 @@ client.knowledge_bases.update(
-**request:** `KnowledgeBasesUpdateRequest` +**previous_chat_id:** `typing.Optional[str]` + +This is the ID of the chat that will be used as context for the new chat. +The messages from the previous chat will be used as context. +Mutually exclusive with sessionId.
@@ -4480,8 +2503,8 @@ client.knowledge_bases.update(
-## Workflow -
client.workflow.workflow_controller_find_all() +## Campaigns +
client.campaigns.campaign_controller_find_all(...)
@@ -4499,7 +2522,7 @@ from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) -client.workflow.workflow_controller_find_all() +client.campaigns.campaign_controller_find_all() ```
@@ -4515,66 +2538,55 @@ client.workflow.workflow_controller_find_all()
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**id:** `typing.Optional[str]`
- -
+
+
+**status:** `typing.Optional[CampaignControllerFindAllRequestStatus]` +
-
-
client.workflow.workflow_controller_create(...)
-#### 🔌 Usage +**page:** `typing.Optional[float]` — This is the page number to return. Defaults to 1. + +
+
+**sort_order:** `typing.Optional[CampaignControllerFindAllRequestSortOrder]` — This is the sort order for pagination. Defaults to 'DESC'. + +
+
+
-```python -from vapi import ConversationNode, Edge, Vapi - -client = Vapi( - token="YOUR_TOKEN", -) -client.workflow.workflow_controller_create( - nodes=[ - ConversationNode( - name="name", - ) - ], - name="name", - edges=[ - Edge( - from_="from", - to="to", - ) - ], -) - -``` -
-
+**limit:** `typing.Optional[float]` — This is the maximum number of items to return. Defaults to 100. + -#### ⚙️ Parameters -
+**created_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than the specified value. + +
+
+
-**nodes:** `typing.Sequence[CreateWorkflowDtoNodesItem]` +**created_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than the specified value.
@@ -4582,7 +2594,7 @@ client.workflow.workflow_controller_create(
-**name:** `str` +**created_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than or equal to the specified value.
@@ -4590,7 +2602,7 @@ client.workflow.workflow_controller_create(
-**edges:** `typing.Sequence[Edge]` +**created_at_le:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than or equal to the specified value.
@@ -4598,11 +2610,7 @@ client.workflow.workflow_controller_create(
-**transcriber:** `typing.Optional[CreateWorkflowDtoTranscriber]` - -This is the transcriber for the workflow. - -This can be overridden at node level using `nodes[n].transcriber`. +**updated_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than the specified value.
@@ -4610,11 +2618,7 @@ This can be overridden at node level using `nodes[n].transcriber`.
-**voice:** `typing.Optional[CreateWorkflowDtoVoice]` - -This is the voice for the workflow. - -This can be overridden at node level using `nodes[n].voice`. +**updated_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than the specified value.
@@ -4622,11 +2626,7 @@ This can be overridden at node level using `nodes[n].voice`.
-**observability_plan:** `typing.Optional[LangfuseObservabilityPlan]` - -This is the plan for observability of workflow's calls. - -Currently, only Langfuse is supported. +**updated_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than or equal to the specified value.
@@ -4634,10 +2634,7 @@ Currently, only Langfuse is supported.
-**background_sound:** `typing.Optional[CreateWorkflowDtoBackgroundSound]` - -This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'. -You can also provide a custom sound by providing a URL to an audio file. +**updated_at_le:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than or equal to the specified value.
@@ -4645,32 +2642,65 @@ You can also provide a custom sound by providing a URL to an audio file.
-**credentials:** `typing.Optional[typing.Sequence[CreateWorkflowDtoCredentialsItem]]` — These are dynamic credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can supplement an additional credentials using this. Dynamic credentials override existing credentials. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ + + + + + +
+
client.campaigns.campaign_controller_create(...)
-**global_prompt:** `typing.Optional[str]` - +#### 🔌 Usage + +
+
+ +
+
+ +```python +from vapi import CreateCustomerDto, Vapi + +client = Vapi( + token="YOUR_TOKEN", +) +client.campaigns.campaign_controller_create( + name="Q2 Sales Campaign", + phone_number_id="phoneNumberId", + customers=[CreateCustomerDto()], +) + +``` +
+
+#### ⚙️ Parameters +
-**server:** `typing.Optional[Server]` +
+
-This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema. +**name:** `str` — This is the name of the campaign. This is just for your own reference. + +
+
-The order of precedence is: +
+
-1. tool.server -2. workflow.server / assistant.server -3. phoneNumber.server -4. org.server +**phone_number_id:** `str` — This is the phone number ID that will be used for the campaign calls.
@@ -4678,7 +2708,7 @@ The order of precedence is:
-**compliance_plan:** `typing.Optional[CompliancePlan]` — This is the compliance plan for the workflow. It allows you to configure HIPAA and other compliance settings. +**customers:** `typing.Sequence[CreateCustomerDto]` — These are the customers that will be called in the campaign.
@@ -4686,7 +2716,7 @@ The order of precedence is:
-**analysis_plan:** `typing.Optional[AnalysisPlan]` — This is the plan for analysis of workflow's calls. Stored in `call.analysis`. +**assistant_id:** `typing.Optional[str]` — This is the assistant ID that will be used for the campaign calls. Note: Either assistantId or workflowId can be used, but not both.
@@ -4694,7 +2724,7 @@ The order of precedence is:
-**artifact_plan:** `typing.Optional[ArtifactPlan]` — This is the plan for artifacts generated during workflow's calls. Stored in `call.artifact`. +**workflow_id:** `typing.Optional[str]` — This is the workflow ID that will be used for the campaign calls. Note: Either assistantId or workflowId can be used, but not both.
@@ -4702,14 +2732,7 @@ The order of precedence is:
-**start_speaking_plan:** `typing.Optional[StartSpeakingPlan]` - -This is the plan for when the workflow nodes should start talking. - -You should configure this if you're running into these issues: -- The assistant is too slow to start talking after the customer is done speaking. -- The assistant is too fast to start talking after the customer is done speaking. -- The assistant is so fast that it's actually interrupting the customer. +**schedule_plan:** `typing.Optional[SchedulePlan]` — This is the schedule plan for the campaign.
@@ -4717,56 +2740,55 @@ You should configure this if you're running into these issues:
-**stop_speaking_plan:** `typing.Optional[StopSpeakingPlan]` +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
-This is the plan for when workflow nodes should stop talking on customer interruption. -You should configure this if you're running into these issues: -- The assistant is too slow to recognize customer's interruption. -- The assistant is too fast to recognize customer's interruption. -- The assistant is getting interrupted by phrases that are just acknowledgments. -- The assistant is getting interrupted by background noises. -- The assistant is not properly stopping -- it starts talking right after getting interrupted. -
+
+
client.campaigns.campaign_controller_find_one(...)
-**monitor_plan:** `typing.Optional[MonitorPlan]` - -This is the plan for real-time monitoring of the workflow's calls. - -Usage: -- To enable live listening of the workflow's calls, set `monitorPlan.listenEnabled` to `true`. -- To enable live control of the workflow's calls, set `monitorPlan.controlEnabled` to `true`. - -
-
+#### 🔌 Usage
-**background_speech_denoising_plan:** `typing.Optional[BackgroundSpeechDenoisingPlan]` +
+
-This enables filtering of noise and background speech while the user is talking. +```python +from vapi import Vapi -Features: -- Smart denoising using Krisp -- Fourier denoising +client = Vapi( + token="YOUR_TOKEN", +) +client.campaigns.campaign_controller_find_one( + id="id", +) -Both can be used together. Order of precedence: -- Smart denoising -- Fourier denoising - +``` +
+
+#### ⚙️ Parameters + +
+
+
-**credential_ids:** `typing.Optional[typing.Sequence[str]]` — These are the credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can provide a subset using this. +**id:** `str`
@@ -4786,7 +2808,7 @@ Both can be used together. Order of precedence:
-
client.workflow.workflow_controller_find_one(...) +
client.campaigns.campaign_controller_remove(...)
@@ -4804,7 +2826,7 @@ from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) -client.workflow.workflow_controller_find_one( +client.campaigns.campaign_controller_remove( id="id", ) @@ -4842,7 +2864,7 @@ client.workflow.workflow_controller_find_one(
-
client.workflow.workflow_controller_delete(...) +
client.campaigns.campaign_controller_update(...)
@@ -4860,7 +2882,7 @@ from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) -client.workflow.workflow_controller_delete( +client.campaigns.campaign_controller_update( id="id", ) @@ -4886,6 +2908,70 @@ client.workflow.workflow_controller_delete(
+**name:** `typing.Optional[str]` — This is the name of the campaign. This is just for your own reference. + +
+
+ +
+
+ +**assistant_id:** `typing.Optional[str]` + +This is the assistant ID that will be used for the campaign calls. +Can only be updated if campaign is not in progress or has ended. + +
+
+ +
+
+ +**workflow_id:** `typing.Optional[str]` + +This is the workflow ID that will be used for the campaign calls. +Can only be updated if campaign is not in progress or has ended. + +
+
+ +
+
+ +**phone_number_id:** `typing.Optional[str]` + +This is the phone number ID that will be used for the campaign calls. +Can only be updated if campaign is not in progress or has ended. + +
+
+ +
+
+ +**schedule_plan:** `typing.Optional[SchedulePlan]` + +This is the schedule plan for the campaign. +Can only be updated if campaign is not in progress or has ended. + +
+
+ +
+
+ +**status:** `typing.Optional[typing.Literal["ended"]]` + +This is the status of the campaign. +Can only be updated to 'ended' if you want to end the campaign. +When set to 'ended', it will delete all scheduled calls. Calls in progress will be allowed to complete. + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -4898,7 +2984,8 @@ client.workflow.workflow_controller_delete(
-
client.workflow.workflow_controller_update(...) +## Sessions +
client.sessions.list(...)
@@ -4916,9 +3003,7 @@ from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) -client.workflow.workflow_controller_update( - id="id", -) +client.sessions.list() ```
@@ -4934,7 +3019,7 @@ client.workflow.workflow_controller_update(
-**id:** `str` +**name:** `typing.Optional[str]` — This is the name of the session to filter by.
@@ -4942,7 +3027,7 @@ client.workflow.workflow_controller_update(
-**nodes:** `typing.Optional[typing.Sequence[UpdateWorkflowDtoNodesItem]]` +**assistant_id:** `typing.Optional[str]` — This is the ID of the assistant to filter sessions by.
@@ -4950,11 +3035,15 @@ client.workflow.workflow_controller_update(
-**transcriber:** `typing.Optional[UpdateWorkflowDtoTranscriber]` +**workflow_id:** `typing.Optional[str]` — This is the ID of the workflow to filter sessions by. + +
+
-This is the transcriber for the workflow. +
+
-This can be overridden at node level using `nodes[n].transcriber`. +**page:** `typing.Optional[float]` — This is the page number to return. Defaults to 1.
@@ -4962,11 +3051,15 @@ This can be overridden at node level using `nodes[n].transcriber`.
-**voice:** `typing.Optional[UpdateWorkflowDtoVoice]` +**sort_order:** `typing.Optional[SessionsListRequestSortOrder]` — This is the sort order for pagination. Defaults to 'DESC'. + +
+
-This is the voice for the workflow. +
+
-This can be overridden at node level using `nodes[n].voice`. +**limit:** `typing.Optional[float]` — This is the maximum number of items to return. Defaults to 100.
@@ -4974,11 +3067,15 @@ This can be overridden at node level using `nodes[n].voice`.
-**observability_plan:** `typing.Optional[LangfuseObservabilityPlan]` +**created_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than the specified value. + +
+
-This is the plan for observability of workflow's calls. +
+
-Currently, only Langfuse is supported. +**created_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than the specified value.
@@ -4986,10 +3083,7 @@ Currently, only Langfuse is supported.
-**background_sound:** `typing.Optional[UpdateWorkflowDtoBackgroundSound]` - -This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'. -You can also provide a custom sound by providing a URL to an audio file. +**created_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than or equal to the specified value.
@@ -4997,7 +3091,7 @@ You can also provide a custom sound by providing a URL to an audio file.
-**credentials:** `typing.Optional[typing.Sequence[UpdateWorkflowDtoCredentialsItem]]` — These are dynamic credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can supplement an additional credentials using this. Dynamic credentials override existing credentials. +**created_at_le:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than or equal to the specified value.
@@ -5005,7 +3099,7 @@ You can also provide a custom sound by providing a URL to an audio file.
-**name:** `typing.Optional[str]` +**updated_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than the specified value.
@@ -5013,7 +3107,7 @@ You can also provide a custom sound by providing a URL to an audio file.
-**edges:** `typing.Optional[typing.Sequence[Edge]]` +**updated_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than the specified value.
@@ -5021,7 +3115,7 @@ You can also provide a custom sound by providing a URL to an audio file.
-**global_prompt:** `typing.Optional[str]` +**updated_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than or equal to the specified value.
@@ -5029,32 +3123,61 @@ You can also provide a custom sound by providing a URL to an audio file.
-**server:** `typing.Optional[Server]` - -This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema. +**updated_at_le:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than or equal to the specified value. + +
+
-The order of precedence is: +
+
-1. tool.server -2. workflow.server / assistant.server -3. phoneNumber.server -4. org.server +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
+ + + + +
+
client.sessions.create(...)
-**compliance_plan:** `typing.Optional[CompliancePlan]` — This is the compliance plan for the workflow. It allows you to configure HIPAA and other compliance settings. - +#### 🔌 Usage + +
+
+ +
+
+ +```python +from vapi import Vapi + +client = Vapi( + token="YOUR_TOKEN", +) +client.sessions.create() + +```
+
+
+ +#### ⚙️ Parameters
-**analysis_plan:** `typing.Optional[AnalysisPlan]` — This is the plan for analysis of workflow's calls. Stored in `call.analysis`. +
+
+ +**name:** `typing.Optional[str]` — This is a user-defined name for the session. Maximum length is 40 characters.
@@ -5062,7 +3185,7 @@ The order of precedence is:
-**artifact_plan:** `typing.Optional[ArtifactPlan]` — This is the plan for artifacts generated during workflow's calls. Stored in `call.artifact`. +**status:** `typing.Optional[CreateSessionDtoStatus]` — This is the current status of the session. Can be either 'active' or 'completed'.
@@ -5070,14 +3193,15 @@ The order of precedence is:
-**start_speaking_plan:** `typing.Optional[StartSpeakingPlan]` +**expiration_seconds:** `typing.Optional[float]` — Session expiration time in seconds. Defaults to 24 hours (86400 seconds) if not set. + +
+
-This is the plan for when the workflow nodes should start talking. +
+
-You should configure this if you're running into these issues: -- The assistant is too slow to start talking after the customer is done speaking. -- The assistant is too fast to start talking after the customer is done speaking. -- The assistant is so fast that it's actually interrupting the customer. +**assistant_id:** `typing.Optional[str]` — This is the ID of the assistant associated with this session. Use this when referencing an existing assistant.
@@ -5085,16 +3209,10 @@ You should configure this if you're running into these issues:
-**stop_speaking_plan:** `typing.Optional[StopSpeakingPlan]` - -This is the plan for when workflow nodes should stop talking on customer interruption. +**assistant:** `typing.Optional[CreateAssistantDto]` -You should configure this if you're running into these issues: -- The assistant is too slow to recognize customer's interruption. -- The assistant is too fast to recognize customer's interruption. -- The assistant is getting interrupted by phrases that are just acknowledgments. -- The assistant is getting interrupted by background noises. -- The assistant is not properly stopping -- it starts talking right after getting interrupted. +This is the assistant configuration for this session. Use this when creating a new assistant configuration. +If assistantId is provided, this will be ignored.
@@ -5102,13 +3220,7 @@ You should configure this if you're running into these issues:
-**monitor_plan:** `typing.Optional[MonitorPlan]` - -This is the plan for real-time monitoring of the workflow's calls. - -Usage: -- To enable live listening of the workflow's calls, set `monitorPlan.listenEnabled` to `true`. -- To enable live control of the workflow's calls, set `monitorPlan.controlEnabled` to `true`. +**messages:** `typing.Optional[typing.Sequence[CreateSessionDtoMessagesItem]]` — This is an array of chat messages in the session.
@@ -5116,17 +3228,15 @@ Usage:
-**background_speech_denoising_plan:** `typing.Optional[BackgroundSpeechDenoisingPlan]` - -This enables filtering of noise and background speech while the user is talking. +**customer:** `typing.Optional[CreateCustomerDto]` — This is the customer information associated with this session. + +
+
-Features: -- Smart denoising using Krisp -- Fourier denoising +
+
-Both can be used together. Order of precedence: -- Smart denoising -- Fourier denoising +**phone_number_id:** `typing.Optional[str]` — This is the ID of the phone number associated with this session.
@@ -5134,7 +3244,7 @@ Both can be used together. Order of precedence:
-**credential_ids:** `typing.Optional[typing.Sequence[str]]` — These are the credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can provide a subset using this. +**phone_number:** `typing.Optional[ImportTwilioPhoneNumberDto]` — This is the phone number configuration for this session.
@@ -5154,8 +3264,7 @@ Both can be used together. Order of precedence:
-## Squads -
client.squads.list(...) +
client.sessions.get(...)
@@ -5173,7 +3282,9 @@ from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) -client.squads.list() +client.sessions.get( + id="id", +) ```
@@ -5189,7 +3300,7 @@ client.squads.list()
-**limit:** `typing.Optional[float]` — This is the maximum number of items to return. Defaults to 100. +**id:** `str`
@@ -5197,63 +3308,55 @@ client.squads.list()
-**created_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than the specified value. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
- -
-
- -**created_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than the specified value. -
-
-
-**created_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than or equal to the specified value. -
+
+
client.sessions.delete(...)
-**created_at_le:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than or equal to the specified value. - -
-
+#### 🔌 Usage
-**updated_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than the specified value. - -
-
-
-**updated_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than the specified value. - +```python +from vapi import Vapi + +client = Vapi( + token="YOUR_TOKEN", +) +client.sessions.delete( + id="id", +) + +``` +
+
+#### ⚙️ Parameters +
-**updated_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than or equal to the specified value. - -
-
-
-**updated_at_le:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than or equal to the specified value. +**id:** `str`
@@ -5273,7 +3376,7 @@ client.squads.list()
-
client.squads.create(...) +
client.sessions.update(...)
@@ -5286,13 +3389,13 @@ client.squads.list()
```python -from vapi import SquadMemberDto, Vapi +from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) -client.squads.create( - members=[SquadMemberDto()], +client.sessions.update( + id="id", ) ``` @@ -5309,11 +3412,15 @@ client.squads.create(
-**members:** `typing.Sequence[SquadMemberDto]` +**id:** `str` + +
+
-This is the list of assistants that make up the squad. +
+
-The call will start with the first assistant in the list. +**name:** `typing.Optional[str]` — This is the new name for the session. Maximum length is 40 characters.
@@ -5321,7 +3428,7 @@ The call will start with the first assistant in the list.
-**name:** `typing.Optional[str]` — This is the name of the squad. +**status:** `typing.Optional[UpdateSessionDtoStatus]` — This is the new status for the session.
@@ -5329,11 +3436,15 @@ The call will start with the first assistant in the list.
-**members_overrides:** `typing.Optional[AssistantOverrides]` +**expiration_seconds:** `typing.Optional[float]` — Session expiration time in seconds. Defaults to 24 hours (86400 seconds) if not set. + +
+
-This can be used to override all the assistants' settings and provide values for their template variables. +
+
-Both `membersOverrides` and `members[n].assistantOverrides` can be used together. First, `members[n].assistantOverrides` is applied. Then, `membersOverrides` is applied as a global override. +**messages:** `typing.Optional[typing.Sequence[UpdateSessionDtoMessagesItem]]` — This is the updated array of chat messages.
@@ -5353,7 +3464,8 @@ Both `membersOverrides` and `members[n].assistantOverrides` can be used together
-
client.squads.get(...) +## PhoneNumbers +
client.phone_numbers.list(...)
@@ -5371,9 +3483,7 @@ from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) -client.squads.get( - id="id", -) +client.phone_numbers.list() ```
@@ -5389,7 +3499,7 @@ client.squads.get(
-**id:** `str` +**limit:** `typing.Optional[float]` — This is the maximum number of items to return. Defaults to 100.
@@ -5397,55 +3507,63 @@ client.squads.get(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**created_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than the specified value.
- -
+
+
+**created_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than the specified value. +
-
-
client.squads.delete(...)
-#### 🔌 Usage +**created_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than or equal to the specified value. + +
+
+**created_at_le:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than or equal to the specified value. + +
+
+
-```python -from vapi import Vapi - -client = Vapi( - token="YOUR_TOKEN", -) -client.squads.delete( - id="id", -) - -``` +**updated_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than the specified value. +
+ +
+
+ +**updated_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than the specified value. +
-#### ⚙️ Parameters -
+**updated_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than or equal to the specified value. + +
+
+
-**id:** `str` +**updated_at_le:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than or equal to the specified value.
@@ -5465,7 +3583,7 @@ client.squads.delete(
-
client.squads.update(...) +
client.phone_numbers.create(...)
@@ -5478,14 +3596,15 @@ client.squads.delete(
```python -from vapi import SquadMemberDto, Vapi +from vapi import CreateByoPhoneNumberDto, Vapi client = Vapi( token="YOUR_TOKEN", ) -client.squads.update( - id="id", - members=[SquadMemberDto()], +client.phone_numbers.create( + request=CreateByoPhoneNumberDto( + credential_id="credentialId", + ), ) ``` @@ -5502,7 +3621,7 @@ client.squads.update(
-**id:** `str` +**request:** `PhoneNumbersCreateRequest`
@@ -5510,31 +3629,55 @@ client.squads.update(
-**members:** `typing.Sequence[SquadMemberDto]` +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
-This is the list of assistants that make up the squad. -The call will start with the first assistant in the list. - +
+
client.phone_numbers.get(...)
-**name:** `typing.Optional[str]` — This is the name of the squad. - +#### 🔌 Usage + +
+
+ +
+
+ +```python +from vapi import Vapi + +client = Vapi( + token="YOUR_TOKEN", +) +client.phone_numbers.get( + id="id", +) + +``` +
+
+#### ⚙️ Parameters +
-**members_overrides:** `typing.Optional[AssistantOverrides]` - -This can be used to override all the assistants' settings and provide values for their template variables. +
+
-Both `membersOverrides` and `members[n].assistantOverrides` can be used together. First, `members[n].assistantOverrides` is applied. Then, `membersOverrides` is applied as a global override. +**id:** `str`
@@ -5554,8 +3697,7 @@ Both `membersOverrides` and `members[n].assistantOverrides` can be used together
-## TestSuites -
client.test_suites.test_suite_controller_find_all_paginated(...) +
client.phone_numbers.delete(...)
@@ -5573,7 +3715,9 @@ from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) -client.test_suites.test_suite_controller_find_all_paginated() +client.phone_numbers.delete( + id="id", +) ```
@@ -5589,7 +3733,7 @@ client.test_suites.test_suite_controller_find_all_paginated()
-**page:** `typing.Optional[float]` — This is the page number to return. Defaults to 1. +**id:** `str`
@@ -5597,71 +3741,56 @@ client.test_suites.test_suite_controller_find_all_paginated()
-**sort_order:** `typing.Optional[TestSuiteControllerFindAllPaginatedRequestSortOrder]` — This is the sort order for pagination. Defaults to 'DESC'. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
- -
-
- -**limit:** `typing.Optional[float]` — This is the maximum number of items to return. Defaults to 100. -
-
-
-**created_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than the specified value. -
+
+
client.phone_numbers.update(...)
-**created_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than the specified value. - -
-
+#### 🔌 Usage
-**created_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than or equal to the specified value. - -
-
-
-**created_at_le:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than or equal to the specified value. - -
-
+```python +from vapi import UpdateByoPhoneNumberDto, Vapi -
-
+client = Vapi( + token="YOUR_TOKEN", +) +client.phone_numbers.update( + id="id", + request=UpdateByoPhoneNumberDto(), +) -**updated_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than the specified value. - +```
- -
-
- -**updated_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than the specified value. -
+#### ⚙️ Parameters +
-**updated_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than or equal to the specified value. +
+
+ +**id:** `str`
@@ -5669,7 +3798,7 @@ client.test_suites.test_suite_controller_find_all_paginated()
-**updated_at_le:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than or equal to the specified value. +**request:** `PhoneNumbersUpdateRequest`
@@ -5689,7 +3818,8 @@ client.test_suites.test_suite_controller_find_all_paginated()
-
client.test_suites.test_suite_controller_create(...) +## Tools +
client.tools.list(...)
@@ -5707,7 +3837,7 @@ from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) -client.test_suites.test_suite_controller_create() +client.tools.list() ```
@@ -5723,7 +3853,39 @@ client.test_suites.test_suite_controller_create()
-**name:** `typing.Optional[str]` — This is the name of the test suite. +**limit:** `typing.Optional[float]` — This is the maximum number of items to return. Defaults to 100. + +
+
+ +
+
+ +**created_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than the specified value. + +
+
+ +
+
+ +**created_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than the specified value. + +
+
+ +
+
+ +**created_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than or equal to the specified value. + +
+
+ +
+
+ +**created_at_le:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than or equal to the specified value.
@@ -5731,7 +3893,7 @@ client.test_suites.test_suite_controller_create()
-**phone_number_id:** `typing.Optional[str]` — This is the phone number ID associated with this test suite. +**updated_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than the specified value.
@@ -5739,11 +3901,15 @@ client.test_suites.test_suite_controller_create()
-**tester_plan:** `typing.Optional[TesterPlan]` +**updated_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than the specified value. + +
+
-Override the default tester plan by providing custom assistant configuration for the test agent. +
+
-We recommend only using this if you are confident, as we have already set sensible defaults on the tester plan. +**updated_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than or equal to the specified value.
@@ -5751,7 +3917,7 @@ We recommend only using this if you are confident, as we have already set sensib
-**target_plan:** `typing.Optional[TargetPlan]` — These are the configuration for the assistant / phone number that is being tested. +**updated_at_le:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than or equal to the specified value.
@@ -5771,7 +3937,7 @@ We recommend only using this if you are confident, as we have already set sensib
-
client.test_suites.test_suite_controller_find_one(...) +
client.tools.create(...)
@@ -5784,13 +3950,16 @@ We recommend only using this if you are confident, as we have already set sensib
```python -from vapi import Vapi +from vapi import CreateApiRequestToolDto, Vapi client = Vapi( token="YOUR_TOKEN", ) -client.test_suites.test_suite_controller_find_one( - id="id", +client.tools.create( + request=CreateApiRequestToolDto( + method="POST", + url="url", + ), ) ``` @@ -5807,7 +3976,7 @@ client.test_suites.test_suite_controller_find_one(
-**id:** `str` +**request:** `ToolsCreateRequest`
@@ -5827,7 +3996,7 @@ client.test_suites.test_suite_controller_find_one(
-
client.test_suites.test_suite_controller_remove(...) +
client.tools.get(...)
@@ -5845,7 +4014,7 @@ from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) -client.test_suites.test_suite_controller_remove( +client.tools.get( id="id", ) @@ -5883,7 +4052,7 @@ client.test_suites.test_suite_controller_remove(
-
client.test_suites.test_suite_controller_update(...) +
client.tools.delete(...)
@@ -5901,7 +4070,7 @@ from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) -client.test_suites.test_suite_controller_update( +client.tools.delete( id="id", ) @@ -5927,42 +4096,6 @@ client.test_suites.test_suite_controller_update(
-**name:** `typing.Optional[str]` — This is the name of the test suite. - -
-
- -
-
- -**phone_number_id:** `typing.Optional[str]` — This is the phone number ID associated with this test suite. - -
-
- -
-
- -**tester_plan:** `typing.Optional[TesterPlan]` - -Override the default tester plan by providing custom assistant configuration for the test agent. - -We recommend only using this if you are confident, as we have already set sensible defaults on the tester plan. - -
-
- -
-
- -**target_plan:** `typing.Optional[TargetPlan]` — These are the configuration for the assistant / phone number that is being tested. - -
-
- -
-
- **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -5975,8 +4108,7 @@ We recommend only using this if you are confident, as we have already set sensib
-## TestSuiteTests -
client.test_suite_tests.test_suite_test_controller_find_all_paginated(...) +
client.tools.update(...)
@@ -5989,13 +4121,14 @@ We recommend only using this if you are confident, as we have already set sensib
```python -from vapi import Vapi +from vapi import UpdateApiRequestToolDto, Vapi client = Vapi( token="YOUR_TOKEN", ) -client.test_suite_tests.test_suite_test_controller_find_all_paginated( - test_suite_id="testSuiteId", +client.tools.update( + id="id", + request=UpdateApiRequestToolDto(), ) ``` @@ -6012,7 +4145,7 @@ client.test_suite_tests.test_suite_test_controller_find_all_paginated(
-**test_suite_id:** `str` +**id:** `str`
@@ -6020,7 +4153,7 @@ client.test_suite_tests.test_suite_test_controller_find_all_paginated(
-**page:** `typing.Optional[float]` — This is the page number to return. Defaults to 1. +**request:** `ToolsUpdateRequest`
@@ -6028,83 +4161,50 @@ client.test_suite_tests.test_suite_test_controller_find_all_paginated(
-**sort_order:** `typing.Optional[TestSuiteTestControllerFindAllPaginatedRequestSortOrder]` — This is the sort order for pagination. Defaults to 'DESC'. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
- -
-
- -**limit:** `typing.Optional[float]` — This is the maximum number of items to return. Defaults to 100. -
-
-
-**created_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than the specified value. -
+
+## Files +
client.files.list()
-**created_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than the specified value. - -
-
+#### 🔌 Usage
-**created_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than or equal to the specified value. - -
-
-
-**created_at_le:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than or equal to the specified value. - -
-
+```python +from vapi import Vapi -
-
+client = Vapi( + token="YOUR_TOKEN", +) +client.files.list() -**updated_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than the specified value. - +```
- -
-
- -**updated_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than the specified value. -
-
-
- -**updated_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than or equal to the specified value. - -
-
+#### ⚙️ Parameters
-**updated_at_le:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than or equal to the specified value. - -
-
-
@@ -6120,7 +4220,7 @@ client.test_suite_tests.test_suite_test_controller_find_all_paginated(
-
client.test_suite_tests.test_suite_test_controller_create(...) +
client.files.create(...)
@@ -6133,22 +4233,12 @@ client.test_suite_tests.test_suite_test_controller_find_all_paginated(
```python -from vapi import CreateTestSuiteTestVoiceDto, TestSuiteTestScorerAi, Vapi +from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) -client.test_suite_tests.test_suite_test_controller_create( - test_suite_id="testSuiteId", - request=CreateTestSuiteTestVoiceDto( - scorers=[ - TestSuiteTestScorerAi( - rubric="rubric", - ) - ], - script="script", - ), -) +client.files.create() ```
@@ -6164,15 +4254,9 @@ client.test_suite_tests.test_suite_test_controller_create(
-**test_suite_id:** `str` - -
-
- -
-
+**file:** `from __future__ import annotations -**request:** `TestSuiteTestControllerCreateRequest` +core.File` — See core.File for more documentation
@@ -6192,7 +4276,7 @@ client.test_suite_tests.test_suite_test_controller_create(
-
client.test_suite_tests.test_suite_test_controller_find_one(...) +
client.files.get(...)
@@ -6210,8 +4294,7 @@ from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) -client.test_suite_tests.test_suite_test_controller_find_one( - test_suite_id="testSuiteId", +client.files.get( id="id", ) @@ -6229,14 +4312,6 @@ client.test_suite_tests.test_suite_test_controller_find_one(
-**test_suite_id:** `str` - -
-
- -
-
- **id:** `str`
@@ -6257,7 +4332,7 @@ client.test_suite_tests.test_suite_test_controller_find_one(
-
client.test_suite_tests.test_suite_test_controller_remove(...) +
client.files.delete(...)
@@ -6275,8 +4350,7 @@ from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) -client.test_suite_tests.test_suite_test_controller_remove( - test_suite_id="testSuiteId", +client.files.delete( id="id", ) @@ -6294,14 +4368,6 @@ client.test_suite_tests.test_suite_test_controller_remove(
-**test_suite_id:** `str` - -
-
- -
-
- **id:** `str`
@@ -6322,7 +4388,7 @@ client.test_suite_tests.test_suite_test_controller_remove(
-
client.test_suite_tests.test_suite_test_controller_update(...) +
client.files.update(...)
@@ -6335,15 +4401,13 @@ client.test_suite_tests.test_suite_test_controller_remove(
```python -from vapi import UpdateTestSuiteTestVoiceDto, Vapi +from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) -client.test_suite_tests.test_suite_test_controller_update( - test_suite_id="testSuiteId", +client.files.update( id="id", - request=UpdateTestSuiteTestVoiceDto(), ) ``` @@ -6360,14 +4424,6 @@ client.test_suite_tests.test_suite_test_controller_update(
-**test_suite_id:** `str` - -
-
- -
-
- **id:** `str`
@@ -6376,7 +4432,7 @@ client.test_suite_tests.test_suite_test_controller_update(
-**request:** `TestSuiteTestControllerUpdateRequest` +**name:** `typing.Optional[str]` — This is the name of the file. This is just for your own reference.
@@ -6396,8 +4452,8 @@ client.test_suite_tests.test_suite_test_controller_update(
-## TestSuiteRuns -
client.test_suite_runs.test_suite_run_controller_find_all_paginated(...) +## StructuredOutputs +
client.structured_outputs.structured_output_controller_find_all(...)
@@ -6415,9 +4471,7 @@ from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) -client.test_suite_runs.test_suite_run_controller_find_all_paginated( - test_suite_id="testSuiteId", -) +client.structured_outputs.structured_output_controller_find_all() ```
@@ -6433,7 +4487,15 @@ client.test_suite_runs.test_suite_run_controller_find_all_paginated(
-**test_suite_id:** `str` +**id:** `typing.Optional[str]` — This will return structured outputs where the id matches the specified value. + +
+
+ +
+
+ +**name:** `typing.Optional[str]` — This will return structured outputs where the name matches the specified value.
@@ -6449,7 +4511,7 @@ client.test_suite_runs.test_suite_run_controller_find_all_paginated(
-**sort_order:** `typing.Optional[TestSuiteRunControllerFindAllPaginatedRequestSortOrder]` — This is the sort order for pagination. Defaults to 'DESC'. +**sort_order:** `typing.Optional[StructuredOutputControllerFindAllRequestSortOrder]` — This is the sort order for pagination. Defaults to 'DESC'.
@@ -6541,7 +4603,7 @@ client.test_suite_runs.test_suite_run_controller_find_all_paginated(
-
client.test_suite_runs.test_suite_run_controller_create(...) +
client.structured_outputs.structured_output_controller_create(...)
@@ -6554,13 +4616,16 @@ client.test_suite_runs.test_suite_run_controller_find_all_paginated(
```python -from vapi import Vapi +from vapi import JsonSchema, Vapi client = Vapi( token="YOUR_TOKEN", ) -client.test_suite_runs.test_suite_run_controller_create( - test_suite_id="testSuiteId", +client.structured_outputs.structured_output_controller_create( + name="name", + schema=JsonSchema( + type="string", + ), ) ``` @@ -6569,15 +4634,79 @@ client.test_suite_runs.test_suite_run_controller_create(
-#### ⚙️ Parameters - +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `str` — This is the name of the structured output. + +
+
+ +
+
+ +**schema:** `JsonSchema` + +This is the JSON Schema definition for the structured output. + +This is required when creating a structured output. Defines the structure and validation rules for the data that will be extracted. Supports all JSON Schema features including: +- Objects and nested properties +- Arrays and array validation +- String, number, boolean, and null types +- Enums and const values +- Validation constraints (min/max, patterns, etc.) +- Composition with allOf, anyOf, oneOf + +
+
+ +
+
+ +**model:** `typing.Optional[CreateStructuredOutputDtoModel]` + +This is the model that will be used to extract the structured output. + +To provide your own custom system and user prompts for structured output extraction, populate the messages array with your system and user messages. You can specify liquid templating in your system and user messages. +Between the system or user messages, you must reference either 'transcript' or 'messages' with the '{{}}' syntax to access the conversation history. +Between the system or user messages, you must reference a variation of the structured output with the '{{}}' syntax to access the structured output definition. +i.e.: +{{structuredOutput}} +{{structuredOutput.name}} +{{structuredOutput.description}} +{{structuredOutput.schema}} + +If model is not specified, GPT-4.1 will be used by default for extraction, utilizing default system and user prompts. +If messages or required fields are not specified, the default system and user prompts will be used. + +
+
+ +
+
+ +**description:** `typing.Optional[str]` + +This is the description of what the structured output extracts. + +Use this to provide context about what data will be extracted and how it will be used. + +
+
+
-
-
+**assistant_ids:** `typing.Optional[typing.Sequence[str]]` -**test_suite_id:** `str` +These are the assistant IDs that this structured output is linked to. + +When linked to assistants, this structured output will be available for extraction during those assistant's calls.
@@ -6585,7 +4714,11 @@ client.test_suite_runs.test_suite_run_controller_create(
-**name:** `typing.Optional[str]` — This is the name of the test suite run. +**workflow_ids:** `typing.Optional[typing.Sequence[str]]` + +These are the workflow IDs that this structured output is linked to. + +When linked to workflows, this structured output will be available for extraction during those workflow's execution.
@@ -6605,7 +4738,7 @@ client.test_suite_runs.test_suite_run_controller_create(
-
client.test_suite_runs.test_suite_run_controller_find_one(...) +
client.structured_outputs.structured_output_controller_find_one(...)
@@ -6623,8 +4756,7 @@ from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) -client.test_suite_runs.test_suite_run_controller_find_one( - test_suite_id="testSuiteId", +client.structured_outputs.structured_output_controller_find_one( id="id", ) @@ -6642,14 +4774,6 @@ client.test_suite_runs.test_suite_run_controller_find_one(
-**test_suite_id:** `str` - -
-
- -
-
- **id:** `str`
@@ -6670,7 +4794,7 @@ client.test_suite_runs.test_suite_run_controller_find_one(
-
client.test_suite_runs.test_suite_run_controller_remove(...) +
client.structured_outputs.structured_output_controller_remove(...)
@@ -6688,8 +4812,7 @@ from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) -client.test_suite_runs.test_suite_run_controller_remove( - test_suite_id="testSuiteId", +client.structured_outputs.structured_output_controller_remove( id="id", ) @@ -6707,14 +4830,6 @@ client.test_suite_runs.test_suite_run_controller_remove(
-**test_suite_id:** `str` - -
-
- -
-
- **id:** `str`
@@ -6735,7 +4850,7 @@ client.test_suite_runs.test_suite_run_controller_remove(
-
client.test_suite_runs.test_suite_run_controller_update(...) +
client.structured_outputs.structured_output_controller_update(...)
@@ -6753,9 +4868,9 @@ from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) -client.test_suite_runs.test_suite_run_controller_update( - test_suite_id="testSuiteId", +client.structured_outputs.structured_output_controller_update( id="id", + schema_override="schemaOverride", ) ``` @@ -6772,7 +4887,7 @@ client.test_suite_runs.test_suite_run_controller_update(
-**test_suite_id:** `str` +**id:** `str`
@@ -6780,7 +4895,7 @@ client.test_suite_runs.test_suite_run_controller_update(
-**id:** `str` +**schema_override:** `str`
@@ -6788,7 +4903,21 @@ client.test_suite_runs.test_suite_run_controller_update(
-**name:** `typing.Optional[str]` — This is the name of the test suite run. +**model:** `typing.Optional[UpdateStructuredOutputDtoModel]` + +This is the model that will be used to extract the structured output. + +To provide your own custom system and user prompts for structured output extraction, populate the messages array with your system and user messages. You can specify liquid templating in your system and user messages. +Between the system or user messages, you must reference either 'transcript' or 'messages' with the '{{}}' syntax to access the conversation history. +Between the system or user messages, you must reference a variation of the structured output with the '{{}}' syntax to access the structured output definition. +i.e.: +{{structuredOutput}} +{{structuredOutput.name}} +{{structuredOutput.description}} +{{structuredOutput.schema}} + +If model is not specified, GPT-4.1 will be used by default for extraction, utilizing default system and user prompts. +If messages or required fields are not specified, the default system and user prompts will be used.
@@ -6796,67 +4925,61 @@ client.test_suite_runs.test_suite_run_controller_update(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**name:** `typing.Optional[str]` — This is the name of the structured output.
-
-
+
+
+ +**description:** `typing.Optional[str]` +This is the description of what the structured output extracts. + +Use this to provide context about what data will be extracted and how it will be used. +
-
-## Analytics -
client.analytics.get(...)
-#### 🔌 Usage +**assistant_ids:** `typing.Optional[typing.Sequence[str]]` -
-
+These are the assistant IDs that this structured output is linked to. + +When linked to assistants, this structured output will be available for extraction during those assistant's calls. + +
+
-```python -from vapi import AnalyticsOperation, AnalyticsQuery, Vapi +**workflow_ids:** `typing.Optional[typing.Sequence[str]]` -client = Vapi( - token="YOUR_TOKEN", -) -client.analytics.get( - queries=[ - AnalyticsQuery( - table="call", - name="name", - operations=[ - AnalyticsOperation( - operation="sum", - column="id", - ) - ], - ) - ], -) +These are the workflow IDs that this structured output is linked to. -``` -
-
+When linked to workflows, this structured output will be available for extraction during those workflow's execution. +
-#### ⚙️ Parameters -
-
-
+**schema:** `typing.Optional[JsonSchema]` -**queries:** `typing.Sequence[AnalyticsQuery]` — This is the list of metric queries you want to perform. +This is the JSON Schema definition for the structured output. + +Defines the structure and validation rules for the data that will be extracted. Supports all JSON Schema features including: +- Objects and nested properties +- Arrays and array validation +- String, number, boolean, and null types +- Enums and const values +- Validation constraints (min/max, patterns, etc.) +- Composition with allOf, anyOf, oneOf
@@ -6876,8 +4999,8 @@ client.analytics.get(
-## Logs -
client.logs.get(...) +## ProviderResources +
client.provider_resources.provider_resource_controller_get_provider_resources_paginated(...)
@@ -6895,12 +5018,7 @@ from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) -response = client.logs.get() -for item in response: - yield item -# alternatively, you can paginate page-by-page -for page in response.iter_pages(): - yield page +client.provider_resources.provider_resource_controller_get_provider_resources_paginated() ```
@@ -6916,7 +5034,7 @@ for page in response.iter_pages():
-**type:** `typing.Optional[LogsGetRequestType]` — This is the type of the log. +**id:** `typing.Optional[str]`
@@ -6924,7 +5042,7 @@ for page in response.iter_pages():
-**webhook_type:** `typing.Optional[str]` — This is the type of the webhook, given the log is from a webhook. +**resource_id:** `typing.Optional[str]`
@@ -6932,7 +5050,7 @@ for page in response.iter_pages():
-**assistant_id:** `typing.Optional[str]` — This is the ID of the assistant. +**page:** `typing.Optional[float]` — This is the page number to return. Defaults to 1.
@@ -6940,7 +5058,9 @@ for page in response.iter_pages():
-**phone_number_id:** `typing.Optional[str]` — This is the ID of the phone number. +**sort_order:** `typing.Optional[ + ProviderResourceControllerGetProviderResourcesPaginatedRequestSortOrder +]` — This is the sort order for pagination. Defaults to 'DESC'.
@@ -6948,7 +5068,7 @@ for page in response.iter_pages():
-**customer_id:** `typing.Optional[str]` — This is the ID of the customer. +**limit:** `typing.Optional[float]` — This is the maximum number of items to return. Defaults to 100.
@@ -6956,7 +5076,7 @@ for page in response.iter_pages():
-**squad_id:** `typing.Optional[str]` — This is the ID of the squad. +**created_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than the specified value.
@@ -6964,7 +5084,7 @@ for page in response.iter_pages():
-**call_id:** `typing.Optional[str]` — This is the ID of the call. +**created_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than the specified value.
@@ -6972,7 +5092,7 @@ for page in response.iter_pages():
-**page:** `typing.Optional[float]` — This is the page number to return. Defaults to 1. +**created_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than or equal to the specified value.
@@ -6980,7 +5100,7 @@ for page in response.iter_pages():
-**sort_order:** `typing.Optional[LogsGetRequestSortOrder]` — This is the sort order for pagination. Defaults to 'DESC'. +**created_at_le:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than or equal to the specified value.
@@ -6988,7 +5108,7 @@ for page in response.iter_pages():
-**limit:** `typing.Optional[float]` — This is the maximum number of items to return. Defaults to 100. +**updated_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than the specified value.
@@ -6996,7 +5116,7 @@ for page in response.iter_pages():
-**created_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than the specified value. +**updated_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than the specified value.
@@ -7004,7 +5124,7 @@ for page in response.iter_pages():
-**created_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than the specified value. +**updated_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than or equal to the specified value.
@@ -7012,7 +5132,7 @@ for page in response.iter_pages():
-**created_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is greater than or equal to the specified value. +**updated_at_le:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than or equal to the specified value.
@@ -7020,39 +5140,101 @@ for page in response.iter_pages():
-**created_at_le:** `typing.Optional[dt.datetime]` — This will return items where the createdAt is less than or equal to the specified value. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
+ + + + +
+
client.provider_resources.provider_resource_controller_create_provider_resource()
-**updated_at_gt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than the specified value. - +#### 🔌 Usage + +
+
+ +
+
+ +```python +from vapi import Vapi + +client = Vapi( + token="YOUR_TOKEN", +) +client.provider_resources.provider_resource_controller_create_provider_resource() + +``` +
+
+#### ⚙️ Parameters +
-**updated_at_lt:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than the specified value. +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+ + +
+
+
+
client.provider_resources.provider_resource_controller_get_provider_resource(...)
-**updated_at_ge:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is greater than or equal to the specified value. - +#### 🔌 Usage + +
+
+ +
+
+ +```python +from vapi import Vapi + +client = Vapi( + token="YOUR_TOKEN", +) +client.provider_resources.provider_resource_controller_get_provider_resource( + id="id", +) + +``` +
+
+#### ⚙️ Parameters +
-**updated_at_le:** `typing.Optional[dt.datetime]` — This will return items where the updatedAt is less than or equal to the specified value. +
+
+ +**id:** `str`
@@ -7072,7 +5254,7 @@ for page in response.iter_pages():
-
client.logs.logging_controller_logs_delete_query(...) +
client.provider_resources.provider_resource_controller_delete_provider_resource(...)
@@ -7090,7 +5272,9 @@ from vapi import Vapi client = Vapi( token="YOUR_TOKEN", ) -client.logs.logging_controller_logs_delete_query() +client.provider_resources.provider_resource_controller_delete_provider_resource( + id="id", +) ```
@@ -7106,7 +5290,7 @@ client.logs.logging_controller_logs_delete_query()
-**type:** `typing.Optional[LoggingControllerLogsDeleteQueryRequestType]` — This is the type of the log. +**id:** `str`
@@ -7114,23 +5298,55 @@ client.logs.logging_controller_logs_delete_query()
-**assistant_id:** `typing.Optional[str]` +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
+ + + + +
+
client.provider_resources.provider_resource_controller_update_provider_resource(...)
-**phone_number_id:** `typing.Optional[str]` — This is the ID of the phone number. - +#### 🔌 Usage + +
+
+ +
+
+ +```python +from vapi import Vapi + +client = Vapi( + token="YOUR_TOKEN", +) +client.provider_resources.provider_resource_controller_update_provider_resource( + id="id", +) + +``` +
+
+#### ⚙️ Parameters + +
+
+
-**customer_id:** `typing.Optional[str]` — This is the ID of the customer. +**id:** `str`
@@ -7138,15 +5354,67 @@ client.logs.logging_controller_logs_delete_query()
-**squad_id:** `typing.Optional[str]` — This is the ID of the squad. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+ + +
+
+
+ +## Analytics +
client.analytics.get(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from vapi import AnalyticsOperation, AnalyticsQuery, Vapi + +client = Vapi( + token="YOUR_TOKEN", +) +client.analytics.get( + queries=[ + AnalyticsQuery( + table="call", + name="name", + operations=[ + AnalyticsOperation( + operation="sum", + column="id", + ) + ], + ) + ], +) + +``` +
+
+
+
+ +#### ⚙️ Parameters
-**call_id:** `typing.Optional[str]` — This is the ID of the call. +
+
+ +**queries:** `typing.Sequence[AnalyticsQuery]` — This is the list of metric queries you want to perform.
diff --git a/src/vapi/__init__.py b/src/vapi/__init__.py index 9966cc8..06b7a40 100644 --- a/src/vapi/__init__.py +++ b/src/vapi/__init__.py @@ -1,10 +1,3952 @@ # This file was auto-generated by Fern from our API Definition. -from .client import AsyncVapi, Vapi -from .environment import VapiEnvironment +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import ( + AddVoiceToProviderDto, + AiEdgeCondition, + Analysis, + AnalysisCost, + AnalysisCostAnalysisType, + AnalysisCostBreakdown, + AnalysisPlan, + AnalyticsOperation, + AnalyticsOperationColumn, + AnalyticsOperationOperation, + AnalyticsQuery, + AnalyticsQueryGroupByItem, + AnalyticsQueryResult, + AnalyticsQueryTable, + AnthropicCredential, + AnthropicModel, + AnthropicModelModel, + AnthropicModelToolsItem, + AnthropicThinkingConfig, + AnyscaleCredential, + AnyscaleModel, + AnyscaleModelToolsItem, + ApiRequestTool, + ApiRequestToolMessagesItem, + ApiRequestToolMethod, + Artifact, + ArtifactMessagesItem, + ArtifactPlan, + ArtifactPlanRecordingFormat, + AssemblyAiCredential, + AssemblyAiTranscriber, + Assistant, + AssistantBackgroundSound, + AssistantBackgroundSoundZero, + AssistantClientMessagesItem, + AssistantCredentialsItem, + AssistantCustomEndpointingRule, + AssistantFirstMessageMode, + AssistantHookAssistantSpeechInterrupted, + AssistantHookCallEnding, + AssistantHookCustomerSpeechInterrupted, + AssistantHooksItem, + AssistantMessage, + AssistantModel, + AssistantOverrides, + AssistantOverridesBackgroundSound, + AssistantOverridesBackgroundSoundZero, + AssistantOverridesClientMessagesItem, + AssistantOverridesCredentialsItem, + AssistantOverridesFirstMessageMode, + AssistantOverridesHooksItem, + AssistantOverridesModel, + AssistantOverridesServerMessagesItem, + AssistantOverridesTranscriber, + AssistantOverridesVoice, + AssistantOverridesVoicemailDetection, + AssistantPaginatedResponse, + AssistantServerMessagesItem, + AssistantTranscriber, + AssistantUserEditable, + AssistantVersionPaginatedResponse, + AssistantVoice, + AssistantVoicemailDetection, + AutoReloadPlan, + AzureBlobStorageBucketPlan, + AzureCredential, + AzureCredentialRegion, + AzureCredentialService, + AzureOpenAiCredential, + AzureOpenAiCredentialModelsItem, + AzureOpenAiCredentialRegion, + AzureSpeechTranscriber, + AzureSpeechTranscriberLanguage, + AzureSpeechTranscriberSegmentationStrategy, + AzureVoice, + AzureVoiceId, + AzureVoiceIdEnum, + BackgroundSpeechDenoisingPlan, + BackoffPlan, + BashTool, + BashToolMessagesItem, + BashToolWithToolCall, + BashToolWithToolCallMessagesItem, + BearerAuthenticationPlan, + BotMessage, + BothCustomEndpointingRule, + BucketPlan, + ByoPhoneNumber, + ByoPhoneNumberFallbackDestination, + ByoPhoneNumberHooksItem, + ByoPhoneNumberStatus, + ByoSipTrunkCredential, + Call, + CallBatchError, + CallBatchResponse, + CallCostsItem, + CallDestination, + CallEndedReason, + CallHookAssistantSpeechInterrupted, + CallHookAssistantSpeechInterruptedDoItem, + CallHookCallEnding, + CallHookCustomerSpeechInterrupted, + CallHookCustomerSpeechInterruptedDoItem, + CallHookCustomerSpeechTimeout, + CallHookCustomerSpeechTimeoutDoItem, + CallHookFilter, + CallMessagesItem, + CallPaginatedResponse, + CallPhoneCallProvider, + CallPhoneCallTransport, + CallStatus, + CallType, + Campaign, + CampaignEndedReason, + CampaignPaginatedResponse, + CampaignStatus, + CartesiaCredential, + CartesiaExperimentalControls, + CartesiaExperimentalControlsEmotion, + CartesiaExperimentalControlsSpeed, + CartesiaSpeedControl, + CartesiaTranscriber, + CartesiaTranscriberLanguage, + CartesiaVoice, + CartesiaVoiceLanguage, + CartesiaVoiceModel, + CerebrasCredential, + CerebrasModel, + CerebrasModelModel, + CerebrasModelToolsItem, + Chat, + ChatAssistantOverrides, + ChatCost, + ChatCostsItem, + ChatInput, + ChatInputItem, + ChatMessagesItem, + ChatOutputItem, + ChatPaginatedResponse, + ChunkPlan, + ClientInboundMessage, + ClientInboundMessageAddMessage, + ClientInboundMessageControl, + ClientInboundMessageControlControl, + ClientInboundMessageEndCall, + ClientInboundMessageMessage, + ClientInboundMessageSay, + ClientInboundMessageTransfer, + ClientInboundMessageTransferDestination, + ClientMessage, + ClientMessageChatCreated, + ClientMessageChatCreatedPhoneNumber, + ClientMessageChatDeleted, + ClientMessageChatDeletedPhoneNumber, + ClientMessageConversationUpdate, + ClientMessageConversationUpdateMessagesItem, + ClientMessageConversationUpdatePhoneNumber, + ClientMessageHang, + ClientMessageHangPhoneNumber, + ClientMessageLanguageChangeDetected, + ClientMessageLanguageChangeDetectedPhoneNumber, + ClientMessageMessage, + ClientMessageMetadata, + ClientMessageMetadataPhoneNumber, + ClientMessageModelOutput, + ClientMessageModelOutputPhoneNumber, + ClientMessageSessionCreated, + ClientMessageSessionCreatedPhoneNumber, + ClientMessageSessionDeleted, + ClientMessageSessionDeletedPhoneNumber, + ClientMessageSessionUpdated, + ClientMessageSessionUpdatedPhoneNumber, + ClientMessageSpeechUpdate, + ClientMessageSpeechUpdatePhoneNumber, + ClientMessageSpeechUpdateRole, + ClientMessageSpeechUpdateStatus, + ClientMessageToolCalls, + ClientMessageToolCallsPhoneNumber, + ClientMessageToolCallsResult, + ClientMessageToolCallsResultPhoneNumber, + ClientMessageToolCallsToolWithToolCallListItem, + ClientMessageTranscript, + ClientMessageTranscriptPhoneNumber, + ClientMessageTranscriptRole, + ClientMessageTranscriptTranscriptType, + ClientMessageTranscriptType, + ClientMessageTransferUpdate, + ClientMessageTransferUpdateDestination, + ClientMessageTransferUpdatePhoneNumber, + ClientMessageUserInterrupted, + ClientMessageUserInterruptedPhoneNumber, + ClientMessageVoiceInput, + ClientMessageVoiceInputPhoneNumber, + ClientMessageWorkflowNodeStarted, + ClientMessageWorkflowNodeStartedPhoneNumber, + CloneVoiceDto, + CloudflareCredential, + CloudflareR2BucketPlan, + CompliancePlan, + ComputerTool, + ComputerToolMessagesItem, + ComputerToolWithToolCall, + ComputerToolWithToolCallMessagesItem, + Condition, + ConditionOperator, + ContextEngineeringPlanAll, + ContextEngineeringPlanLastNMessages, + ContextEngineeringPlanNone, + ConversationNode, + ConversationNodeModel, + ConversationNodeToolsItem, + ConversationNodeTranscriber, + ConversationNodeVoice, + CostBreakdown, + CreateAnthropicCredentialDto, + CreateAnyscaleCredentialDto, + CreateApiRequestToolDto, + CreateApiRequestToolDtoMessagesItem, + CreateApiRequestToolDtoMethod, + CreateAssemblyAiCredentialDto, + CreateAssistantDto, + CreateAssistantDtoBackgroundSound, + CreateAssistantDtoBackgroundSoundZero, + CreateAssistantDtoClientMessagesItem, + CreateAssistantDtoCredentialsItem, + CreateAssistantDtoFirstMessageMode, + CreateAssistantDtoHooksItem, + CreateAssistantDtoModel, + CreateAssistantDtoServerMessagesItem, + CreateAssistantDtoTranscriber, + CreateAssistantDtoVoice, + CreateAssistantDtoVoicemailDetection, + CreateAzureCredentialDto, + CreateAzureCredentialDtoRegion, + CreateAzureCredentialDtoService, + CreateAzureOpenAiCredentialDto, + CreateAzureOpenAiCredentialDtoModelsItem, + CreateAzureOpenAiCredentialDtoRegion, + CreateBashToolDto, + CreateBashToolDtoMessagesItem, + CreateByoPhoneNumberDto, + CreateByoPhoneNumberDtoFallbackDestination, + CreateByoPhoneNumberDtoHooksItem, + CreateByoSipTrunkCredentialDto, + CreateCartesiaCredentialDto, + CreateCerebrasCredentialDto, + CreateChatStreamResponse, + CreateCloudflareCredentialDto, + CreateComputerToolDto, + CreateComputerToolDtoMessagesItem, + CreateCustomCredentialDto, + CreateCustomCredentialDtoAuthenticationPlan, + CreateCustomKnowledgeBaseDto, + CreateCustomLlmCredentialDto, + CreateCustomerDto, + CreateDeepInfraCredentialDto, + CreateDeepSeekCredentialDto, + CreateDeepgramCredentialDto, + CreateDtmfToolDto, + CreateDtmfToolDtoMessagesItem, + CreateElevenLabsCredentialDto, + CreateEndCallToolDto, + CreateEndCallToolDtoMessagesItem, + CreateFunctionToolDto, + CreateFunctionToolDtoMessagesItem, + CreateGcpCredentialDto, + CreateGhlToolDto, + CreateGhlToolDtoMessagesItem, + CreateGladiaCredentialDto, + CreateGoHighLevelCalendarAvailabilityToolDto, + CreateGoHighLevelCalendarAvailabilityToolDtoMessagesItem, + CreateGoHighLevelCalendarEventCreateToolDto, + CreateGoHighLevelCalendarEventCreateToolDtoMessagesItem, + CreateGoHighLevelContactCreateToolDto, + CreateGoHighLevelContactCreateToolDtoMessagesItem, + CreateGoHighLevelContactGetToolDto, + CreateGoHighLevelContactGetToolDtoMessagesItem, + CreateGoHighLevelCredentialDto, + CreateGoHighLevelMcpCredentialDto, + CreateGoogleCalendarCheckAvailabilityToolDto, + CreateGoogleCalendarCheckAvailabilityToolDtoMessagesItem, + CreateGoogleCalendarCreateEventToolDto, + CreateGoogleCalendarCreateEventToolDtoMessagesItem, + CreateGoogleCalendarOAuth2AuthorizationCredentialDto, + CreateGoogleCalendarOAuth2ClientCredentialDto, + CreateGoogleCredentialDto, + CreateGoogleSheetsOAuth2AuthorizationCredentialDto, + CreateGoogleSheetsRowAppendToolDto, + CreateGoogleSheetsRowAppendToolDtoMessagesItem, + CreateGroqCredentialDto, + CreateHandoffToolDto, + CreateHandoffToolDtoDestinationsItem, + CreateHandoffToolDtoMessagesItem, + CreateHumeCredentialDto, + CreateInflectionAiCredentialDto, + CreateInworldCredentialDto, + CreateLangfuseCredentialDto, + CreateLmntCredentialDto, + CreateMakeCredentialDto, + CreateMakeToolDto, + CreateMakeToolDtoMessagesItem, + CreateMcpToolDto, + CreateMcpToolDtoMessagesItem, + CreateMinimaxCredentialDto, + CreateMistralCredentialDto, + CreateNeuphonicCredentialDto, + CreateOpenAiCredentialDto, + CreateOpenRouterCredentialDto, + CreateOrgDto, + CreateOrgDtoChannel, + CreateOutboundCallDto, + CreateOutputToolDto, + CreateOutputToolDtoMessagesItem, + CreatePerplexityAiCredentialDto, + CreatePlayHtCredentialDto, + CreateQueryToolDto, + CreateQueryToolDtoMessagesItem, + CreateRimeAiCredentialDto, + CreateRunpodCredentialDto, + CreateS3CredentialDto, + CreateSesameVoiceDto, + CreateSlackOAuth2AuthorizationCredentialDto, + CreateSlackSendMessageToolDto, + CreateSlackSendMessageToolDtoMessagesItem, + CreateSmallestAiCredentialDto, + CreateSmsToolDto, + CreateSmsToolDtoMessagesItem, + CreateSpeechmaticsCredentialDto, + CreateSquadDto, + CreateSupabaseCredentialDto, + CreateTavusCredentialDto, + CreateTelnyxPhoneNumberDto, + CreateTelnyxPhoneNumberDtoFallbackDestination, + CreateTelnyxPhoneNumberDtoHooksItem, + CreateTestSuiteDto, + CreateTestSuiteRunDto, + CreateTestSuiteTestChatDto, + CreateTestSuiteTestVoiceDto, + CreateTextEditorToolDto, + CreateTextEditorToolDtoMessagesItem, + CreateTogetherAiCredentialDto, + CreateTokenDto, + CreateTokenDtoTag, + CreateToolTemplateDto, + CreateToolTemplateDtoDetails, + CreateToolTemplateDtoProvider, + CreateToolTemplateDtoProviderDetails, + CreateToolTemplateDtoVisibility, + CreateTransferCallToolDto, + CreateTransferCallToolDtoDestinationsItem, + CreateTransferCallToolDtoMessagesItem, + CreateTrieveCredentialDto, + CreateTrieveKnowledgeBaseDto, + CreateTwilioCredentialDto, + CreateTwilioPhoneNumberDto, + CreateTwilioPhoneNumberDtoFallbackDestination, + CreateTwilioPhoneNumberDtoHooksItem, + CreateVapiPhoneNumberDto, + CreateVapiPhoneNumberDtoFallbackDestination, + CreateVapiPhoneNumberDtoHooksItem, + CreateVoicemailToolDto, + CreateVoicemailToolDtoMessagesItem, + CreateVonageCredentialDto, + CreateVonagePhoneNumberDto, + CreateVonagePhoneNumberDtoFallbackDestination, + CreateVonagePhoneNumberDtoHooksItem, + CreateWebCallDto, + CreateWebChatDto, + CreateWebChatDtoInput, + CreateWebChatDtoInputItem, + CreateWebCustomerDto, + CreateWebhookCredentialDto, + CreateWebhookCredentialDtoAuthenticationPlan, + CreateWorkflowDto, + CreateWorkflowDtoBackgroundSound, + CreateWorkflowDtoBackgroundSoundZero, + CreateWorkflowDtoCredentialsItem, + CreateWorkflowDtoHooksItem, + CreateWorkflowDtoModel, + CreateWorkflowDtoNodesItem, + CreateWorkflowDtoTranscriber, + CreateWorkflowDtoVoice, + CreateXAiCredentialDto, + CredentialActionRequest, + CredentialEndUser, + CredentialSessionDto, + CredentialSessionDtoProvider, + CredentialSessionError, + CredentialSessionResponse, + CredentialWebhookDto, + CredentialWebhookDtoAuthMode, + CredentialWebhookDtoOperation, + CredentialWebhookDtoType, + CustomCredential, + CustomCredentialAuthenticationPlan, + CustomEndpointingModelSmartEndpointingPlan, + CustomEndpointingModelSmartEndpointingPlanProvider, + CustomKnowledgeBase, + CustomLlmCredential, + CustomLlmModel, + CustomLlmModelMetadataSendMode, + CustomLlmModelToolsItem, + CustomMessage, + CustomTranscriber, + CustomVoice, + CustomerCustomEndpointingRule, + CustomerSpeechTimeoutOptions, + DeepInfraCredential, + DeepInfraModel, + DeepInfraModelToolsItem, + DeepSeekCredential, + DeepSeekModel, + DeepSeekModelModel, + DeepSeekModelToolsItem, + DeepgramCredential, + DeepgramTranscriber, + DeepgramTranscriberLanguage, + DeepgramTranscriberModel, + DeepgramVoice, + DeepgramVoiceId, + DeepgramVoiceModel, + DeveloperMessage, + DtmfTool, + DtmfToolMessagesItem, + Edge, + ElevenLabsCredential, + ElevenLabsPronunciationDictionary, + ElevenLabsPronunciationDictionaryLocator, + ElevenLabsPronunciationDictionaryPermissionOnResource, + ElevenLabsTranscriber, + ElevenLabsTranscriberLanguage, + ElevenLabsVoice, + ElevenLabsVoiceId, + ElevenLabsVoiceIdEnum, + ElevenLabsVoiceModel, + EndCallTool, + EndCallToolMessagesItem, + ExactReplacement, + FailedEdgeCondition, + FallbackAssemblyAiTranscriber, + FallbackAzureSpeechTranscriber, + FallbackAzureSpeechTranscriberLanguage, + FallbackAzureSpeechTranscriberSegmentationStrategy, + FallbackAzureVoice, + FallbackAzureVoiceId, + FallbackAzureVoiceVoiceId, + FallbackCartesiaTranscriber, + FallbackCartesiaTranscriberLanguage, + FallbackCartesiaVoice, + FallbackCartesiaVoiceLanguage, + FallbackCartesiaVoiceModel, + FallbackCustomTranscriber, + FallbackCustomVoice, + FallbackDeepgramTranscriber, + FallbackDeepgramTranscriberLanguage, + FallbackDeepgramTranscriberModel, + FallbackDeepgramVoice, + FallbackDeepgramVoiceId, + FallbackDeepgramVoiceModel, + FallbackElevenLabsTranscriber, + FallbackElevenLabsTranscriberLanguage, + FallbackElevenLabsVoice, + FallbackElevenLabsVoiceId, + FallbackElevenLabsVoiceIdEnum, + FallbackElevenLabsVoiceModel, + FallbackGladiaTranscriber, + FallbackGladiaTranscriberLanguage, + FallbackGladiaTranscriberLanguageBehaviour, + FallbackGladiaTranscriberLanguages, + FallbackGladiaTranscriberModel, + FallbackGoogleTranscriber, + FallbackGoogleTranscriberLanguage, + FallbackGoogleTranscriberModel, + FallbackHumeVoice, + FallbackInworldVoice, + FallbackInworldVoiceLanguageCode, + FallbackInworldVoiceVoiceId, + FallbackLmntVoice, + FallbackLmntVoiceId, + FallbackLmntVoiceIdEnum, + FallbackLmntVoiceLanguage, + FallbackMinimaxVoice, + FallbackMinimaxVoiceModel, + FallbackMinimaxVoiceRegion, + FallbackNeetsVoice, + FallbackNeuphonicVoice, + FallbackNeuphonicVoiceModel, + FallbackOpenAiTranscriber, + FallbackOpenAiTranscriberLanguage, + FallbackOpenAiTranscriberModel, + FallbackOpenAiVoice, + FallbackOpenAiVoiceId, + FallbackOpenAiVoiceIdEnum, + FallbackOpenAiVoiceModel, + FallbackPlan, + FallbackPlanVoicesItem, + FallbackPlayHtVoice, + FallbackPlayHtVoiceEmotion, + FallbackPlayHtVoiceId, + FallbackPlayHtVoiceIdEnum, + FallbackPlayHtVoiceLanguage, + FallbackPlayHtVoiceModel, + FallbackRimeAiVoice, + FallbackRimeAiVoiceId, + FallbackRimeAiVoiceIdEnum, + FallbackRimeAiVoiceModel, + FallbackSesameVoice, + FallbackSmallestAiVoice, + FallbackSmallestAiVoiceId, + FallbackSmallestAiVoiceIdEnum, + FallbackSpeechmaticsTranscriber, + FallbackSpeechmaticsTranscriberLanguage, + FallbackTalkscriberTranscriber, + FallbackTalkscriberTranscriberLanguage, + FallbackTavusVoice, + FallbackTavusVoiceVoiceId, + FallbackTranscriberPlan, + FallbackTranscriberPlanTranscribersItem, + FallbackVapiVoice, + FallbackVapiVoiceVoiceId, + File, + FileStatus, + FormatPlan, + FormatPlanFormattersEnabledItem, + FormatPlanReplacementsItem, + FourierDenoisingPlan, + FunctionCall, + FunctionCallAssistantHookAction, + FunctionCallHookAction, + FunctionCallHookActionMessagesItem, + FunctionTool, + FunctionToolMessagesItem, + FunctionToolProviderDetails, + FunctionToolWithToolCall, + FunctionToolWithToolCallMessagesItem, + GcpCredential, + GcpKey, + GeminiMultimodalLivePrebuiltVoiceConfig, + GeminiMultimodalLivePrebuiltVoiceConfigVoiceName, + GeminiMultimodalLiveSpeechConfig, + GeminiMultimodalLiveVoiceConfig, + GetChatPaginatedDto, + GetChatPaginatedDtoSortOrder, + GetSessionPaginatedDto, + GetSessionPaginatedDtoSortOrder, + GhlTool, + GhlToolMessagesItem, + GhlToolMetadata, + GhlToolProviderDetails, + GhlToolWithToolCall, + GhlToolWithToolCallMessagesItem, + GladiaCredential, + GladiaCustomVocabularyConfigDto, + GladiaCustomVocabularyConfigDtoVocabularyItem, + GladiaTranscriber, + GladiaTranscriberLanguage, + GladiaTranscriberLanguageBehaviour, + GladiaTranscriberLanguages, + GladiaTranscriberModel, + GladiaVocabularyItemDto, + GlobalNodePlan, + GoHighLevelCalendarAvailabilityTool, + GoHighLevelCalendarAvailabilityToolMessagesItem, + GoHighLevelCalendarAvailabilityToolProviderDetails, + GoHighLevelCalendarAvailabilityToolWithToolCall, + GoHighLevelCalendarAvailabilityToolWithToolCallMessagesItem, + GoHighLevelCalendarEventCreateTool, + GoHighLevelCalendarEventCreateToolMessagesItem, + GoHighLevelCalendarEventCreateToolProviderDetails, + GoHighLevelCalendarEventCreateToolWithToolCall, + GoHighLevelCalendarEventCreateToolWithToolCallMessagesItem, + GoHighLevelContactCreateTool, + GoHighLevelContactCreateToolMessagesItem, + GoHighLevelContactCreateToolProviderDetails, + GoHighLevelContactCreateToolWithToolCall, + GoHighLevelContactCreateToolWithToolCallMessagesItem, + GoHighLevelContactGetTool, + GoHighLevelContactGetToolMessagesItem, + GoHighLevelContactGetToolProviderDetails, + GoHighLevelContactGetToolWithToolCall, + GoHighLevelContactGetToolWithToolCallMessagesItem, + GoHighLevelCredential, + GoHighLevelMcpCredential, + GoogleCalendarCheckAvailabilityTool, + GoogleCalendarCheckAvailabilityToolMessagesItem, + GoogleCalendarCreateEventTool, + GoogleCalendarCreateEventToolMessagesItem, + GoogleCalendarCreateEventToolProviderDetails, + GoogleCalendarCreateEventToolWithToolCall, + GoogleCalendarCreateEventToolWithToolCallMessagesItem, + GoogleCalendarOAuth2AuthorizationCredential, + GoogleCalendarOAuth2ClientCredential, + GoogleCredential, + GoogleModel, + GoogleModelModel, + GoogleModelToolsItem, + GoogleRealtimeConfig, + GoogleSheetsOAuth2AuthorizationCredential, + GoogleSheetsRowAppendTool, + GoogleSheetsRowAppendToolMessagesItem, + GoogleSheetsRowAppendToolProviderDetails, + GoogleSheetsRowAppendToolWithToolCall, + GoogleSheetsRowAppendToolWithToolCallMessagesItem, + GoogleTranscriber, + GoogleTranscriberLanguage, + GoogleTranscriberModel, + GoogleVoicemailDetectionPlan, + GoogleVoicemailDetectionPlanType, + GroqCredential, + GroqModel, + GroqModelModel, + GroqModelToolsItem, + GroupCondition, + GroupConditionConditionsItem, + GroupConditionOperator, + HandoffDestinationAssistant, + HandoffDestinationAssistantContextEngineeringPlan, + HandoffDestinationDynamic, + HandoffTool, + HandoffToolDestinationsItem, + HandoffToolMessagesItem, + HangupNode, + HmacAuthenticationPlan, + HmacAuthenticationPlanAlgorithm, + HmacAuthenticationPlanSignatureEncoding, + HumeCredential, + HumeVoice, + ImportTwilioPhoneNumberDto, + ImportTwilioPhoneNumberDtoFallbackDestination, + ImportTwilioPhoneNumberDtoHooksItem, + ImportVonagePhoneNumberDto, + ImportVonagePhoneNumberDtoFallbackDestination, + ImportVonagePhoneNumberDtoHooksItem, + InflectionAiCredential, + InflectionAiModel, + InflectionAiModelToolsItem, + InviteUserDto, + InviteUserDtoRole, + InvoicePlan, + InworldCredential, + InworldVoice, + InworldVoiceLanguageCode, + InworldVoiceVoiceId, + JsonSchema, + JsonSchemaFormat, + JsonSchemaType, + JwtResponse, + KeypadInputPlan, + KeypadInputPlanDelimiters, + KnowledgeBase, + KnowledgeBaseCost, + KnowledgeBaseModel, + KnowledgeBaseResponseDocument, + LangfuseCredential, + LangfuseObservabilityPlan, + LiquidCondition, + LivekitSmartEndpointingPlan, + LivekitSmartEndpointingPlanProvider, + LmntCredential, + LmntVoice, + LmntVoiceId, + LmntVoiceIdEnum, + LmntVoiceLanguage, + LogicEdgeCondition, + MakeCredential, + MakeTool, + MakeToolMessagesItem, + MakeToolMetadata, + MakeToolProviderDetails, + MakeToolWithToolCall, + MakeToolWithToolCallMessagesItem, + McpTool, + McpToolMessagesItem, + McpToolMetadata, + McpToolMetadataProtocol, + MessageTarget, + MessageTargetRole, + MinimaxVoice, + MinimaxVoiceModel, + MinimaxVoiceRegion, + MistralCredential, + ModelCost, + Monitor, + MonitorPlan, + Mono, + NeetsVoice, + NeuphonicCredential, + NeuphonicVoice, + NeuphonicVoiceModel, + NodeArtifact, + NodeArtifactMessagesItem, + OAuth2AuthenticationPlan, + Oauth2AuthenticationSession, + OpenAiCredential, + OpenAiFunction, + OpenAiFunctionParameters, + OpenAiMessage, + OpenAiMessageRole, + OpenAiModel, + OpenAiModelFallbackModelsItem, + OpenAiModelModel, + OpenAiModelToolStrictCompatibilityMode, + OpenAiModelToolsItem, + OpenAiTranscriber, + OpenAiTranscriberLanguage, + OpenAiTranscriberModel, + OpenAiVoice, + OpenAiVoiceId, + OpenAiVoiceIdEnum, + OpenAiVoiceModel, + OpenAiVoicemailDetectionPlan, + OpenAiVoicemailDetectionPlanType, + OpenAiWebChatRequest, + OpenAiWebChatRequestInput, + OpenAiWebChatRequestInputItem, + OpenRouterCredential, + OpenRouterModel, + OpenRouterModelToolsItem, + Org, + OrgChannel, + OutputTool, + OutputToolMessagesItem, + PaginationMeta, + PerformanceMetrics, + PerplexityAiCredential, + PerplexityAiModel, + PerplexityAiModelToolsItem, + PhoneNumberCallEndingHookFilter, + PhoneNumberCallEndingHookFilterOneOfItem, + PhoneNumberHookCallEnding, + PhoneNumberHookCallEndingDo, + PhoneNumberHookCallRinging, + PhoneNumberHookCallRingingDoItem, + PhoneNumberPaginatedResponse, + PhoneNumberPaginatedResponseResultsItem, + PlayHtCredential, + PlayHtVoice, + PlayHtVoiceEmotion, + PlayHtVoiceId, + PlayHtVoiceIdEnum, + PlayHtVoiceLanguage, + PlayHtVoiceModel, + PromptInjectionSecurityFilter, + ProviderResource, + ProviderResourcePaginatedResponse, + PunctuationBoundary, + QueryTool, + QueryToolMessagesItem, + RceSecurityFilter, + Recording, + RegexCondition, + RegexOption, + RegexOptionType, + RegexReplacement, + RegexSecurityFilter, + ResponseCompletedEvent, + ResponseErrorEvent, + ResponseObject, + ResponseObjectStatus, + ResponseOutputMessage, + ResponseOutputMessageStatus, + ResponseOutputText, + ResponseTextDeltaEvent, + ResponseTextDoneEvent, + RimeAiCredential, + RimeAiVoice, + RimeAiVoiceId, + RimeAiVoiceIdEnum, + RimeAiVoiceModel, + RunpodCredential, + S3Credential, + SayAssistantHookAction, + SayHookAction, + SayHookActionPrompt, + SayHookActionPromptItem, + SayPhoneNumberHookAction, + SbcConfiguration, + SchedulePlan, + SecurityFilterBase, + SecurityFilterPlan, + SecurityFilterPlanMode, + Server, + ServerMessage, + ServerMessageAssistantRequest, + ServerMessageAssistantRequestPhoneNumber, + ServerMessageCallEndpointingRequest, + ServerMessageCallEndpointingRequestMessagesItem, + ServerMessageCallEndpointingRequestPhoneNumber, + ServerMessageChatCreated, + ServerMessageChatCreatedPhoneNumber, + ServerMessageChatDeleted, + ServerMessageChatDeletedPhoneNumber, + ServerMessageConversationUpdate, + ServerMessageConversationUpdateMessagesItem, + ServerMessageConversationUpdatePhoneNumber, + ServerMessageEndOfCallReport, + ServerMessageEndOfCallReportCostsItem, + ServerMessageEndOfCallReportEndedReason, + ServerMessageEndOfCallReportPhoneNumber, + ServerMessageHang, + ServerMessageHangPhoneNumber, + ServerMessageKnowledgeBaseRequest, + ServerMessageKnowledgeBaseRequestMessagesItem, + ServerMessageKnowledgeBaseRequestPhoneNumber, + ServerMessageLanguageChangeDetected, + ServerMessageLanguageChangeDetectedPhoneNumber, + ServerMessageMessage, + ServerMessageModelOutput, + ServerMessageModelOutputPhoneNumber, + ServerMessagePhoneCallControl, + ServerMessagePhoneCallControlDestination, + ServerMessagePhoneCallControlPhoneNumber, + ServerMessagePhoneCallControlRequest, + ServerMessageResponse, + ServerMessageResponseAssistantRequest, + ServerMessageResponseAssistantRequestDestination, + ServerMessageResponseCallEndpointingRequest, + ServerMessageResponseHandoffDestinationRequest, + ServerMessageResponseKnowledgeBaseRequest, + ServerMessageResponseMessageResponse, + ServerMessageResponseToolCalls, + ServerMessageResponseTransferDestinationRequest, + ServerMessageResponseTransferDestinationRequestDestination, + ServerMessageResponseTransferDestinationRequestMessage, + ServerMessageResponseVoiceRequest, + ServerMessageSessionCreated, + ServerMessageSessionCreatedPhoneNumber, + ServerMessageSessionDeleted, + ServerMessageSessionDeletedPhoneNumber, + ServerMessageSessionUpdated, + ServerMessageSessionUpdatedPhoneNumber, + ServerMessageSpeechUpdate, + ServerMessageSpeechUpdatePhoneNumber, + ServerMessageSpeechUpdateRole, + ServerMessageSpeechUpdateStatus, + ServerMessageStatusUpdate, + ServerMessageStatusUpdateDestination, + ServerMessageStatusUpdateEndedReason, + ServerMessageStatusUpdateMessagesItem, + ServerMessageStatusUpdatePhoneNumber, + ServerMessageStatusUpdateStatus, + ServerMessageToolCalls, + ServerMessageToolCallsPhoneNumber, + ServerMessageToolCallsToolWithToolCallListItem, + ServerMessageTranscript, + ServerMessageTranscriptPhoneNumber, + ServerMessageTranscriptRole, + ServerMessageTranscriptTranscriptType, + ServerMessageTranscriptType, + ServerMessageTransferDestinationRequest, + ServerMessageTransferDestinationRequestPhoneNumber, + ServerMessageTransferUpdate, + ServerMessageTransferUpdateDestination, + ServerMessageTransferUpdatePhoneNumber, + ServerMessageUserInterrupted, + ServerMessageUserInterruptedPhoneNumber, + ServerMessageVoiceInput, + ServerMessageVoiceInputPhoneNumber, + ServerMessageVoiceRequest, + ServerMessageVoiceRequestPhoneNumber, + SesameVoice, + Session, + SessionMessagesItem, + SessionPaginatedResponse, + SessionStatus, + SipAuthentication, + SipTrunkGateway, + SipTrunkGatewayOutboundProtocol, + SipTrunkOutboundAuthenticationPlan, + SipTrunkOutboundSipRegisterPlan, + SlackOAuth2AuthorizationCredential, + SlackSendMessageTool, + SlackSendMessageToolMessagesItem, + SmallestAiCredential, + SmallestAiVoice, + SmallestAiVoiceId, + SmallestAiVoiceIdEnum, + SmartDenoisingPlan, + SmsTool, + SmsToolMessagesItem, + SpeechmaticsCredential, + SpeechmaticsTranscriber, + SpeechmaticsTranscriberLanguage, + SqlInjectionSecurityFilter, + Squad, + SquadMemberDto, + SquadMemberDtoAssistantDestinationsItem, + SsrfSecurityFilter, + StartSpeakingPlan, + StartSpeakingPlanCustomEndpointingRulesItem, + StartSpeakingPlanSmartEndpointingEnabled, + StartSpeakingPlanSmartEndpointingPlan, + StopSpeakingPlan, + StructuredDataMultiPlan, + StructuredDataPlan, + StructuredOutput, + StructuredOutputModel, + StructuredOutputPaginatedResponse, + Subscription, + SubscriptionMinutesIncludedResetFrequency, + SubscriptionStatus, + SubscriptionType, + SuccessEvaluationPlan, + SuccessEvaluationPlanRubric, + SummaryPlan, + SupabaseBucketPlan, + SupabaseBucketPlanRegion, + SupabaseCredential, + SyncVoiceLibraryDto, + SyncVoiceLibraryDtoProvidersItem, + SystemMessage, + TalkscriberTranscriber, + TalkscriberTranscriberLanguage, + TargetPlan, + TavusConversationProperties, + TavusCredential, + TavusVoice, + TavusVoiceVoiceId, + TelnyxPhoneNumber, + TelnyxPhoneNumberFallbackDestination, + TelnyxPhoneNumberHooksItem, + TelnyxPhoneNumberStatus, + Template, + TemplateDetails, + TemplateProvider, + TemplateProviderDetails, + TemplateVisibility, + TestSuite, + TestSuitePhoneNumber, + TestSuiteRun, + TestSuiteRunScorerAi, + TestSuiteRunScorerAiResult, + TestSuiteRunStatus, + TestSuiteRunTestAttempt, + TestSuiteRunTestAttemptCall, + TestSuiteRunTestAttemptMetadata, + TestSuiteRunTestResult, + TestSuiteRunsPaginatedResponse, + TestSuiteTestChat, + TestSuiteTestScorerAi, + TestSuiteTestVoice, + TestSuiteTestsPaginatedResponse, + TestSuiteTestsPaginatedResponseResultsItem, + TestSuitesPaginatedResponse, + TesterPlan, + TextContent, + TextContentLanguage, + TextEditorTool, + TextEditorToolMessagesItem, + TextEditorToolWithToolCall, + TextEditorToolWithToolCallMessagesItem, + TimeRange, + TimeRangeStep, + TogetherAiCredential, + TogetherAiModel, + TogetherAiModelToolsItem, + Token, + TokenRestrictions, + TokenTag, + ToolCall, + ToolCallFunction, + ToolCallHookAction, + ToolCallHookActionTool, + ToolCallMessage, + ToolCallResult, + ToolCallResultMessage, + ToolMessage, + ToolMessageComplete, + ToolMessageCompleteRole, + ToolMessageDelayed, + ToolMessageFailed, + ToolMessageStart, + ToolNode, + ToolNodeTool, + ToolRejectionPlan, + ToolRejectionPlanConditionsItem, + ToolTemplateMetadata, + ToolTemplateSetup, + TranscriberCost, + TranscriptPlan, + TranscriptionEndpointingPlan, + TransferAssistant, + TransferAssistantFirstMessageMode, + TransferAssistantHookAction, + TransferAssistantModel, + TransferAssistantModelProvider, + TransferCallTool, + TransferCallToolDestinationsItem, + TransferCallToolMessagesItem, + TransferCancelToolUserEditable, + TransferCancelToolUserEditableMessagesItem, + TransferDestinationAssistant, + TransferDestinationAssistantMessage, + TransferDestinationNumber, + TransferDestinationNumberMessage, + TransferDestinationSip, + TransferDestinationSipMessage, + TransferFallbackPlan, + TransferFallbackPlanMessage, + TransferHookAction, + TransferHookActionDestination, + TransferMode, + TransferPhoneNumberHookAction, + TransferPhoneNumberHookActionDestination, + TransferPlan, + TransferPlanMessage, + TransferPlanMode, + TransferSuccessfulToolUserEditable, + TransferSuccessfulToolUserEditableMessagesItem, + TransportConfigurationTwilio, + TransportConfigurationTwilioRecordingChannels, + TransportCost, + TransportCostProvider, + TrieveCredential, + TrieveKnowledgeBase, + TrieveKnowledgeBaseChunkPlan, + TrieveKnowledgeBaseCreate, + TrieveKnowledgeBaseImport, + TrieveKnowledgeBaseSearchPlan, + TrieveKnowledgeBaseSearchPlanSearchType, + TurnLatency, + TwilioCredential, + TwilioPhoneNumber, + TwilioPhoneNumberFallbackDestination, + TwilioPhoneNumberHooksItem, + TwilioPhoneNumberStatus, + TwilioVoicemailDetectionPlan, + TwilioVoicemailDetectionPlanVoicemailDetectionTypesItem, + UpdateAnthropicCredentialDto, + UpdateAnyscaleCredentialDto, + UpdateApiRequestToolDto, + UpdateApiRequestToolDtoMessagesItem, + UpdateApiRequestToolDtoMethod, + UpdateAssemblyAiCredentialDto, + UpdateAzureCredentialDto, + UpdateAzureCredentialDtoRegion, + UpdateAzureCredentialDtoService, + UpdateAzureOpenAiCredentialDto, + UpdateAzureOpenAiCredentialDtoModelsItem, + UpdateAzureOpenAiCredentialDtoRegion, + UpdateBashToolDto, + UpdateBashToolDtoMessagesItem, + UpdateByoPhoneNumberDto, + UpdateByoPhoneNumberDtoFallbackDestination, + UpdateByoPhoneNumberDtoHooksItem, + UpdateByoSipTrunkCredentialDto, + UpdateCartesiaCredentialDto, + UpdateCerebrasCredentialDto, + UpdateCloudflareCredentialDto, + UpdateComputerToolDto, + UpdateComputerToolDtoMessagesItem, + UpdateCustomCredentialDto, + UpdateCustomCredentialDtoAuthenticationPlan, + UpdateCustomKnowledgeBaseDto, + UpdateCustomLlmCredentialDto, + UpdateDeepInfraCredentialDto, + UpdateDeepSeekCredentialDto, + UpdateDeepgramCredentialDto, + UpdateDtmfToolDto, + UpdateDtmfToolDtoMessagesItem, + UpdateElevenLabsCredentialDto, + UpdateEndCallToolDto, + UpdateEndCallToolDtoMessagesItem, + UpdateFunctionToolDto, + UpdateFunctionToolDtoMessagesItem, + UpdateGcpCredentialDto, + UpdateGhlToolDto, + UpdateGhlToolDtoMessagesItem, + UpdateGladiaCredentialDto, + UpdateGoHighLevelCalendarAvailabilityToolDto, + UpdateGoHighLevelCalendarAvailabilityToolDtoMessagesItem, + UpdateGoHighLevelCalendarEventCreateToolDto, + UpdateGoHighLevelCalendarEventCreateToolDtoMessagesItem, + UpdateGoHighLevelContactCreateToolDto, + UpdateGoHighLevelContactCreateToolDtoMessagesItem, + UpdateGoHighLevelContactGetToolDto, + UpdateGoHighLevelContactGetToolDtoMessagesItem, + UpdateGoHighLevelCredentialDto, + UpdateGoHighLevelMcpCredentialDto, + UpdateGoogleCalendarCheckAvailabilityToolDto, + UpdateGoogleCalendarCheckAvailabilityToolDtoMessagesItem, + UpdateGoogleCalendarCreateEventToolDto, + UpdateGoogleCalendarCreateEventToolDtoMessagesItem, + UpdateGoogleCalendarOAuth2AuthorizationCredentialDto, + UpdateGoogleCalendarOAuth2ClientCredentialDto, + UpdateGoogleCredentialDto, + UpdateGoogleSheetsOAuth2AuthorizationCredentialDto, + UpdateGoogleSheetsRowAppendToolDto, + UpdateGoogleSheetsRowAppendToolDtoMessagesItem, + UpdateGroqCredentialDto, + UpdateHandoffToolDto, + UpdateHandoffToolDtoDestinationsItem, + UpdateHandoffToolDtoMessagesItem, + UpdateHumeCredentialDto, + UpdateInflectionAiCredentialDto, + UpdateInworldCredentialDto, + UpdateLangfuseCredentialDto, + UpdateLmntCredentialDto, + UpdateMakeCredentialDto, + UpdateMakeToolDto, + UpdateMakeToolDtoMessagesItem, + UpdateMcpToolDto, + UpdateMcpToolDtoMessagesItem, + UpdateMistralCredentialDto, + UpdateNeuphonicCredentialDto, + UpdateOpenAiCredentialDto, + UpdateOpenRouterCredentialDto, + UpdateOrgDto, + UpdateOrgDtoChannel, + UpdateOutputToolDto, + UpdateOutputToolDtoMessagesItem, + UpdatePerplexityAiCredentialDto, + UpdatePlayHtCredentialDto, + UpdateQueryToolDto, + UpdateQueryToolDtoMessagesItem, + UpdateRimeAiCredentialDto, + UpdateRunpodCredentialDto, + UpdateS3CredentialDto, + UpdateSlackOAuth2AuthorizationCredentialDto, + UpdateSlackSendMessageToolDto, + UpdateSlackSendMessageToolDtoMessagesItem, + UpdateSmallestAiCredentialDto, + UpdateSmsToolDto, + UpdateSmsToolDtoMessagesItem, + UpdateSpeechmaticsCredentialDto, + UpdateSupabaseCredentialDto, + UpdateTavusCredentialDto, + UpdateTelnyxPhoneNumberDto, + UpdateTelnyxPhoneNumberDtoFallbackDestination, + UpdateTelnyxPhoneNumberDtoHooksItem, + UpdateTestSuiteDto, + UpdateTestSuiteRunDto, + UpdateTestSuiteTestChatDto, + UpdateTestSuiteTestVoiceDto, + UpdateTextEditorToolDto, + UpdateTextEditorToolDtoMessagesItem, + UpdateTogetherAiCredentialDto, + UpdateTokenDto, + UpdateTokenDtoTag, + UpdateToolTemplateDto, + UpdateToolTemplateDtoDetails, + UpdateToolTemplateDtoProvider, + UpdateToolTemplateDtoProviderDetails, + UpdateToolTemplateDtoVisibility, + UpdateTransferCallToolDto, + UpdateTransferCallToolDtoDestinationsItem, + UpdateTransferCallToolDtoMessagesItem, + UpdateTrieveCredentialDto, + UpdateTrieveKnowledgeBaseDto, + UpdateTwilioCredentialDto, + UpdateTwilioPhoneNumberDto, + UpdateTwilioPhoneNumberDtoFallbackDestination, + UpdateTwilioPhoneNumberDtoHooksItem, + UpdateUserRoleDto, + UpdateUserRoleDtoRole, + UpdateVapiPhoneNumberDto, + UpdateVapiPhoneNumberDtoFallbackDestination, + UpdateVapiPhoneNumberDtoHooksItem, + UpdateVonageCredentialDto, + UpdateVonagePhoneNumberDto, + UpdateVonagePhoneNumberDtoFallbackDestination, + UpdateVonagePhoneNumberDtoHooksItem, + UpdateWebhookCredentialDto, + UpdateWebhookCredentialDtoAuthenticationPlan, + UpdateWorkflowDto, + UpdateWorkflowDtoBackgroundSound, + UpdateWorkflowDtoBackgroundSoundZero, + UpdateWorkflowDtoCredentialsItem, + UpdateWorkflowDtoHooksItem, + UpdateWorkflowDtoModel, + UpdateWorkflowDtoNodesItem, + UpdateWorkflowDtoTranscriber, + UpdateWorkflowDtoVoice, + UpdateXAiCredentialDto, + User, + UserMessage, + VapiCost, + VapiCostSubType, + VapiModel, + VapiModelToolsItem, + VapiPhoneNumber, + VapiPhoneNumberFallbackDestination, + VapiPhoneNumberHooksItem, + VapiPhoneNumberStatus, + VapiSmartEndpointingPlan, + VapiSmartEndpointingPlanProvider, + VapiVoice, + VapiVoiceVoiceId, + VapiVoicemailDetectionPlan, + VapiVoicemailDetectionPlanType, + VariableExtractionAlias, + VariableExtractionPlan, + VoiceCost, + VoiceLibrary, + VoiceLibraryGender, + VoiceLibraryVoiceResponse, + VoicemailDetectionBackoffPlan, + VoicemailDetectionCost, + VoicemailDetectionCostProvider, + VonageCredential, + VonagePhoneNumber, + VonagePhoneNumberFallbackDestination, + VonagePhoneNumberHooksItem, + VonagePhoneNumberStatus, + WebChat, + WebChatOutputItem, + WebhookCredential, + WebhookCredentialAuthenticationPlan, + Workflow, + WorkflowAnthropicModel, + WorkflowAnthropicModelModel, + WorkflowBackgroundSound, + WorkflowBackgroundSoundZero, + WorkflowCredentialsItem, + WorkflowCustomModel, + WorkflowCustomModelMetadataSendMode, + WorkflowGoogleModel, + WorkflowGoogleModelModel, + WorkflowHooksItem, + WorkflowModel, + WorkflowNodesItem, + WorkflowOpenAiModel, + WorkflowOpenAiModelModel, + WorkflowOverrides, + WorkflowTranscriber, + WorkflowUserEditable, + WorkflowUserEditableBackgroundSound, + WorkflowUserEditableBackgroundSoundZero, + WorkflowUserEditableCredentialsItem, + WorkflowUserEditableHooksItem, + WorkflowUserEditableModel, + WorkflowUserEditableNodesItem, + WorkflowUserEditableTranscriber, + WorkflowUserEditableVoice, + WorkflowVoice, + XAiCredential, + XaiModel, + XaiModelModel, + XaiModelToolsItem, + XssSecurityFilter, + ) + from .errors import BadRequestError, NotFoundError + from . import ( + analytics, + assistants, + calls, + campaigns, + chats, + files, + phone_numbers, + provider_resources, + sessions, + squads, + structured_outputs, + tools, + ) + from .assistants import ( + UpdateAssistantDtoBackgroundSound, + UpdateAssistantDtoBackgroundSoundZero, + UpdateAssistantDtoClientMessagesItem, + UpdateAssistantDtoCredentialsItem, + UpdateAssistantDtoFirstMessageMode, + UpdateAssistantDtoHooksItem, + UpdateAssistantDtoModel, + UpdateAssistantDtoServerMessagesItem, + UpdateAssistantDtoTranscriber, + UpdateAssistantDtoVoice, + UpdateAssistantDtoVoicemailDetection, + ) + from .calls import CallsCreateResponse + from .campaigns import CampaignControllerFindAllRequestSortOrder, CampaignControllerFindAllRequestStatus + from .chats import ( + ChatsCreateResponse, + ChatsCreateResponseResponse, + ChatsListRequestSortOrder, + CreateChatDtoInput, + CreateChatDtoInputItem, + OpenAiResponsesRequestInput, + OpenAiResponsesRequestInputItem, + ) + from .client import AsyncVapi, Vapi + from .environment import VapiEnvironment + from .phone_numbers import ( + PhoneNumbersCreateRequest, + PhoneNumbersCreateResponse, + PhoneNumbersDeleteResponse, + PhoneNumbersGetResponse, + PhoneNumbersListResponseItem, + PhoneNumbersUpdateRequest, + PhoneNumbersUpdateResponse, + ) + from .provider_resources import ProviderResourceControllerGetProviderResourcesPaginatedRequestSortOrder + from .sessions import ( + CreateSessionDtoMessagesItem, + CreateSessionDtoStatus, + SessionsListRequestSortOrder, + UpdateSessionDtoMessagesItem, + UpdateSessionDtoStatus, + ) + from .structured_outputs import ( + CreateStructuredOutputDtoModel, + StructuredOutputControllerFindAllRequestSortOrder, + UpdateStructuredOutputDtoModel, + ) + from .tools import ( + ToolsCreateRequest, + ToolsCreateResponse, + ToolsDeleteResponse, + ToolsGetResponse, + ToolsListResponseItem, + ToolsUpdateRequest, + ToolsUpdateResponse, + ) + from .version import __version__ +_dynamic_imports: typing.Dict[str, str] = { + "AddVoiceToProviderDto": ".types", + "AiEdgeCondition": ".types", + "Analysis": ".types", + "AnalysisCost": ".types", + "AnalysisCostAnalysisType": ".types", + "AnalysisCostBreakdown": ".types", + "AnalysisPlan": ".types", + "AnalyticsOperation": ".types", + "AnalyticsOperationColumn": ".types", + "AnalyticsOperationOperation": ".types", + "AnalyticsQuery": ".types", + "AnalyticsQueryGroupByItem": ".types", + "AnalyticsQueryResult": ".types", + "AnalyticsQueryTable": ".types", + "AnthropicCredential": ".types", + "AnthropicModel": ".types", + "AnthropicModelModel": ".types", + "AnthropicModelToolsItem": ".types", + "AnthropicThinkingConfig": ".types", + "AnyscaleCredential": ".types", + "AnyscaleModel": ".types", + "AnyscaleModelToolsItem": ".types", + "ApiRequestTool": ".types", + "ApiRequestToolMessagesItem": ".types", + "ApiRequestToolMethod": ".types", + "Artifact": ".types", + "ArtifactMessagesItem": ".types", + "ArtifactPlan": ".types", + "ArtifactPlanRecordingFormat": ".types", + "AssemblyAiCredential": ".types", + "AssemblyAiTranscriber": ".types", + "Assistant": ".types", + "AssistantBackgroundSound": ".types", + "AssistantBackgroundSoundZero": ".types", + "AssistantClientMessagesItem": ".types", + "AssistantCredentialsItem": ".types", + "AssistantCustomEndpointingRule": ".types", + "AssistantFirstMessageMode": ".types", + "AssistantHookAssistantSpeechInterrupted": ".types", + "AssistantHookCallEnding": ".types", + "AssistantHookCustomerSpeechInterrupted": ".types", + "AssistantHooksItem": ".types", + "AssistantMessage": ".types", + "AssistantModel": ".types", + "AssistantOverrides": ".types", + "AssistantOverridesBackgroundSound": ".types", + "AssistantOverridesBackgroundSoundZero": ".types", + "AssistantOverridesClientMessagesItem": ".types", + "AssistantOverridesCredentialsItem": ".types", + "AssistantOverridesFirstMessageMode": ".types", + "AssistantOverridesHooksItem": ".types", + "AssistantOverridesModel": ".types", + "AssistantOverridesServerMessagesItem": ".types", + "AssistantOverridesTranscriber": ".types", + "AssistantOverridesVoice": ".types", + "AssistantOverridesVoicemailDetection": ".types", + "AssistantPaginatedResponse": ".types", + "AssistantServerMessagesItem": ".types", + "AssistantTranscriber": ".types", + "AssistantUserEditable": ".types", + "AssistantVersionPaginatedResponse": ".types", + "AssistantVoice": ".types", + "AssistantVoicemailDetection": ".types", + "AsyncVapi": ".client", + "AutoReloadPlan": ".types", + "AzureBlobStorageBucketPlan": ".types", + "AzureCredential": ".types", + "AzureCredentialRegion": ".types", + "AzureCredentialService": ".types", + "AzureOpenAiCredential": ".types", + "AzureOpenAiCredentialModelsItem": ".types", + "AzureOpenAiCredentialRegion": ".types", + "AzureSpeechTranscriber": ".types", + "AzureSpeechTranscriberLanguage": ".types", + "AzureSpeechTranscriberSegmentationStrategy": ".types", + "AzureVoice": ".types", + "AzureVoiceId": ".types", + "AzureVoiceIdEnum": ".types", + "BackgroundSpeechDenoisingPlan": ".types", + "BackoffPlan": ".types", + "BadRequestError": ".errors", + "BashTool": ".types", + "BashToolMessagesItem": ".types", + "BashToolWithToolCall": ".types", + "BashToolWithToolCallMessagesItem": ".types", + "BearerAuthenticationPlan": ".types", + "BotMessage": ".types", + "BothCustomEndpointingRule": ".types", + "BucketPlan": ".types", + "ByoPhoneNumber": ".types", + "ByoPhoneNumberFallbackDestination": ".types", + "ByoPhoneNumberHooksItem": ".types", + "ByoPhoneNumberStatus": ".types", + "ByoSipTrunkCredential": ".types", + "Call": ".types", + "CallBatchError": ".types", + "CallBatchResponse": ".types", + "CallCostsItem": ".types", + "CallDestination": ".types", + "CallEndedReason": ".types", + "CallHookAssistantSpeechInterrupted": ".types", + "CallHookAssistantSpeechInterruptedDoItem": ".types", + "CallHookCallEnding": ".types", + "CallHookCustomerSpeechInterrupted": ".types", + "CallHookCustomerSpeechInterruptedDoItem": ".types", + "CallHookCustomerSpeechTimeout": ".types", + "CallHookCustomerSpeechTimeoutDoItem": ".types", + "CallHookFilter": ".types", + "CallMessagesItem": ".types", + "CallPaginatedResponse": ".types", + "CallPhoneCallProvider": ".types", + "CallPhoneCallTransport": ".types", + "CallStatus": ".types", + "CallType": ".types", + "CallsCreateResponse": ".calls", + "Campaign": ".types", + "CampaignControllerFindAllRequestSortOrder": ".campaigns", + "CampaignControllerFindAllRequestStatus": ".campaigns", + "CampaignEndedReason": ".types", + "CampaignPaginatedResponse": ".types", + "CampaignStatus": ".types", + "CartesiaCredential": ".types", + "CartesiaExperimentalControls": ".types", + "CartesiaExperimentalControlsEmotion": ".types", + "CartesiaExperimentalControlsSpeed": ".types", + "CartesiaSpeedControl": ".types", + "CartesiaTranscriber": ".types", + "CartesiaTranscriberLanguage": ".types", + "CartesiaVoice": ".types", + "CartesiaVoiceLanguage": ".types", + "CartesiaVoiceModel": ".types", + "CerebrasCredential": ".types", + "CerebrasModel": ".types", + "CerebrasModelModel": ".types", + "CerebrasModelToolsItem": ".types", + "Chat": ".types", + "ChatAssistantOverrides": ".types", + "ChatCost": ".types", + "ChatCostsItem": ".types", + "ChatInput": ".types", + "ChatInputItem": ".types", + "ChatMessagesItem": ".types", + "ChatOutputItem": ".types", + "ChatPaginatedResponse": ".types", + "ChatsCreateResponse": ".chats", + "ChatsCreateResponseResponse": ".chats", + "ChatsListRequestSortOrder": ".chats", + "ChunkPlan": ".types", + "ClientInboundMessage": ".types", + "ClientInboundMessageAddMessage": ".types", + "ClientInboundMessageControl": ".types", + "ClientInboundMessageControlControl": ".types", + "ClientInboundMessageEndCall": ".types", + "ClientInboundMessageMessage": ".types", + "ClientInboundMessageSay": ".types", + "ClientInboundMessageTransfer": ".types", + "ClientInboundMessageTransferDestination": ".types", + "ClientMessage": ".types", + "ClientMessageChatCreated": ".types", + "ClientMessageChatCreatedPhoneNumber": ".types", + "ClientMessageChatDeleted": ".types", + "ClientMessageChatDeletedPhoneNumber": ".types", + "ClientMessageConversationUpdate": ".types", + "ClientMessageConversationUpdateMessagesItem": ".types", + "ClientMessageConversationUpdatePhoneNumber": ".types", + "ClientMessageHang": ".types", + "ClientMessageHangPhoneNumber": ".types", + "ClientMessageLanguageChangeDetected": ".types", + "ClientMessageLanguageChangeDetectedPhoneNumber": ".types", + "ClientMessageMessage": ".types", + "ClientMessageMetadata": ".types", + "ClientMessageMetadataPhoneNumber": ".types", + "ClientMessageModelOutput": ".types", + "ClientMessageModelOutputPhoneNumber": ".types", + "ClientMessageSessionCreated": ".types", + "ClientMessageSessionCreatedPhoneNumber": ".types", + "ClientMessageSessionDeleted": ".types", + "ClientMessageSessionDeletedPhoneNumber": ".types", + "ClientMessageSessionUpdated": ".types", + "ClientMessageSessionUpdatedPhoneNumber": ".types", + "ClientMessageSpeechUpdate": ".types", + "ClientMessageSpeechUpdatePhoneNumber": ".types", + "ClientMessageSpeechUpdateRole": ".types", + "ClientMessageSpeechUpdateStatus": ".types", + "ClientMessageToolCalls": ".types", + "ClientMessageToolCallsPhoneNumber": ".types", + "ClientMessageToolCallsResult": ".types", + "ClientMessageToolCallsResultPhoneNumber": ".types", + "ClientMessageToolCallsToolWithToolCallListItem": ".types", + "ClientMessageTranscript": ".types", + "ClientMessageTranscriptPhoneNumber": ".types", + "ClientMessageTranscriptRole": ".types", + "ClientMessageTranscriptTranscriptType": ".types", + "ClientMessageTranscriptType": ".types", + "ClientMessageTransferUpdate": ".types", + "ClientMessageTransferUpdateDestination": ".types", + "ClientMessageTransferUpdatePhoneNumber": ".types", + "ClientMessageUserInterrupted": ".types", + "ClientMessageUserInterruptedPhoneNumber": ".types", + "ClientMessageVoiceInput": ".types", + "ClientMessageVoiceInputPhoneNumber": ".types", + "ClientMessageWorkflowNodeStarted": ".types", + "ClientMessageWorkflowNodeStartedPhoneNumber": ".types", + "CloneVoiceDto": ".types", + "CloudflareCredential": ".types", + "CloudflareR2BucketPlan": ".types", + "CompliancePlan": ".types", + "ComputerTool": ".types", + "ComputerToolMessagesItem": ".types", + "ComputerToolWithToolCall": ".types", + "ComputerToolWithToolCallMessagesItem": ".types", + "Condition": ".types", + "ConditionOperator": ".types", + "ContextEngineeringPlanAll": ".types", + "ContextEngineeringPlanLastNMessages": ".types", + "ContextEngineeringPlanNone": ".types", + "ConversationNode": ".types", + "ConversationNodeModel": ".types", + "ConversationNodeToolsItem": ".types", + "ConversationNodeTranscriber": ".types", + "ConversationNodeVoice": ".types", + "CostBreakdown": ".types", + "CreateAnthropicCredentialDto": ".types", + "CreateAnyscaleCredentialDto": ".types", + "CreateApiRequestToolDto": ".types", + "CreateApiRequestToolDtoMessagesItem": ".types", + "CreateApiRequestToolDtoMethod": ".types", + "CreateAssemblyAiCredentialDto": ".types", + "CreateAssistantDto": ".types", + "CreateAssistantDtoBackgroundSound": ".types", + "CreateAssistantDtoBackgroundSoundZero": ".types", + "CreateAssistantDtoClientMessagesItem": ".types", + "CreateAssistantDtoCredentialsItem": ".types", + "CreateAssistantDtoFirstMessageMode": ".types", + "CreateAssistantDtoHooksItem": ".types", + "CreateAssistantDtoModel": ".types", + "CreateAssistantDtoServerMessagesItem": ".types", + "CreateAssistantDtoTranscriber": ".types", + "CreateAssistantDtoVoice": ".types", + "CreateAssistantDtoVoicemailDetection": ".types", + "CreateAzureCredentialDto": ".types", + "CreateAzureCredentialDtoRegion": ".types", + "CreateAzureCredentialDtoService": ".types", + "CreateAzureOpenAiCredentialDto": ".types", + "CreateAzureOpenAiCredentialDtoModelsItem": ".types", + "CreateAzureOpenAiCredentialDtoRegion": ".types", + "CreateBashToolDto": ".types", + "CreateBashToolDtoMessagesItem": ".types", + "CreateByoPhoneNumberDto": ".types", + "CreateByoPhoneNumberDtoFallbackDestination": ".types", + "CreateByoPhoneNumberDtoHooksItem": ".types", + "CreateByoSipTrunkCredentialDto": ".types", + "CreateCartesiaCredentialDto": ".types", + "CreateCerebrasCredentialDto": ".types", + "CreateChatDtoInput": ".chats", + "CreateChatDtoInputItem": ".chats", + "CreateChatStreamResponse": ".types", + "CreateCloudflareCredentialDto": ".types", + "CreateComputerToolDto": ".types", + "CreateComputerToolDtoMessagesItem": ".types", + "CreateCustomCredentialDto": ".types", + "CreateCustomCredentialDtoAuthenticationPlan": ".types", + "CreateCustomKnowledgeBaseDto": ".types", + "CreateCustomLlmCredentialDto": ".types", + "CreateCustomerDto": ".types", + "CreateDeepInfraCredentialDto": ".types", + "CreateDeepSeekCredentialDto": ".types", + "CreateDeepgramCredentialDto": ".types", + "CreateDtmfToolDto": ".types", + "CreateDtmfToolDtoMessagesItem": ".types", + "CreateElevenLabsCredentialDto": ".types", + "CreateEndCallToolDto": ".types", + "CreateEndCallToolDtoMessagesItem": ".types", + "CreateFunctionToolDto": ".types", + "CreateFunctionToolDtoMessagesItem": ".types", + "CreateGcpCredentialDto": ".types", + "CreateGhlToolDto": ".types", + "CreateGhlToolDtoMessagesItem": ".types", + "CreateGladiaCredentialDto": ".types", + "CreateGoHighLevelCalendarAvailabilityToolDto": ".types", + "CreateGoHighLevelCalendarAvailabilityToolDtoMessagesItem": ".types", + "CreateGoHighLevelCalendarEventCreateToolDto": ".types", + "CreateGoHighLevelCalendarEventCreateToolDtoMessagesItem": ".types", + "CreateGoHighLevelContactCreateToolDto": ".types", + "CreateGoHighLevelContactCreateToolDtoMessagesItem": ".types", + "CreateGoHighLevelContactGetToolDto": ".types", + "CreateGoHighLevelContactGetToolDtoMessagesItem": ".types", + "CreateGoHighLevelCredentialDto": ".types", + "CreateGoHighLevelMcpCredentialDto": ".types", + "CreateGoogleCalendarCheckAvailabilityToolDto": ".types", + "CreateGoogleCalendarCheckAvailabilityToolDtoMessagesItem": ".types", + "CreateGoogleCalendarCreateEventToolDto": ".types", + "CreateGoogleCalendarCreateEventToolDtoMessagesItem": ".types", + "CreateGoogleCalendarOAuth2AuthorizationCredentialDto": ".types", + "CreateGoogleCalendarOAuth2ClientCredentialDto": ".types", + "CreateGoogleCredentialDto": ".types", + "CreateGoogleSheetsOAuth2AuthorizationCredentialDto": ".types", + "CreateGoogleSheetsRowAppendToolDto": ".types", + "CreateGoogleSheetsRowAppendToolDtoMessagesItem": ".types", + "CreateGroqCredentialDto": ".types", + "CreateHandoffToolDto": ".types", + "CreateHandoffToolDtoDestinationsItem": ".types", + "CreateHandoffToolDtoMessagesItem": ".types", + "CreateHumeCredentialDto": ".types", + "CreateInflectionAiCredentialDto": ".types", + "CreateInworldCredentialDto": ".types", + "CreateLangfuseCredentialDto": ".types", + "CreateLmntCredentialDto": ".types", + "CreateMakeCredentialDto": ".types", + "CreateMakeToolDto": ".types", + "CreateMakeToolDtoMessagesItem": ".types", + "CreateMcpToolDto": ".types", + "CreateMcpToolDtoMessagesItem": ".types", + "CreateMinimaxCredentialDto": ".types", + "CreateMistralCredentialDto": ".types", + "CreateNeuphonicCredentialDto": ".types", + "CreateOpenAiCredentialDto": ".types", + "CreateOpenRouterCredentialDto": ".types", + "CreateOrgDto": ".types", + "CreateOrgDtoChannel": ".types", + "CreateOutboundCallDto": ".types", + "CreateOutputToolDto": ".types", + "CreateOutputToolDtoMessagesItem": ".types", + "CreatePerplexityAiCredentialDto": ".types", + "CreatePlayHtCredentialDto": ".types", + "CreateQueryToolDto": ".types", + "CreateQueryToolDtoMessagesItem": ".types", + "CreateRimeAiCredentialDto": ".types", + "CreateRunpodCredentialDto": ".types", + "CreateS3CredentialDto": ".types", + "CreateSesameVoiceDto": ".types", + "CreateSessionDtoMessagesItem": ".sessions", + "CreateSessionDtoStatus": ".sessions", + "CreateSlackOAuth2AuthorizationCredentialDto": ".types", + "CreateSlackSendMessageToolDto": ".types", + "CreateSlackSendMessageToolDtoMessagesItem": ".types", + "CreateSmallestAiCredentialDto": ".types", + "CreateSmsToolDto": ".types", + "CreateSmsToolDtoMessagesItem": ".types", + "CreateSpeechmaticsCredentialDto": ".types", + "CreateSquadDto": ".types", + "CreateStructuredOutputDtoModel": ".structured_outputs", + "CreateSupabaseCredentialDto": ".types", + "CreateTavusCredentialDto": ".types", + "CreateTelnyxPhoneNumberDto": ".types", + "CreateTelnyxPhoneNumberDtoFallbackDestination": ".types", + "CreateTelnyxPhoneNumberDtoHooksItem": ".types", + "CreateTestSuiteDto": ".types", + "CreateTestSuiteRunDto": ".types", + "CreateTestSuiteTestChatDto": ".types", + "CreateTestSuiteTestVoiceDto": ".types", + "CreateTextEditorToolDto": ".types", + "CreateTextEditorToolDtoMessagesItem": ".types", + "CreateTogetherAiCredentialDto": ".types", + "CreateTokenDto": ".types", + "CreateTokenDtoTag": ".types", + "CreateToolTemplateDto": ".types", + "CreateToolTemplateDtoDetails": ".types", + "CreateToolTemplateDtoProvider": ".types", + "CreateToolTemplateDtoProviderDetails": ".types", + "CreateToolTemplateDtoVisibility": ".types", + "CreateTransferCallToolDto": ".types", + "CreateTransferCallToolDtoDestinationsItem": ".types", + "CreateTransferCallToolDtoMessagesItem": ".types", + "CreateTrieveCredentialDto": ".types", + "CreateTrieveKnowledgeBaseDto": ".types", + "CreateTwilioCredentialDto": ".types", + "CreateTwilioPhoneNumberDto": ".types", + "CreateTwilioPhoneNumberDtoFallbackDestination": ".types", + "CreateTwilioPhoneNumberDtoHooksItem": ".types", + "CreateVapiPhoneNumberDto": ".types", + "CreateVapiPhoneNumberDtoFallbackDestination": ".types", + "CreateVapiPhoneNumberDtoHooksItem": ".types", + "CreateVoicemailToolDto": ".types", + "CreateVoicemailToolDtoMessagesItem": ".types", + "CreateVonageCredentialDto": ".types", + "CreateVonagePhoneNumberDto": ".types", + "CreateVonagePhoneNumberDtoFallbackDestination": ".types", + "CreateVonagePhoneNumberDtoHooksItem": ".types", + "CreateWebCallDto": ".types", + "CreateWebChatDto": ".types", + "CreateWebChatDtoInput": ".types", + "CreateWebChatDtoInputItem": ".types", + "CreateWebCustomerDto": ".types", + "CreateWebhookCredentialDto": ".types", + "CreateWebhookCredentialDtoAuthenticationPlan": ".types", + "CreateWorkflowDto": ".types", + "CreateWorkflowDtoBackgroundSound": ".types", + "CreateWorkflowDtoBackgroundSoundZero": ".types", + "CreateWorkflowDtoCredentialsItem": ".types", + "CreateWorkflowDtoHooksItem": ".types", + "CreateWorkflowDtoModel": ".types", + "CreateWorkflowDtoNodesItem": ".types", + "CreateWorkflowDtoTranscriber": ".types", + "CreateWorkflowDtoVoice": ".types", + "CreateXAiCredentialDto": ".types", + "CredentialActionRequest": ".types", + "CredentialEndUser": ".types", + "CredentialSessionDto": ".types", + "CredentialSessionDtoProvider": ".types", + "CredentialSessionError": ".types", + "CredentialSessionResponse": ".types", + "CredentialWebhookDto": ".types", + "CredentialWebhookDtoAuthMode": ".types", + "CredentialWebhookDtoOperation": ".types", + "CredentialWebhookDtoType": ".types", + "CustomCredential": ".types", + "CustomCredentialAuthenticationPlan": ".types", + "CustomEndpointingModelSmartEndpointingPlan": ".types", + "CustomEndpointingModelSmartEndpointingPlanProvider": ".types", + "CustomKnowledgeBase": ".types", + "CustomLlmCredential": ".types", + "CustomLlmModel": ".types", + "CustomLlmModelMetadataSendMode": ".types", + "CustomLlmModelToolsItem": ".types", + "CustomMessage": ".types", + "CustomTranscriber": ".types", + "CustomVoice": ".types", + "CustomerCustomEndpointingRule": ".types", + "CustomerSpeechTimeoutOptions": ".types", + "DeepInfraCredential": ".types", + "DeepInfraModel": ".types", + "DeepInfraModelToolsItem": ".types", + "DeepSeekCredential": ".types", + "DeepSeekModel": ".types", + "DeepSeekModelModel": ".types", + "DeepSeekModelToolsItem": ".types", + "DeepgramCredential": ".types", + "DeepgramTranscriber": ".types", + "DeepgramTranscriberLanguage": ".types", + "DeepgramTranscriberModel": ".types", + "DeepgramVoice": ".types", + "DeepgramVoiceId": ".types", + "DeepgramVoiceModel": ".types", + "DeveloperMessage": ".types", + "DtmfTool": ".types", + "DtmfToolMessagesItem": ".types", + "Edge": ".types", + "ElevenLabsCredential": ".types", + "ElevenLabsPronunciationDictionary": ".types", + "ElevenLabsPronunciationDictionaryLocator": ".types", + "ElevenLabsPronunciationDictionaryPermissionOnResource": ".types", + "ElevenLabsTranscriber": ".types", + "ElevenLabsTranscriberLanguage": ".types", + "ElevenLabsVoice": ".types", + "ElevenLabsVoiceId": ".types", + "ElevenLabsVoiceIdEnum": ".types", + "ElevenLabsVoiceModel": ".types", + "EndCallTool": ".types", + "EndCallToolMessagesItem": ".types", + "ExactReplacement": ".types", + "FailedEdgeCondition": ".types", + "FallbackAssemblyAiTranscriber": ".types", + "FallbackAzureSpeechTranscriber": ".types", + "FallbackAzureSpeechTranscriberLanguage": ".types", + "FallbackAzureSpeechTranscriberSegmentationStrategy": ".types", + "FallbackAzureVoice": ".types", + "FallbackAzureVoiceId": ".types", + "FallbackAzureVoiceVoiceId": ".types", + "FallbackCartesiaTranscriber": ".types", + "FallbackCartesiaTranscriberLanguage": ".types", + "FallbackCartesiaVoice": ".types", + "FallbackCartesiaVoiceLanguage": ".types", + "FallbackCartesiaVoiceModel": ".types", + "FallbackCustomTranscriber": ".types", + "FallbackCustomVoice": ".types", + "FallbackDeepgramTranscriber": ".types", + "FallbackDeepgramTranscriberLanguage": ".types", + "FallbackDeepgramTranscriberModel": ".types", + "FallbackDeepgramVoice": ".types", + "FallbackDeepgramVoiceId": ".types", + "FallbackDeepgramVoiceModel": ".types", + "FallbackElevenLabsTranscriber": ".types", + "FallbackElevenLabsTranscriberLanguage": ".types", + "FallbackElevenLabsVoice": ".types", + "FallbackElevenLabsVoiceId": ".types", + "FallbackElevenLabsVoiceIdEnum": ".types", + "FallbackElevenLabsVoiceModel": ".types", + "FallbackGladiaTranscriber": ".types", + "FallbackGladiaTranscriberLanguage": ".types", + "FallbackGladiaTranscriberLanguageBehaviour": ".types", + "FallbackGladiaTranscriberLanguages": ".types", + "FallbackGladiaTranscriberModel": ".types", + "FallbackGoogleTranscriber": ".types", + "FallbackGoogleTranscriberLanguage": ".types", + "FallbackGoogleTranscriberModel": ".types", + "FallbackHumeVoice": ".types", + "FallbackInworldVoice": ".types", + "FallbackInworldVoiceLanguageCode": ".types", + "FallbackInworldVoiceVoiceId": ".types", + "FallbackLmntVoice": ".types", + "FallbackLmntVoiceId": ".types", + "FallbackLmntVoiceIdEnum": ".types", + "FallbackLmntVoiceLanguage": ".types", + "FallbackMinimaxVoice": ".types", + "FallbackMinimaxVoiceModel": ".types", + "FallbackMinimaxVoiceRegion": ".types", + "FallbackNeetsVoice": ".types", + "FallbackNeuphonicVoice": ".types", + "FallbackNeuphonicVoiceModel": ".types", + "FallbackOpenAiTranscriber": ".types", + "FallbackOpenAiTranscriberLanguage": ".types", + "FallbackOpenAiTranscriberModel": ".types", + "FallbackOpenAiVoice": ".types", + "FallbackOpenAiVoiceId": ".types", + "FallbackOpenAiVoiceIdEnum": ".types", + "FallbackOpenAiVoiceModel": ".types", + "FallbackPlan": ".types", + "FallbackPlanVoicesItem": ".types", + "FallbackPlayHtVoice": ".types", + "FallbackPlayHtVoiceEmotion": ".types", + "FallbackPlayHtVoiceId": ".types", + "FallbackPlayHtVoiceIdEnum": ".types", + "FallbackPlayHtVoiceLanguage": ".types", + "FallbackPlayHtVoiceModel": ".types", + "FallbackRimeAiVoice": ".types", + "FallbackRimeAiVoiceId": ".types", + "FallbackRimeAiVoiceIdEnum": ".types", + "FallbackRimeAiVoiceModel": ".types", + "FallbackSesameVoice": ".types", + "FallbackSmallestAiVoice": ".types", + "FallbackSmallestAiVoiceId": ".types", + "FallbackSmallestAiVoiceIdEnum": ".types", + "FallbackSpeechmaticsTranscriber": ".types", + "FallbackSpeechmaticsTranscriberLanguage": ".types", + "FallbackTalkscriberTranscriber": ".types", + "FallbackTalkscriberTranscriberLanguage": ".types", + "FallbackTavusVoice": ".types", + "FallbackTavusVoiceVoiceId": ".types", + "FallbackTranscriberPlan": ".types", + "FallbackTranscriberPlanTranscribersItem": ".types", + "FallbackVapiVoice": ".types", + "FallbackVapiVoiceVoiceId": ".types", + "File": ".types", + "FileStatus": ".types", + "FormatPlan": ".types", + "FormatPlanFormattersEnabledItem": ".types", + "FormatPlanReplacementsItem": ".types", + "FourierDenoisingPlan": ".types", + "FunctionCall": ".types", + "FunctionCallAssistantHookAction": ".types", + "FunctionCallHookAction": ".types", + "FunctionCallHookActionMessagesItem": ".types", + "FunctionTool": ".types", + "FunctionToolMessagesItem": ".types", + "FunctionToolProviderDetails": ".types", + "FunctionToolWithToolCall": ".types", + "FunctionToolWithToolCallMessagesItem": ".types", + "GcpCredential": ".types", + "GcpKey": ".types", + "GeminiMultimodalLivePrebuiltVoiceConfig": ".types", + "GeminiMultimodalLivePrebuiltVoiceConfigVoiceName": ".types", + "GeminiMultimodalLiveSpeechConfig": ".types", + "GeminiMultimodalLiveVoiceConfig": ".types", + "GetChatPaginatedDto": ".types", + "GetChatPaginatedDtoSortOrder": ".types", + "GetSessionPaginatedDto": ".types", + "GetSessionPaginatedDtoSortOrder": ".types", + "GhlTool": ".types", + "GhlToolMessagesItem": ".types", + "GhlToolMetadata": ".types", + "GhlToolProviderDetails": ".types", + "GhlToolWithToolCall": ".types", + "GhlToolWithToolCallMessagesItem": ".types", + "GladiaCredential": ".types", + "GladiaCustomVocabularyConfigDto": ".types", + "GladiaCustomVocabularyConfigDtoVocabularyItem": ".types", + "GladiaTranscriber": ".types", + "GladiaTranscriberLanguage": ".types", + "GladiaTranscriberLanguageBehaviour": ".types", + "GladiaTranscriberLanguages": ".types", + "GladiaTranscriberModel": ".types", + "GladiaVocabularyItemDto": ".types", + "GlobalNodePlan": ".types", + "GoHighLevelCalendarAvailabilityTool": ".types", + "GoHighLevelCalendarAvailabilityToolMessagesItem": ".types", + "GoHighLevelCalendarAvailabilityToolProviderDetails": ".types", + "GoHighLevelCalendarAvailabilityToolWithToolCall": ".types", + "GoHighLevelCalendarAvailabilityToolWithToolCallMessagesItem": ".types", + "GoHighLevelCalendarEventCreateTool": ".types", + "GoHighLevelCalendarEventCreateToolMessagesItem": ".types", + "GoHighLevelCalendarEventCreateToolProviderDetails": ".types", + "GoHighLevelCalendarEventCreateToolWithToolCall": ".types", + "GoHighLevelCalendarEventCreateToolWithToolCallMessagesItem": ".types", + "GoHighLevelContactCreateTool": ".types", + "GoHighLevelContactCreateToolMessagesItem": ".types", + "GoHighLevelContactCreateToolProviderDetails": ".types", + "GoHighLevelContactCreateToolWithToolCall": ".types", + "GoHighLevelContactCreateToolWithToolCallMessagesItem": ".types", + "GoHighLevelContactGetTool": ".types", + "GoHighLevelContactGetToolMessagesItem": ".types", + "GoHighLevelContactGetToolProviderDetails": ".types", + "GoHighLevelContactGetToolWithToolCall": ".types", + "GoHighLevelContactGetToolWithToolCallMessagesItem": ".types", + "GoHighLevelCredential": ".types", + "GoHighLevelMcpCredential": ".types", + "GoogleCalendarCheckAvailabilityTool": ".types", + "GoogleCalendarCheckAvailabilityToolMessagesItem": ".types", + "GoogleCalendarCreateEventTool": ".types", + "GoogleCalendarCreateEventToolMessagesItem": ".types", + "GoogleCalendarCreateEventToolProviderDetails": ".types", + "GoogleCalendarCreateEventToolWithToolCall": ".types", + "GoogleCalendarCreateEventToolWithToolCallMessagesItem": ".types", + "GoogleCalendarOAuth2AuthorizationCredential": ".types", + "GoogleCalendarOAuth2ClientCredential": ".types", + "GoogleCredential": ".types", + "GoogleModel": ".types", + "GoogleModelModel": ".types", + "GoogleModelToolsItem": ".types", + "GoogleRealtimeConfig": ".types", + "GoogleSheetsOAuth2AuthorizationCredential": ".types", + "GoogleSheetsRowAppendTool": ".types", + "GoogleSheetsRowAppendToolMessagesItem": ".types", + "GoogleSheetsRowAppendToolProviderDetails": ".types", + "GoogleSheetsRowAppendToolWithToolCall": ".types", + "GoogleSheetsRowAppendToolWithToolCallMessagesItem": ".types", + "GoogleTranscriber": ".types", + "GoogleTranscriberLanguage": ".types", + "GoogleTranscriberModel": ".types", + "GoogleVoicemailDetectionPlan": ".types", + "GoogleVoicemailDetectionPlanType": ".types", + "GroqCredential": ".types", + "GroqModel": ".types", + "GroqModelModel": ".types", + "GroqModelToolsItem": ".types", + "GroupCondition": ".types", + "GroupConditionConditionsItem": ".types", + "GroupConditionOperator": ".types", + "HandoffDestinationAssistant": ".types", + "HandoffDestinationAssistantContextEngineeringPlan": ".types", + "HandoffDestinationDynamic": ".types", + "HandoffTool": ".types", + "HandoffToolDestinationsItem": ".types", + "HandoffToolMessagesItem": ".types", + "HangupNode": ".types", + "HmacAuthenticationPlan": ".types", + "HmacAuthenticationPlanAlgorithm": ".types", + "HmacAuthenticationPlanSignatureEncoding": ".types", + "HumeCredential": ".types", + "HumeVoice": ".types", + "ImportTwilioPhoneNumberDto": ".types", + "ImportTwilioPhoneNumberDtoFallbackDestination": ".types", + "ImportTwilioPhoneNumberDtoHooksItem": ".types", + "ImportVonagePhoneNumberDto": ".types", + "ImportVonagePhoneNumberDtoFallbackDestination": ".types", + "ImportVonagePhoneNumberDtoHooksItem": ".types", + "InflectionAiCredential": ".types", + "InflectionAiModel": ".types", + "InflectionAiModelToolsItem": ".types", + "InviteUserDto": ".types", + "InviteUserDtoRole": ".types", + "InvoicePlan": ".types", + "InworldCredential": ".types", + "InworldVoice": ".types", + "InworldVoiceLanguageCode": ".types", + "InworldVoiceVoiceId": ".types", + "JsonSchema": ".types", + "JsonSchemaFormat": ".types", + "JsonSchemaType": ".types", + "JwtResponse": ".types", + "KeypadInputPlan": ".types", + "KeypadInputPlanDelimiters": ".types", + "KnowledgeBase": ".types", + "KnowledgeBaseCost": ".types", + "KnowledgeBaseModel": ".types", + "KnowledgeBaseResponseDocument": ".types", + "LangfuseCredential": ".types", + "LangfuseObservabilityPlan": ".types", + "LiquidCondition": ".types", + "LivekitSmartEndpointingPlan": ".types", + "LivekitSmartEndpointingPlanProvider": ".types", + "LmntCredential": ".types", + "LmntVoice": ".types", + "LmntVoiceId": ".types", + "LmntVoiceIdEnum": ".types", + "LmntVoiceLanguage": ".types", + "LogicEdgeCondition": ".types", + "MakeCredential": ".types", + "MakeTool": ".types", + "MakeToolMessagesItem": ".types", + "MakeToolMetadata": ".types", + "MakeToolProviderDetails": ".types", + "MakeToolWithToolCall": ".types", + "MakeToolWithToolCallMessagesItem": ".types", + "McpTool": ".types", + "McpToolMessagesItem": ".types", + "McpToolMetadata": ".types", + "McpToolMetadataProtocol": ".types", + "MessageTarget": ".types", + "MessageTargetRole": ".types", + "MinimaxVoice": ".types", + "MinimaxVoiceModel": ".types", + "MinimaxVoiceRegion": ".types", + "MistralCredential": ".types", + "ModelCost": ".types", + "Monitor": ".types", + "MonitorPlan": ".types", + "Mono": ".types", + "NeetsVoice": ".types", + "NeuphonicCredential": ".types", + "NeuphonicVoice": ".types", + "NeuphonicVoiceModel": ".types", + "NodeArtifact": ".types", + "NodeArtifactMessagesItem": ".types", + "NotFoundError": ".errors", + "OAuth2AuthenticationPlan": ".types", + "Oauth2AuthenticationSession": ".types", + "OpenAiCredential": ".types", + "OpenAiFunction": ".types", + "OpenAiFunctionParameters": ".types", + "OpenAiMessage": ".types", + "OpenAiMessageRole": ".types", + "OpenAiModel": ".types", + "OpenAiModelFallbackModelsItem": ".types", + "OpenAiModelModel": ".types", + "OpenAiModelToolStrictCompatibilityMode": ".types", + "OpenAiModelToolsItem": ".types", + "OpenAiResponsesRequestInput": ".chats", + "OpenAiResponsesRequestInputItem": ".chats", + "OpenAiTranscriber": ".types", + "OpenAiTranscriberLanguage": ".types", + "OpenAiTranscriberModel": ".types", + "OpenAiVoice": ".types", + "OpenAiVoiceId": ".types", + "OpenAiVoiceIdEnum": ".types", + "OpenAiVoiceModel": ".types", + "OpenAiVoicemailDetectionPlan": ".types", + "OpenAiVoicemailDetectionPlanType": ".types", + "OpenAiWebChatRequest": ".types", + "OpenAiWebChatRequestInput": ".types", + "OpenAiWebChatRequestInputItem": ".types", + "OpenRouterCredential": ".types", + "OpenRouterModel": ".types", + "OpenRouterModelToolsItem": ".types", + "Org": ".types", + "OrgChannel": ".types", + "OutputTool": ".types", + "OutputToolMessagesItem": ".types", + "PaginationMeta": ".types", + "PerformanceMetrics": ".types", + "PerplexityAiCredential": ".types", + "PerplexityAiModel": ".types", + "PerplexityAiModelToolsItem": ".types", + "PhoneNumberCallEndingHookFilter": ".types", + "PhoneNumberCallEndingHookFilterOneOfItem": ".types", + "PhoneNumberHookCallEnding": ".types", + "PhoneNumberHookCallEndingDo": ".types", + "PhoneNumberHookCallRinging": ".types", + "PhoneNumberHookCallRingingDoItem": ".types", + "PhoneNumberPaginatedResponse": ".types", + "PhoneNumberPaginatedResponseResultsItem": ".types", + "PhoneNumbersCreateRequest": ".phone_numbers", + "PhoneNumbersCreateResponse": ".phone_numbers", + "PhoneNumbersDeleteResponse": ".phone_numbers", + "PhoneNumbersGetResponse": ".phone_numbers", + "PhoneNumbersListResponseItem": ".phone_numbers", + "PhoneNumbersUpdateRequest": ".phone_numbers", + "PhoneNumbersUpdateResponse": ".phone_numbers", + "PlayHtCredential": ".types", + "PlayHtVoice": ".types", + "PlayHtVoiceEmotion": ".types", + "PlayHtVoiceId": ".types", + "PlayHtVoiceIdEnum": ".types", + "PlayHtVoiceLanguage": ".types", + "PlayHtVoiceModel": ".types", + "PromptInjectionSecurityFilter": ".types", + "ProviderResource": ".types", + "ProviderResourceControllerGetProviderResourcesPaginatedRequestSortOrder": ".provider_resources", + "ProviderResourcePaginatedResponse": ".types", + "PunctuationBoundary": ".types", + "QueryTool": ".types", + "QueryToolMessagesItem": ".types", + "RceSecurityFilter": ".types", + "Recording": ".types", + "RegexCondition": ".types", + "RegexOption": ".types", + "RegexOptionType": ".types", + "RegexReplacement": ".types", + "RegexSecurityFilter": ".types", + "ResponseCompletedEvent": ".types", + "ResponseErrorEvent": ".types", + "ResponseObject": ".types", + "ResponseObjectStatus": ".types", + "ResponseOutputMessage": ".types", + "ResponseOutputMessageStatus": ".types", + "ResponseOutputText": ".types", + "ResponseTextDeltaEvent": ".types", + "ResponseTextDoneEvent": ".types", + "RimeAiCredential": ".types", + "RimeAiVoice": ".types", + "RimeAiVoiceId": ".types", + "RimeAiVoiceIdEnum": ".types", + "RimeAiVoiceModel": ".types", + "RunpodCredential": ".types", + "S3Credential": ".types", + "SayAssistantHookAction": ".types", + "SayHookAction": ".types", + "SayHookActionPrompt": ".types", + "SayHookActionPromptItem": ".types", + "SayPhoneNumberHookAction": ".types", + "SbcConfiguration": ".types", + "SchedulePlan": ".types", + "SecurityFilterBase": ".types", + "SecurityFilterPlan": ".types", + "SecurityFilterPlanMode": ".types", + "Server": ".types", + "ServerMessage": ".types", + "ServerMessageAssistantRequest": ".types", + "ServerMessageAssistantRequestPhoneNumber": ".types", + "ServerMessageCallEndpointingRequest": ".types", + "ServerMessageCallEndpointingRequestMessagesItem": ".types", + "ServerMessageCallEndpointingRequestPhoneNumber": ".types", + "ServerMessageChatCreated": ".types", + "ServerMessageChatCreatedPhoneNumber": ".types", + "ServerMessageChatDeleted": ".types", + "ServerMessageChatDeletedPhoneNumber": ".types", + "ServerMessageConversationUpdate": ".types", + "ServerMessageConversationUpdateMessagesItem": ".types", + "ServerMessageConversationUpdatePhoneNumber": ".types", + "ServerMessageEndOfCallReport": ".types", + "ServerMessageEndOfCallReportCostsItem": ".types", + "ServerMessageEndOfCallReportEndedReason": ".types", + "ServerMessageEndOfCallReportPhoneNumber": ".types", + "ServerMessageHang": ".types", + "ServerMessageHangPhoneNumber": ".types", + "ServerMessageKnowledgeBaseRequest": ".types", + "ServerMessageKnowledgeBaseRequestMessagesItem": ".types", + "ServerMessageKnowledgeBaseRequestPhoneNumber": ".types", + "ServerMessageLanguageChangeDetected": ".types", + "ServerMessageLanguageChangeDetectedPhoneNumber": ".types", + "ServerMessageMessage": ".types", + "ServerMessageModelOutput": ".types", + "ServerMessageModelOutputPhoneNumber": ".types", + "ServerMessagePhoneCallControl": ".types", + "ServerMessagePhoneCallControlDestination": ".types", + "ServerMessagePhoneCallControlPhoneNumber": ".types", + "ServerMessagePhoneCallControlRequest": ".types", + "ServerMessageResponse": ".types", + "ServerMessageResponseAssistantRequest": ".types", + "ServerMessageResponseAssistantRequestDestination": ".types", + "ServerMessageResponseCallEndpointingRequest": ".types", + "ServerMessageResponseHandoffDestinationRequest": ".types", + "ServerMessageResponseKnowledgeBaseRequest": ".types", + "ServerMessageResponseMessageResponse": ".types", + "ServerMessageResponseToolCalls": ".types", + "ServerMessageResponseTransferDestinationRequest": ".types", + "ServerMessageResponseTransferDestinationRequestDestination": ".types", + "ServerMessageResponseTransferDestinationRequestMessage": ".types", + "ServerMessageResponseVoiceRequest": ".types", + "ServerMessageSessionCreated": ".types", + "ServerMessageSessionCreatedPhoneNumber": ".types", + "ServerMessageSessionDeleted": ".types", + "ServerMessageSessionDeletedPhoneNumber": ".types", + "ServerMessageSessionUpdated": ".types", + "ServerMessageSessionUpdatedPhoneNumber": ".types", + "ServerMessageSpeechUpdate": ".types", + "ServerMessageSpeechUpdatePhoneNumber": ".types", + "ServerMessageSpeechUpdateRole": ".types", + "ServerMessageSpeechUpdateStatus": ".types", + "ServerMessageStatusUpdate": ".types", + "ServerMessageStatusUpdateDestination": ".types", + "ServerMessageStatusUpdateEndedReason": ".types", + "ServerMessageStatusUpdateMessagesItem": ".types", + "ServerMessageStatusUpdatePhoneNumber": ".types", + "ServerMessageStatusUpdateStatus": ".types", + "ServerMessageToolCalls": ".types", + "ServerMessageToolCallsPhoneNumber": ".types", + "ServerMessageToolCallsToolWithToolCallListItem": ".types", + "ServerMessageTranscript": ".types", + "ServerMessageTranscriptPhoneNumber": ".types", + "ServerMessageTranscriptRole": ".types", + "ServerMessageTranscriptTranscriptType": ".types", + "ServerMessageTranscriptType": ".types", + "ServerMessageTransferDestinationRequest": ".types", + "ServerMessageTransferDestinationRequestPhoneNumber": ".types", + "ServerMessageTransferUpdate": ".types", + "ServerMessageTransferUpdateDestination": ".types", + "ServerMessageTransferUpdatePhoneNumber": ".types", + "ServerMessageUserInterrupted": ".types", + "ServerMessageUserInterruptedPhoneNumber": ".types", + "ServerMessageVoiceInput": ".types", + "ServerMessageVoiceInputPhoneNumber": ".types", + "ServerMessageVoiceRequest": ".types", + "ServerMessageVoiceRequestPhoneNumber": ".types", + "SesameVoice": ".types", + "Session": ".types", + "SessionMessagesItem": ".types", + "SessionPaginatedResponse": ".types", + "SessionStatus": ".types", + "SessionsListRequestSortOrder": ".sessions", + "SipAuthentication": ".types", + "SipTrunkGateway": ".types", + "SipTrunkGatewayOutboundProtocol": ".types", + "SipTrunkOutboundAuthenticationPlan": ".types", + "SipTrunkOutboundSipRegisterPlan": ".types", + "SlackOAuth2AuthorizationCredential": ".types", + "SlackSendMessageTool": ".types", + "SlackSendMessageToolMessagesItem": ".types", + "SmallestAiCredential": ".types", + "SmallestAiVoice": ".types", + "SmallestAiVoiceId": ".types", + "SmallestAiVoiceIdEnum": ".types", + "SmartDenoisingPlan": ".types", + "SmsTool": ".types", + "SmsToolMessagesItem": ".types", + "SpeechmaticsCredential": ".types", + "SpeechmaticsTranscriber": ".types", + "SpeechmaticsTranscriberLanguage": ".types", + "SqlInjectionSecurityFilter": ".types", + "Squad": ".types", + "SquadMemberDto": ".types", + "SquadMemberDtoAssistantDestinationsItem": ".types", + "SsrfSecurityFilter": ".types", + "StartSpeakingPlan": ".types", + "StartSpeakingPlanCustomEndpointingRulesItem": ".types", + "StartSpeakingPlanSmartEndpointingEnabled": ".types", + "StartSpeakingPlanSmartEndpointingPlan": ".types", + "StopSpeakingPlan": ".types", + "StructuredDataMultiPlan": ".types", + "StructuredDataPlan": ".types", + "StructuredOutput": ".types", + "StructuredOutputControllerFindAllRequestSortOrder": ".structured_outputs", + "StructuredOutputModel": ".types", + "StructuredOutputPaginatedResponse": ".types", + "Subscription": ".types", + "SubscriptionMinutesIncludedResetFrequency": ".types", + "SubscriptionStatus": ".types", + "SubscriptionType": ".types", + "SuccessEvaluationPlan": ".types", + "SuccessEvaluationPlanRubric": ".types", + "SummaryPlan": ".types", + "SupabaseBucketPlan": ".types", + "SupabaseBucketPlanRegion": ".types", + "SupabaseCredential": ".types", + "SyncVoiceLibraryDto": ".types", + "SyncVoiceLibraryDtoProvidersItem": ".types", + "SystemMessage": ".types", + "TalkscriberTranscriber": ".types", + "TalkscriberTranscriberLanguage": ".types", + "TargetPlan": ".types", + "TavusConversationProperties": ".types", + "TavusCredential": ".types", + "TavusVoice": ".types", + "TavusVoiceVoiceId": ".types", + "TelnyxPhoneNumber": ".types", + "TelnyxPhoneNumberFallbackDestination": ".types", + "TelnyxPhoneNumberHooksItem": ".types", + "TelnyxPhoneNumberStatus": ".types", + "Template": ".types", + "TemplateDetails": ".types", + "TemplateProvider": ".types", + "TemplateProviderDetails": ".types", + "TemplateVisibility": ".types", + "TestSuite": ".types", + "TestSuitePhoneNumber": ".types", + "TestSuiteRun": ".types", + "TestSuiteRunScorerAi": ".types", + "TestSuiteRunScorerAiResult": ".types", + "TestSuiteRunStatus": ".types", + "TestSuiteRunTestAttempt": ".types", + "TestSuiteRunTestAttemptCall": ".types", + "TestSuiteRunTestAttemptMetadata": ".types", + "TestSuiteRunTestResult": ".types", + "TestSuiteRunsPaginatedResponse": ".types", + "TestSuiteTestChat": ".types", + "TestSuiteTestScorerAi": ".types", + "TestSuiteTestVoice": ".types", + "TestSuiteTestsPaginatedResponse": ".types", + "TestSuiteTestsPaginatedResponseResultsItem": ".types", + "TestSuitesPaginatedResponse": ".types", + "TesterPlan": ".types", + "TextContent": ".types", + "TextContentLanguage": ".types", + "TextEditorTool": ".types", + "TextEditorToolMessagesItem": ".types", + "TextEditorToolWithToolCall": ".types", + "TextEditorToolWithToolCallMessagesItem": ".types", + "TimeRange": ".types", + "TimeRangeStep": ".types", + "TogetherAiCredential": ".types", + "TogetherAiModel": ".types", + "TogetherAiModelToolsItem": ".types", + "Token": ".types", + "TokenRestrictions": ".types", + "TokenTag": ".types", + "ToolCall": ".types", + "ToolCallFunction": ".types", + "ToolCallHookAction": ".types", + "ToolCallHookActionTool": ".types", + "ToolCallMessage": ".types", + "ToolCallResult": ".types", + "ToolCallResultMessage": ".types", + "ToolMessage": ".types", + "ToolMessageComplete": ".types", + "ToolMessageCompleteRole": ".types", + "ToolMessageDelayed": ".types", + "ToolMessageFailed": ".types", + "ToolMessageStart": ".types", + "ToolNode": ".types", + "ToolNodeTool": ".types", + "ToolRejectionPlan": ".types", + "ToolRejectionPlanConditionsItem": ".types", + "ToolTemplateMetadata": ".types", + "ToolTemplateSetup": ".types", + "ToolsCreateRequest": ".tools", + "ToolsCreateResponse": ".tools", + "ToolsDeleteResponse": ".tools", + "ToolsGetResponse": ".tools", + "ToolsListResponseItem": ".tools", + "ToolsUpdateRequest": ".tools", + "ToolsUpdateResponse": ".tools", + "TranscriberCost": ".types", + "TranscriptPlan": ".types", + "TranscriptionEndpointingPlan": ".types", + "TransferAssistant": ".types", + "TransferAssistantFirstMessageMode": ".types", + "TransferAssistantHookAction": ".types", + "TransferAssistantModel": ".types", + "TransferAssistantModelProvider": ".types", + "TransferCallTool": ".types", + "TransferCallToolDestinationsItem": ".types", + "TransferCallToolMessagesItem": ".types", + "TransferCancelToolUserEditable": ".types", + "TransferCancelToolUserEditableMessagesItem": ".types", + "TransferDestinationAssistant": ".types", + "TransferDestinationAssistantMessage": ".types", + "TransferDestinationNumber": ".types", + "TransferDestinationNumberMessage": ".types", + "TransferDestinationSip": ".types", + "TransferDestinationSipMessage": ".types", + "TransferFallbackPlan": ".types", + "TransferFallbackPlanMessage": ".types", + "TransferHookAction": ".types", + "TransferHookActionDestination": ".types", + "TransferMode": ".types", + "TransferPhoneNumberHookAction": ".types", + "TransferPhoneNumberHookActionDestination": ".types", + "TransferPlan": ".types", + "TransferPlanMessage": ".types", + "TransferPlanMode": ".types", + "TransferSuccessfulToolUserEditable": ".types", + "TransferSuccessfulToolUserEditableMessagesItem": ".types", + "TransportConfigurationTwilio": ".types", + "TransportConfigurationTwilioRecordingChannels": ".types", + "TransportCost": ".types", + "TransportCostProvider": ".types", + "TrieveCredential": ".types", + "TrieveKnowledgeBase": ".types", + "TrieveKnowledgeBaseChunkPlan": ".types", + "TrieveKnowledgeBaseCreate": ".types", + "TrieveKnowledgeBaseImport": ".types", + "TrieveKnowledgeBaseSearchPlan": ".types", + "TrieveKnowledgeBaseSearchPlanSearchType": ".types", + "TurnLatency": ".types", + "TwilioCredential": ".types", + "TwilioPhoneNumber": ".types", + "TwilioPhoneNumberFallbackDestination": ".types", + "TwilioPhoneNumberHooksItem": ".types", + "TwilioPhoneNumberStatus": ".types", + "TwilioVoicemailDetectionPlan": ".types", + "TwilioVoicemailDetectionPlanVoicemailDetectionTypesItem": ".types", + "UpdateAnthropicCredentialDto": ".types", + "UpdateAnyscaleCredentialDto": ".types", + "UpdateApiRequestToolDto": ".types", + "UpdateApiRequestToolDtoMessagesItem": ".types", + "UpdateApiRequestToolDtoMethod": ".types", + "UpdateAssemblyAiCredentialDto": ".types", + "UpdateAssistantDtoBackgroundSound": ".assistants", + "UpdateAssistantDtoBackgroundSoundZero": ".assistants", + "UpdateAssistantDtoClientMessagesItem": ".assistants", + "UpdateAssistantDtoCredentialsItem": ".assistants", + "UpdateAssistantDtoFirstMessageMode": ".assistants", + "UpdateAssistantDtoHooksItem": ".assistants", + "UpdateAssistantDtoModel": ".assistants", + "UpdateAssistantDtoServerMessagesItem": ".assistants", + "UpdateAssistantDtoTranscriber": ".assistants", + "UpdateAssistantDtoVoice": ".assistants", + "UpdateAssistantDtoVoicemailDetection": ".assistants", + "UpdateAzureCredentialDto": ".types", + "UpdateAzureCredentialDtoRegion": ".types", + "UpdateAzureCredentialDtoService": ".types", + "UpdateAzureOpenAiCredentialDto": ".types", + "UpdateAzureOpenAiCredentialDtoModelsItem": ".types", + "UpdateAzureOpenAiCredentialDtoRegion": ".types", + "UpdateBashToolDto": ".types", + "UpdateBashToolDtoMessagesItem": ".types", + "UpdateByoPhoneNumberDto": ".types", + "UpdateByoPhoneNumberDtoFallbackDestination": ".types", + "UpdateByoPhoneNumberDtoHooksItem": ".types", + "UpdateByoSipTrunkCredentialDto": ".types", + "UpdateCartesiaCredentialDto": ".types", + "UpdateCerebrasCredentialDto": ".types", + "UpdateCloudflareCredentialDto": ".types", + "UpdateComputerToolDto": ".types", + "UpdateComputerToolDtoMessagesItem": ".types", + "UpdateCustomCredentialDto": ".types", + "UpdateCustomCredentialDtoAuthenticationPlan": ".types", + "UpdateCustomKnowledgeBaseDto": ".types", + "UpdateCustomLlmCredentialDto": ".types", + "UpdateDeepInfraCredentialDto": ".types", + "UpdateDeepSeekCredentialDto": ".types", + "UpdateDeepgramCredentialDto": ".types", + "UpdateDtmfToolDto": ".types", + "UpdateDtmfToolDtoMessagesItem": ".types", + "UpdateElevenLabsCredentialDto": ".types", + "UpdateEndCallToolDto": ".types", + "UpdateEndCallToolDtoMessagesItem": ".types", + "UpdateFunctionToolDto": ".types", + "UpdateFunctionToolDtoMessagesItem": ".types", + "UpdateGcpCredentialDto": ".types", + "UpdateGhlToolDto": ".types", + "UpdateGhlToolDtoMessagesItem": ".types", + "UpdateGladiaCredentialDto": ".types", + "UpdateGoHighLevelCalendarAvailabilityToolDto": ".types", + "UpdateGoHighLevelCalendarAvailabilityToolDtoMessagesItem": ".types", + "UpdateGoHighLevelCalendarEventCreateToolDto": ".types", + "UpdateGoHighLevelCalendarEventCreateToolDtoMessagesItem": ".types", + "UpdateGoHighLevelContactCreateToolDto": ".types", + "UpdateGoHighLevelContactCreateToolDtoMessagesItem": ".types", + "UpdateGoHighLevelContactGetToolDto": ".types", + "UpdateGoHighLevelContactGetToolDtoMessagesItem": ".types", + "UpdateGoHighLevelCredentialDto": ".types", + "UpdateGoHighLevelMcpCredentialDto": ".types", + "UpdateGoogleCalendarCheckAvailabilityToolDto": ".types", + "UpdateGoogleCalendarCheckAvailabilityToolDtoMessagesItem": ".types", + "UpdateGoogleCalendarCreateEventToolDto": ".types", + "UpdateGoogleCalendarCreateEventToolDtoMessagesItem": ".types", + "UpdateGoogleCalendarOAuth2AuthorizationCredentialDto": ".types", + "UpdateGoogleCalendarOAuth2ClientCredentialDto": ".types", + "UpdateGoogleCredentialDto": ".types", + "UpdateGoogleSheetsOAuth2AuthorizationCredentialDto": ".types", + "UpdateGoogleSheetsRowAppendToolDto": ".types", + "UpdateGoogleSheetsRowAppendToolDtoMessagesItem": ".types", + "UpdateGroqCredentialDto": ".types", + "UpdateHandoffToolDto": ".types", + "UpdateHandoffToolDtoDestinationsItem": ".types", + "UpdateHandoffToolDtoMessagesItem": ".types", + "UpdateHumeCredentialDto": ".types", + "UpdateInflectionAiCredentialDto": ".types", + "UpdateInworldCredentialDto": ".types", + "UpdateLangfuseCredentialDto": ".types", + "UpdateLmntCredentialDto": ".types", + "UpdateMakeCredentialDto": ".types", + "UpdateMakeToolDto": ".types", + "UpdateMakeToolDtoMessagesItem": ".types", + "UpdateMcpToolDto": ".types", + "UpdateMcpToolDtoMessagesItem": ".types", + "UpdateMistralCredentialDto": ".types", + "UpdateNeuphonicCredentialDto": ".types", + "UpdateOpenAiCredentialDto": ".types", + "UpdateOpenRouterCredentialDto": ".types", + "UpdateOrgDto": ".types", + "UpdateOrgDtoChannel": ".types", + "UpdateOutputToolDto": ".types", + "UpdateOutputToolDtoMessagesItem": ".types", + "UpdatePerplexityAiCredentialDto": ".types", + "UpdatePlayHtCredentialDto": ".types", + "UpdateQueryToolDto": ".types", + "UpdateQueryToolDtoMessagesItem": ".types", + "UpdateRimeAiCredentialDto": ".types", + "UpdateRunpodCredentialDto": ".types", + "UpdateS3CredentialDto": ".types", + "UpdateSessionDtoMessagesItem": ".sessions", + "UpdateSessionDtoStatus": ".sessions", + "UpdateSlackOAuth2AuthorizationCredentialDto": ".types", + "UpdateSlackSendMessageToolDto": ".types", + "UpdateSlackSendMessageToolDtoMessagesItem": ".types", + "UpdateSmallestAiCredentialDto": ".types", + "UpdateSmsToolDto": ".types", + "UpdateSmsToolDtoMessagesItem": ".types", + "UpdateSpeechmaticsCredentialDto": ".types", + "UpdateStructuredOutputDtoModel": ".structured_outputs", + "UpdateSupabaseCredentialDto": ".types", + "UpdateTavusCredentialDto": ".types", + "UpdateTelnyxPhoneNumberDto": ".types", + "UpdateTelnyxPhoneNumberDtoFallbackDestination": ".types", + "UpdateTelnyxPhoneNumberDtoHooksItem": ".types", + "UpdateTestSuiteDto": ".types", + "UpdateTestSuiteRunDto": ".types", + "UpdateTestSuiteTestChatDto": ".types", + "UpdateTestSuiteTestVoiceDto": ".types", + "UpdateTextEditorToolDto": ".types", + "UpdateTextEditorToolDtoMessagesItem": ".types", + "UpdateTogetherAiCredentialDto": ".types", + "UpdateTokenDto": ".types", + "UpdateTokenDtoTag": ".types", + "UpdateToolTemplateDto": ".types", + "UpdateToolTemplateDtoDetails": ".types", + "UpdateToolTemplateDtoProvider": ".types", + "UpdateToolTemplateDtoProviderDetails": ".types", + "UpdateToolTemplateDtoVisibility": ".types", + "UpdateTransferCallToolDto": ".types", + "UpdateTransferCallToolDtoDestinationsItem": ".types", + "UpdateTransferCallToolDtoMessagesItem": ".types", + "UpdateTrieveCredentialDto": ".types", + "UpdateTrieveKnowledgeBaseDto": ".types", + "UpdateTwilioCredentialDto": ".types", + "UpdateTwilioPhoneNumberDto": ".types", + "UpdateTwilioPhoneNumberDtoFallbackDestination": ".types", + "UpdateTwilioPhoneNumberDtoHooksItem": ".types", + "UpdateUserRoleDto": ".types", + "UpdateUserRoleDtoRole": ".types", + "UpdateVapiPhoneNumberDto": ".types", + "UpdateVapiPhoneNumberDtoFallbackDestination": ".types", + "UpdateVapiPhoneNumberDtoHooksItem": ".types", + "UpdateVonageCredentialDto": ".types", + "UpdateVonagePhoneNumberDto": ".types", + "UpdateVonagePhoneNumberDtoFallbackDestination": ".types", + "UpdateVonagePhoneNumberDtoHooksItem": ".types", + "UpdateWebhookCredentialDto": ".types", + "UpdateWebhookCredentialDtoAuthenticationPlan": ".types", + "UpdateWorkflowDto": ".types", + "UpdateWorkflowDtoBackgroundSound": ".types", + "UpdateWorkflowDtoBackgroundSoundZero": ".types", + "UpdateWorkflowDtoCredentialsItem": ".types", + "UpdateWorkflowDtoHooksItem": ".types", + "UpdateWorkflowDtoModel": ".types", + "UpdateWorkflowDtoNodesItem": ".types", + "UpdateWorkflowDtoTranscriber": ".types", + "UpdateWorkflowDtoVoice": ".types", + "UpdateXAiCredentialDto": ".types", + "User": ".types", + "UserMessage": ".types", + "Vapi": ".client", + "VapiCost": ".types", + "VapiCostSubType": ".types", + "VapiEnvironment": ".environment", + "VapiModel": ".types", + "VapiModelToolsItem": ".types", + "VapiPhoneNumber": ".types", + "VapiPhoneNumberFallbackDestination": ".types", + "VapiPhoneNumberHooksItem": ".types", + "VapiPhoneNumberStatus": ".types", + "VapiSmartEndpointingPlan": ".types", + "VapiSmartEndpointingPlanProvider": ".types", + "VapiVoice": ".types", + "VapiVoiceVoiceId": ".types", + "VapiVoicemailDetectionPlan": ".types", + "VapiVoicemailDetectionPlanType": ".types", + "VariableExtractionAlias": ".types", + "VariableExtractionPlan": ".types", + "VoiceCost": ".types", + "VoiceLibrary": ".types", + "VoiceLibraryGender": ".types", + "VoiceLibraryVoiceResponse": ".types", + "VoicemailDetectionBackoffPlan": ".types", + "VoicemailDetectionCost": ".types", + "VoicemailDetectionCostProvider": ".types", + "VonageCredential": ".types", + "VonagePhoneNumber": ".types", + "VonagePhoneNumberFallbackDestination": ".types", + "VonagePhoneNumberHooksItem": ".types", + "VonagePhoneNumberStatus": ".types", + "WebChat": ".types", + "WebChatOutputItem": ".types", + "WebhookCredential": ".types", + "WebhookCredentialAuthenticationPlan": ".types", + "Workflow": ".types", + "WorkflowAnthropicModel": ".types", + "WorkflowAnthropicModelModel": ".types", + "WorkflowBackgroundSound": ".types", + "WorkflowBackgroundSoundZero": ".types", + "WorkflowCredentialsItem": ".types", + "WorkflowCustomModel": ".types", + "WorkflowCustomModelMetadataSendMode": ".types", + "WorkflowGoogleModel": ".types", + "WorkflowGoogleModelModel": ".types", + "WorkflowHooksItem": ".types", + "WorkflowModel": ".types", + "WorkflowNodesItem": ".types", + "WorkflowOpenAiModel": ".types", + "WorkflowOpenAiModelModel": ".types", + "WorkflowOverrides": ".types", + "WorkflowTranscriber": ".types", + "WorkflowUserEditable": ".types", + "WorkflowUserEditableBackgroundSound": ".types", + "WorkflowUserEditableBackgroundSoundZero": ".types", + "WorkflowUserEditableCredentialsItem": ".types", + "WorkflowUserEditableHooksItem": ".types", + "WorkflowUserEditableModel": ".types", + "WorkflowUserEditableNodesItem": ".types", + "WorkflowUserEditableTranscriber": ".types", + "WorkflowUserEditableVoice": ".types", + "WorkflowVoice": ".types", + "XAiCredential": ".types", + "XaiModel": ".types", + "XaiModelModel": ".types", + "XaiModelToolsItem": ".types", + "XssSecurityFilter": ".types", + "__version__": ".version", + "analytics": ".", + "assistants": ".", + "calls": ".", + "campaigns": ".", + "chats": ".", + "files": ".", + "phone_numbers": ".", + "provider_resources": ".", + "sessions": ".", + "squads": ".", + "structured_outputs": ".", + "tools": ".", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + __all__ = [ - "Vapi", + "AddVoiceToProviderDto", + "AiEdgeCondition", + "Analysis", + "AnalysisCost", + "AnalysisCostAnalysisType", + "AnalysisCostBreakdown", + "AnalysisPlan", + "AnalyticsOperation", + "AnalyticsOperationColumn", + "AnalyticsOperationOperation", + "AnalyticsQuery", + "AnalyticsQueryGroupByItem", + "AnalyticsQueryResult", + "AnalyticsQueryTable", + "AnthropicCredential", + "AnthropicModel", + "AnthropicModelModel", + "AnthropicModelToolsItem", + "AnthropicThinkingConfig", + "AnyscaleCredential", + "AnyscaleModel", + "AnyscaleModelToolsItem", + "ApiRequestTool", + "ApiRequestToolMessagesItem", + "ApiRequestToolMethod", + "Artifact", + "ArtifactMessagesItem", + "ArtifactPlan", + "ArtifactPlanRecordingFormat", + "AssemblyAiCredential", + "AssemblyAiTranscriber", + "Assistant", + "AssistantBackgroundSound", + "AssistantBackgroundSoundZero", + "AssistantClientMessagesItem", + "AssistantCredentialsItem", + "AssistantCustomEndpointingRule", + "AssistantFirstMessageMode", + "AssistantHookAssistantSpeechInterrupted", + "AssistantHookCallEnding", + "AssistantHookCustomerSpeechInterrupted", + "AssistantHooksItem", + "AssistantMessage", + "AssistantModel", + "AssistantOverrides", + "AssistantOverridesBackgroundSound", + "AssistantOverridesBackgroundSoundZero", + "AssistantOverridesClientMessagesItem", + "AssistantOverridesCredentialsItem", + "AssistantOverridesFirstMessageMode", + "AssistantOverridesHooksItem", + "AssistantOverridesModel", + "AssistantOverridesServerMessagesItem", + "AssistantOverridesTranscriber", + "AssistantOverridesVoice", + "AssistantOverridesVoicemailDetection", + "AssistantPaginatedResponse", + "AssistantServerMessagesItem", + "AssistantTranscriber", + "AssistantUserEditable", + "AssistantVersionPaginatedResponse", + "AssistantVoice", + "AssistantVoicemailDetection", "AsyncVapi", - "VapiEnvironment" + "AutoReloadPlan", + "AzureBlobStorageBucketPlan", + "AzureCredential", + "AzureCredentialRegion", + "AzureCredentialService", + "AzureOpenAiCredential", + "AzureOpenAiCredentialModelsItem", + "AzureOpenAiCredentialRegion", + "AzureSpeechTranscriber", + "AzureSpeechTranscriberLanguage", + "AzureSpeechTranscriberSegmentationStrategy", + "AzureVoice", + "AzureVoiceId", + "AzureVoiceIdEnum", + "BackgroundSpeechDenoisingPlan", + "BackoffPlan", + "BadRequestError", + "BashTool", + "BashToolMessagesItem", + "BashToolWithToolCall", + "BashToolWithToolCallMessagesItem", + "BearerAuthenticationPlan", + "BotMessage", + "BothCustomEndpointingRule", + "BucketPlan", + "ByoPhoneNumber", + "ByoPhoneNumberFallbackDestination", + "ByoPhoneNumberHooksItem", + "ByoPhoneNumberStatus", + "ByoSipTrunkCredential", + "Call", + "CallBatchError", + "CallBatchResponse", + "CallCostsItem", + "CallDestination", + "CallEndedReason", + "CallHookAssistantSpeechInterrupted", + "CallHookAssistantSpeechInterruptedDoItem", + "CallHookCallEnding", + "CallHookCustomerSpeechInterrupted", + "CallHookCustomerSpeechInterruptedDoItem", + "CallHookCustomerSpeechTimeout", + "CallHookCustomerSpeechTimeoutDoItem", + "CallHookFilter", + "CallMessagesItem", + "CallPaginatedResponse", + "CallPhoneCallProvider", + "CallPhoneCallTransport", + "CallStatus", + "CallType", + "CallsCreateResponse", + "Campaign", + "CampaignControllerFindAllRequestSortOrder", + "CampaignControllerFindAllRequestStatus", + "CampaignEndedReason", + "CampaignPaginatedResponse", + "CampaignStatus", + "CartesiaCredential", + "CartesiaExperimentalControls", + "CartesiaExperimentalControlsEmotion", + "CartesiaExperimentalControlsSpeed", + "CartesiaSpeedControl", + "CartesiaTranscriber", + "CartesiaTranscriberLanguage", + "CartesiaVoice", + "CartesiaVoiceLanguage", + "CartesiaVoiceModel", + "CerebrasCredential", + "CerebrasModel", + "CerebrasModelModel", + "CerebrasModelToolsItem", + "Chat", + "ChatAssistantOverrides", + "ChatCost", + "ChatCostsItem", + "ChatInput", + "ChatInputItem", + "ChatMessagesItem", + "ChatOutputItem", + "ChatPaginatedResponse", + "ChatsCreateResponse", + "ChatsCreateResponseResponse", + "ChatsListRequestSortOrder", + "ChunkPlan", + "ClientInboundMessage", + "ClientInboundMessageAddMessage", + "ClientInboundMessageControl", + "ClientInboundMessageControlControl", + "ClientInboundMessageEndCall", + "ClientInboundMessageMessage", + "ClientInboundMessageSay", + "ClientInboundMessageTransfer", + "ClientInboundMessageTransferDestination", + "ClientMessage", + "ClientMessageChatCreated", + "ClientMessageChatCreatedPhoneNumber", + "ClientMessageChatDeleted", + "ClientMessageChatDeletedPhoneNumber", + "ClientMessageConversationUpdate", + "ClientMessageConversationUpdateMessagesItem", + "ClientMessageConversationUpdatePhoneNumber", + "ClientMessageHang", + "ClientMessageHangPhoneNumber", + "ClientMessageLanguageChangeDetected", + "ClientMessageLanguageChangeDetectedPhoneNumber", + "ClientMessageMessage", + "ClientMessageMetadata", + "ClientMessageMetadataPhoneNumber", + "ClientMessageModelOutput", + "ClientMessageModelOutputPhoneNumber", + "ClientMessageSessionCreated", + "ClientMessageSessionCreatedPhoneNumber", + "ClientMessageSessionDeleted", + "ClientMessageSessionDeletedPhoneNumber", + "ClientMessageSessionUpdated", + "ClientMessageSessionUpdatedPhoneNumber", + "ClientMessageSpeechUpdate", + "ClientMessageSpeechUpdatePhoneNumber", + "ClientMessageSpeechUpdateRole", + "ClientMessageSpeechUpdateStatus", + "ClientMessageToolCalls", + "ClientMessageToolCallsPhoneNumber", + "ClientMessageToolCallsResult", + "ClientMessageToolCallsResultPhoneNumber", + "ClientMessageToolCallsToolWithToolCallListItem", + "ClientMessageTranscript", + "ClientMessageTranscriptPhoneNumber", + "ClientMessageTranscriptRole", + "ClientMessageTranscriptTranscriptType", + "ClientMessageTranscriptType", + "ClientMessageTransferUpdate", + "ClientMessageTransferUpdateDestination", + "ClientMessageTransferUpdatePhoneNumber", + "ClientMessageUserInterrupted", + "ClientMessageUserInterruptedPhoneNumber", + "ClientMessageVoiceInput", + "ClientMessageVoiceInputPhoneNumber", + "ClientMessageWorkflowNodeStarted", + "ClientMessageWorkflowNodeStartedPhoneNumber", + "CloneVoiceDto", + "CloudflareCredential", + "CloudflareR2BucketPlan", + "CompliancePlan", + "ComputerTool", + "ComputerToolMessagesItem", + "ComputerToolWithToolCall", + "ComputerToolWithToolCallMessagesItem", + "Condition", + "ConditionOperator", + "ContextEngineeringPlanAll", + "ContextEngineeringPlanLastNMessages", + "ContextEngineeringPlanNone", + "ConversationNode", + "ConversationNodeModel", + "ConversationNodeToolsItem", + "ConversationNodeTranscriber", + "ConversationNodeVoice", + "CostBreakdown", + "CreateAnthropicCredentialDto", + "CreateAnyscaleCredentialDto", + "CreateApiRequestToolDto", + "CreateApiRequestToolDtoMessagesItem", + "CreateApiRequestToolDtoMethod", + "CreateAssemblyAiCredentialDto", + "CreateAssistantDto", + "CreateAssistantDtoBackgroundSound", + "CreateAssistantDtoBackgroundSoundZero", + "CreateAssistantDtoClientMessagesItem", + "CreateAssistantDtoCredentialsItem", + "CreateAssistantDtoFirstMessageMode", + "CreateAssistantDtoHooksItem", + "CreateAssistantDtoModel", + "CreateAssistantDtoServerMessagesItem", + "CreateAssistantDtoTranscriber", + "CreateAssistantDtoVoice", + "CreateAssistantDtoVoicemailDetection", + "CreateAzureCredentialDto", + "CreateAzureCredentialDtoRegion", + "CreateAzureCredentialDtoService", + "CreateAzureOpenAiCredentialDto", + "CreateAzureOpenAiCredentialDtoModelsItem", + "CreateAzureOpenAiCredentialDtoRegion", + "CreateBashToolDto", + "CreateBashToolDtoMessagesItem", + "CreateByoPhoneNumberDto", + "CreateByoPhoneNumberDtoFallbackDestination", + "CreateByoPhoneNumberDtoHooksItem", + "CreateByoSipTrunkCredentialDto", + "CreateCartesiaCredentialDto", + "CreateCerebrasCredentialDto", + "CreateChatDtoInput", + "CreateChatDtoInputItem", + "CreateChatStreamResponse", + "CreateCloudflareCredentialDto", + "CreateComputerToolDto", + "CreateComputerToolDtoMessagesItem", + "CreateCustomCredentialDto", + "CreateCustomCredentialDtoAuthenticationPlan", + "CreateCustomKnowledgeBaseDto", + "CreateCustomLlmCredentialDto", + "CreateCustomerDto", + "CreateDeepInfraCredentialDto", + "CreateDeepSeekCredentialDto", + "CreateDeepgramCredentialDto", + "CreateDtmfToolDto", + "CreateDtmfToolDtoMessagesItem", + "CreateElevenLabsCredentialDto", + "CreateEndCallToolDto", + "CreateEndCallToolDtoMessagesItem", + "CreateFunctionToolDto", + "CreateFunctionToolDtoMessagesItem", + "CreateGcpCredentialDto", + "CreateGhlToolDto", + "CreateGhlToolDtoMessagesItem", + "CreateGladiaCredentialDto", + "CreateGoHighLevelCalendarAvailabilityToolDto", + "CreateGoHighLevelCalendarAvailabilityToolDtoMessagesItem", + "CreateGoHighLevelCalendarEventCreateToolDto", + "CreateGoHighLevelCalendarEventCreateToolDtoMessagesItem", + "CreateGoHighLevelContactCreateToolDto", + "CreateGoHighLevelContactCreateToolDtoMessagesItem", + "CreateGoHighLevelContactGetToolDto", + "CreateGoHighLevelContactGetToolDtoMessagesItem", + "CreateGoHighLevelCredentialDto", + "CreateGoHighLevelMcpCredentialDto", + "CreateGoogleCalendarCheckAvailabilityToolDto", + "CreateGoogleCalendarCheckAvailabilityToolDtoMessagesItem", + "CreateGoogleCalendarCreateEventToolDto", + "CreateGoogleCalendarCreateEventToolDtoMessagesItem", + "CreateGoogleCalendarOAuth2AuthorizationCredentialDto", + "CreateGoogleCalendarOAuth2ClientCredentialDto", + "CreateGoogleCredentialDto", + "CreateGoogleSheetsOAuth2AuthorizationCredentialDto", + "CreateGoogleSheetsRowAppendToolDto", + "CreateGoogleSheetsRowAppendToolDtoMessagesItem", + "CreateGroqCredentialDto", + "CreateHandoffToolDto", + "CreateHandoffToolDtoDestinationsItem", + "CreateHandoffToolDtoMessagesItem", + "CreateHumeCredentialDto", + "CreateInflectionAiCredentialDto", + "CreateInworldCredentialDto", + "CreateLangfuseCredentialDto", + "CreateLmntCredentialDto", + "CreateMakeCredentialDto", + "CreateMakeToolDto", + "CreateMakeToolDtoMessagesItem", + "CreateMcpToolDto", + "CreateMcpToolDtoMessagesItem", + "CreateMinimaxCredentialDto", + "CreateMistralCredentialDto", + "CreateNeuphonicCredentialDto", + "CreateOpenAiCredentialDto", + "CreateOpenRouterCredentialDto", + "CreateOrgDto", + "CreateOrgDtoChannel", + "CreateOutboundCallDto", + "CreateOutputToolDto", + "CreateOutputToolDtoMessagesItem", + "CreatePerplexityAiCredentialDto", + "CreatePlayHtCredentialDto", + "CreateQueryToolDto", + "CreateQueryToolDtoMessagesItem", + "CreateRimeAiCredentialDto", + "CreateRunpodCredentialDto", + "CreateS3CredentialDto", + "CreateSesameVoiceDto", + "CreateSessionDtoMessagesItem", + "CreateSessionDtoStatus", + "CreateSlackOAuth2AuthorizationCredentialDto", + "CreateSlackSendMessageToolDto", + "CreateSlackSendMessageToolDtoMessagesItem", + "CreateSmallestAiCredentialDto", + "CreateSmsToolDto", + "CreateSmsToolDtoMessagesItem", + "CreateSpeechmaticsCredentialDto", + "CreateSquadDto", + "CreateStructuredOutputDtoModel", + "CreateSupabaseCredentialDto", + "CreateTavusCredentialDto", + "CreateTelnyxPhoneNumberDto", + "CreateTelnyxPhoneNumberDtoFallbackDestination", + "CreateTelnyxPhoneNumberDtoHooksItem", + "CreateTestSuiteDto", + "CreateTestSuiteRunDto", + "CreateTestSuiteTestChatDto", + "CreateTestSuiteTestVoiceDto", + "CreateTextEditorToolDto", + "CreateTextEditorToolDtoMessagesItem", + "CreateTogetherAiCredentialDto", + "CreateTokenDto", + "CreateTokenDtoTag", + "CreateToolTemplateDto", + "CreateToolTemplateDtoDetails", + "CreateToolTemplateDtoProvider", + "CreateToolTemplateDtoProviderDetails", + "CreateToolTemplateDtoVisibility", + "CreateTransferCallToolDto", + "CreateTransferCallToolDtoDestinationsItem", + "CreateTransferCallToolDtoMessagesItem", + "CreateTrieveCredentialDto", + "CreateTrieveKnowledgeBaseDto", + "CreateTwilioCredentialDto", + "CreateTwilioPhoneNumberDto", + "CreateTwilioPhoneNumberDtoFallbackDestination", + "CreateTwilioPhoneNumberDtoHooksItem", + "CreateVapiPhoneNumberDto", + "CreateVapiPhoneNumberDtoFallbackDestination", + "CreateVapiPhoneNumberDtoHooksItem", + "CreateVoicemailToolDto", + "CreateVoicemailToolDtoMessagesItem", + "CreateVonageCredentialDto", + "CreateVonagePhoneNumberDto", + "CreateVonagePhoneNumberDtoFallbackDestination", + "CreateVonagePhoneNumberDtoHooksItem", + "CreateWebCallDto", + "CreateWebChatDto", + "CreateWebChatDtoInput", + "CreateWebChatDtoInputItem", + "CreateWebCustomerDto", + "CreateWebhookCredentialDto", + "CreateWebhookCredentialDtoAuthenticationPlan", + "CreateWorkflowDto", + "CreateWorkflowDtoBackgroundSound", + "CreateWorkflowDtoBackgroundSoundZero", + "CreateWorkflowDtoCredentialsItem", + "CreateWorkflowDtoHooksItem", + "CreateWorkflowDtoModel", + "CreateWorkflowDtoNodesItem", + "CreateWorkflowDtoTranscriber", + "CreateWorkflowDtoVoice", + "CreateXAiCredentialDto", + "CredentialActionRequest", + "CredentialEndUser", + "CredentialSessionDto", + "CredentialSessionDtoProvider", + "CredentialSessionError", + "CredentialSessionResponse", + "CredentialWebhookDto", + "CredentialWebhookDtoAuthMode", + "CredentialWebhookDtoOperation", + "CredentialWebhookDtoType", + "CustomCredential", + "CustomCredentialAuthenticationPlan", + "CustomEndpointingModelSmartEndpointingPlan", + "CustomEndpointingModelSmartEndpointingPlanProvider", + "CustomKnowledgeBase", + "CustomLlmCredential", + "CustomLlmModel", + "CustomLlmModelMetadataSendMode", + "CustomLlmModelToolsItem", + "CustomMessage", + "CustomTranscriber", + "CustomVoice", + "CustomerCustomEndpointingRule", + "CustomerSpeechTimeoutOptions", + "DeepInfraCredential", + "DeepInfraModel", + "DeepInfraModelToolsItem", + "DeepSeekCredential", + "DeepSeekModel", + "DeepSeekModelModel", + "DeepSeekModelToolsItem", + "DeepgramCredential", + "DeepgramTranscriber", + "DeepgramTranscriberLanguage", + "DeepgramTranscriberModel", + "DeepgramVoice", + "DeepgramVoiceId", + "DeepgramVoiceModel", + "DeveloperMessage", + "DtmfTool", + "DtmfToolMessagesItem", + "Edge", + "ElevenLabsCredential", + "ElevenLabsPronunciationDictionary", + "ElevenLabsPronunciationDictionaryLocator", + "ElevenLabsPronunciationDictionaryPermissionOnResource", + "ElevenLabsTranscriber", + "ElevenLabsTranscriberLanguage", + "ElevenLabsVoice", + "ElevenLabsVoiceId", + "ElevenLabsVoiceIdEnum", + "ElevenLabsVoiceModel", + "EndCallTool", + "EndCallToolMessagesItem", + "ExactReplacement", + "FailedEdgeCondition", + "FallbackAssemblyAiTranscriber", + "FallbackAzureSpeechTranscriber", + "FallbackAzureSpeechTranscriberLanguage", + "FallbackAzureSpeechTranscriberSegmentationStrategy", + "FallbackAzureVoice", + "FallbackAzureVoiceId", + "FallbackAzureVoiceVoiceId", + "FallbackCartesiaTranscriber", + "FallbackCartesiaTranscriberLanguage", + "FallbackCartesiaVoice", + "FallbackCartesiaVoiceLanguage", + "FallbackCartesiaVoiceModel", + "FallbackCustomTranscriber", + "FallbackCustomVoice", + "FallbackDeepgramTranscriber", + "FallbackDeepgramTranscriberLanguage", + "FallbackDeepgramTranscriberModel", + "FallbackDeepgramVoice", + "FallbackDeepgramVoiceId", + "FallbackDeepgramVoiceModel", + "FallbackElevenLabsTranscriber", + "FallbackElevenLabsTranscriberLanguage", + "FallbackElevenLabsVoice", + "FallbackElevenLabsVoiceId", + "FallbackElevenLabsVoiceIdEnum", + "FallbackElevenLabsVoiceModel", + "FallbackGladiaTranscriber", + "FallbackGladiaTranscriberLanguage", + "FallbackGladiaTranscriberLanguageBehaviour", + "FallbackGladiaTranscriberLanguages", + "FallbackGladiaTranscriberModel", + "FallbackGoogleTranscriber", + "FallbackGoogleTranscriberLanguage", + "FallbackGoogleTranscriberModel", + "FallbackHumeVoice", + "FallbackInworldVoice", + "FallbackInworldVoiceLanguageCode", + "FallbackInworldVoiceVoiceId", + "FallbackLmntVoice", + "FallbackLmntVoiceId", + "FallbackLmntVoiceIdEnum", + "FallbackLmntVoiceLanguage", + "FallbackMinimaxVoice", + "FallbackMinimaxVoiceModel", + "FallbackMinimaxVoiceRegion", + "FallbackNeetsVoice", + "FallbackNeuphonicVoice", + "FallbackNeuphonicVoiceModel", + "FallbackOpenAiTranscriber", + "FallbackOpenAiTranscriberLanguage", + "FallbackOpenAiTranscriberModel", + "FallbackOpenAiVoice", + "FallbackOpenAiVoiceId", + "FallbackOpenAiVoiceIdEnum", + "FallbackOpenAiVoiceModel", + "FallbackPlan", + "FallbackPlanVoicesItem", + "FallbackPlayHtVoice", + "FallbackPlayHtVoiceEmotion", + "FallbackPlayHtVoiceId", + "FallbackPlayHtVoiceIdEnum", + "FallbackPlayHtVoiceLanguage", + "FallbackPlayHtVoiceModel", + "FallbackRimeAiVoice", + "FallbackRimeAiVoiceId", + "FallbackRimeAiVoiceIdEnum", + "FallbackRimeAiVoiceModel", + "FallbackSesameVoice", + "FallbackSmallestAiVoice", + "FallbackSmallestAiVoiceId", + "FallbackSmallestAiVoiceIdEnum", + "FallbackSpeechmaticsTranscriber", + "FallbackSpeechmaticsTranscriberLanguage", + "FallbackTalkscriberTranscriber", + "FallbackTalkscriberTranscriberLanguage", + "FallbackTavusVoice", + "FallbackTavusVoiceVoiceId", + "FallbackTranscriberPlan", + "FallbackTranscriberPlanTranscribersItem", + "FallbackVapiVoice", + "FallbackVapiVoiceVoiceId", + "File", + "FileStatus", + "FormatPlan", + "FormatPlanFormattersEnabledItem", + "FormatPlanReplacementsItem", + "FourierDenoisingPlan", + "FunctionCall", + "FunctionCallAssistantHookAction", + "FunctionCallHookAction", + "FunctionCallHookActionMessagesItem", + "FunctionTool", + "FunctionToolMessagesItem", + "FunctionToolProviderDetails", + "FunctionToolWithToolCall", + "FunctionToolWithToolCallMessagesItem", + "GcpCredential", + "GcpKey", + "GeminiMultimodalLivePrebuiltVoiceConfig", + "GeminiMultimodalLivePrebuiltVoiceConfigVoiceName", + "GeminiMultimodalLiveSpeechConfig", + "GeminiMultimodalLiveVoiceConfig", + "GetChatPaginatedDto", + "GetChatPaginatedDtoSortOrder", + "GetSessionPaginatedDto", + "GetSessionPaginatedDtoSortOrder", + "GhlTool", + "GhlToolMessagesItem", + "GhlToolMetadata", + "GhlToolProviderDetails", + "GhlToolWithToolCall", + "GhlToolWithToolCallMessagesItem", + "GladiaCredential", + "GladiaCustomVocabularyConfigDto", + "GladiaCustomVocabularyConfigDtoVocabularyItem", + "GladiaTranscriber", + "GladiaTranscriberLanguage", + "GladiaTranscriberLanguageBehaviour", + "GladiaTranscriberLanguages", + "GladiaTranscriberModel", + "GladiaVocabularyItemDto", + "GlobalNodePlan", + "GoHighLevelCalendarAvailabilityTool", + "GoHighLevelCalendarAvailabilityToolMessagesItem", + "GoHighLevelCalendarAvailabilityToolProviderDetails", + "GoHighLevelCalendarAvailabilityToolWithToolCall", + "GoHighLevelCalendarAvailabilityToolWithToolCallMessagesItem", + "GoHighLevelCalendarEventCreateTool", + "GoHighLevelCalendarEventCreateToolMessagesItem", + "GoHighLevelCalendarEventCreateToolProviderDetails", + "GoHighLevelCalendarEventCreateToolWithToolCall", + "GoHighLevelCalendarEventCreateToolWithToolCallMessagesItem", + "GoHighLevelContactCreateTool", + "GoHighLevelContactCreateToolMessagesItem", + "GoHighLevelContactCreateToolProviderDetails", + "GoHighLevelContactCreateToolWithToolCall", + "GoHighLevelContactCreateToolWithToolCallMessagesItem", + "GoHighLevelContactGetTool", + "GoHighLevelContactGetToolMessagesItem", + "GoHighLevelContactGetToolProviderDetails", + "GoHighLevelContactGetToolWithToolCall", + "GoHighLevelContactGetToolWithToolCallMessagesItem", + "GoHighLevelCredential", + "GoHighLevelMcpCredential", + "GoogleCalendarCheckAvailabilityTool", + "GoogleCalendarCheckAvailabilityToolMessagesItem", + "GoogleCalendarCreateEventTool", + "GoogleCalendarCreateEventToolMessagesItem", + "GoogleCalendarCreateEventToolProviderDetails", + "GoogleCalendarCreateEventToolWithToolCall", + "GoogleCalendarCreateEventToolWithToolCallMessagesItem", + "GoogleCalendarOAuth2AuthorizationCredential", + "GoogleCalendarOAuth2ClientCredential", + "GoogleCredential", + "GoogleModel", + "GoogleModelModel", + "GoogleModelToolsItem", + "GoogleRealtimeConfig", + "GoogleSheetsOAuth2AuthorizationCredential", + "GoogleSheetsRowAppendTool", + "GoogleSheetsRowAppendToolMessagesItem", + "GoogleSheetsRowAppendToolProviderDetails", + "GoogleSheetsRowAppendToolWithToolCall", + "GoogleSheetsRowAppendToolWithToolCallMessagesItem", + "GoogleTranscriber", + "GoogleTranscriberLanguage", + "GoogleTranscriberModel", + "GoogleVoicemailDetectionPlan", + "GoogleVoicemailDetectionPlanType", + "GroqCredential", + "GroqModel", + "GroqModelModel", + "GroqModelToolsItem", + "GroupCondition", + "GroupConditionConditionsItem", + "GroupConditionOperator", + "HandoffDestinationAssistant", + "HandoffDestinationAssistantContextEngineeringPlan", + "HandoffDestinationDynamic", + "HandoffTool", + "HandoffToolDestinationsItem", + "HandoffToolMessagesItem", + "HangupNode", + "HmacAuthenticationPlan", + "HmacAuthenticationPlanAlgorithm", + "HmacAuthenticationPlanSignatureEncoding", + "HumeCredential", + "HumeVoice", + "ImportTwilioPhoneNumberDto", + "ImportTwilioPhoneNumberDtoFallbackDestination", + "ImportTwilioPhoneNumberDtoHooksItem", + "ImportVonagePhoneNumberDto", + "ImportVonagePhoneNumberDtoFallbackDestination", + "ImportVonagePhoneNumberDtoHooksItem", + "InflectionAiCredential", + "InflectionAiModel", + "InflectionAiModelToolsItem", + "InviteUserDto", + "InviteUserDtoRole", + "InvoicePlan", + "InworldCredential", + "InworldVoice", + "InworldVoiceLanguageCode", + "InworldVoiceVoiceId", + "JsonSchema", + "JsonSchemaFormat", + "JsonSchemaType", + "JwtResponse", + "KeypadInputPlan", + "KeypadInputPlanDelimiters", + "KnowledgeBase", + "KnowledgeBaseCost", + "KnowledgeBaseModel", + "KnowledgeBaseResponseDocument", + "LangfuseCredential", + "LangfuseObservabilityPlan", + "LiquidCondition", + "LivekitSmartEndpointingPlan", + "LivekitSmartEndpointingPlanProvider", + "LmntCredential", + "LmntVoice", + "LmntVoiceId", + "LmntVoiceIdEnum", + "LmntVoiceLanguage", + "LogicEdgeCondition", + "MakeCredential", + "MakeTool", + "MakeToolMessagesItem", + "MakeToolMetadata", + "MakeToolProviderDetails", + "MakeToolWithToolCall", + "MakeToolWithToolCallMessagesItem", + "McpTool", + "McpToolMessagesItem", + "McpToolMetadata", + "McpToolMetadataProtocol", + "MessageTarget", + "MessageTargetRole", + "MinimaxVoice", + "MinimaxVoiceModel", + "MinimaxVoiceRegion", + "MistralCredential", + "ModelCost", + "Monitor", + "MonitorPlan", + "Mono", + "NeetsVoice", + "NeuphonicCredential", + "NeuphonicVoice", + "NeuphonicVoiceModel", + "NodeArtifact", + "NodeArtifactMessagesItem", + "NotFoundError", + "OAuth2AuthenticationPlan", + "Oauth2AuthenticationSession", + "OpenAiCredential", + "OpenAiFunction", + "OpenAiFunctionParameters", + "OpenAiMessage", + "OpenAiMessageRole", + "OpenAiModel", + "OpenAiModelFallbackModelsItem", + "OpenAiModelModel", + "OpenAiModelToolStrictCompatibilityMode", + "OpenAiModelToolsItem", + "OpenAiResponsesRequestInput", + "OpenAiResponsesRequestInputItem", + "OpenAiTranscriber", + "OpenAiTranscriberLanguage", + "OpenAiTranscriberModel", + "OpenAiVoice", + "OpenAiVoiceId", + "OpenAiVoiceIdEnum", + "OpenAiVoiceModel", + "OpenAiVoicemailDetectionPlan", + "OpenAiVoicemailDetectionPlanType", + "OpenAiWebChatRequest", + "OpenAiWebChatRequestInput", + "OpenAiWebChatRequestInputItem", + "OpenRouterCredential", + "OpenRouterModel", + "OpenRouterModelToolsItem", + "Org", + "OrgChannel", + "OutputTool", + "OutputToolMessagesItem", + "PaginationMeta", + "PerformanceMetrics", + "PerplexityAiCredential", + "PerplexityAiModel", + "PerplexityAiModelToolsItem", + "PhoneNumberCallEndingHookFilter", + "PhoneNumberCallEndingHookFilterOneOfItem", + "PhoneNumberHookCallEnding", + "PhoneNumberHookCallEndingDo", + "PhoneNumberHookCallRinging", + "PhoneNumberHookCallRingingDoItem", + "PhoneNumberPaginatedResponse", + "PhoneNumberPaginatedResponseResultsItem", + "PhoneNumbersCreateRequest", + "PhoneNumbersCreateResponse", + "PhoneNumbersDeleteResponse", + "PhoneNumbersGetResponse", + "PhoneNumbersListResponseItem", + "PhoneNumbersUpdateRequest", + "PhoneNumbersUpdateResponse", + "PlayHtCredential", + "PlayHtVoice", + "PlayHtVoiceEmotion", + "PlayHtVoiceId", + "PlayHtVoiceIdEnum", + "PlayHtVoiceLanguage", + "PlayHtVoiceModel", + "PromptInjectionSecurityFilter", + "ProviderResource", + "ProviderResourceControllerGetProviderResourcesPaginatedRequestSortOrder", + "ProviderResourcePaginatedResponse", + "PunctuationBoundary", + "QueryTool", + "QueryToolMessagesItem", + "RceSecurityFilter", + "Recording", + "RegexCondition", + "RegexOption", + "RegexOptionType", + "RegexReplacement", + "RegexSecurityFilter", + "ResponseCompletedEvent", + "ResponseErrorEvent", + "ResponseObject", + "ResponseObjectStatus", + "ResponseOutputMessage", + "ResponseOutputMessageStatus", + "ResponseOutputText", + "ResponseTextDeltaEvent", + "ResponseTextDoneEvent", + "RimeAiCredential", + "RimeAiVoice", + "RimeAiVoiceId", + "RimeAiVoiceIdEnum", + "RimeAiVoiceModel", + "RunpodCredential", + "S3Credential", + "SayAssistantHookAction", + "SayHookAction", + "SayHookActionPrompt", + "SayHookActionPromptItem", + "SayPhoneNumberHookAction", + "SbcConfiguration", + "SchedulePlan", + "SecurityFilterBase", + "SecurityFilterPlan", + "SecurityFilterPlanMode", + "Server", + "ServerMessage", + "ServerMessageAssistantRequest", + "ServerMessageAssistantRequestPhoneNumber", + "ServerMessageCallEndpointingRequest", + "ServerMessageCallEndpointingRequestMessagesItem", + "ServerMessageCallEndpointingRequestPhoneNumber", + "ServerMessageChatCreated", + "ServerMessageChatCreatedPhoneNumber", + "ServerMessageChatDeleted", + "ServerMessageChatDeletedPhoneNumber", + "ServerMessageConversationUpdate", + "ServerMessageConversationUpdateMessagesItem", + "ServerMessageConversationUpdatePhoneNumber", + "ServerMessageEndOfCallReport", + "ServerMessageEndOfCallReportCostsItem", + "ServerMessageEndOfCallReportEndedReason", + "ServerMessageEndOfCallReportPhoneNumber", + "ServerMessageHang", + "ServerMessageHangPhoneNumber", + "ServerMessageKnowledgeBaseRequest", + "ServerMessageKnowledgeBaseRequestMessagesItem", + "ServerMessageKnowledgeBaseRequestPhoneNumber", + "ServerMessageLanguageChangeDetected", + "ServerMessageLanguageChangeDetectedPhoneNumber", + "ServerMessageMessage", + "ServerMessageModelOutput", + "ServerMessageModelOutputPhoneNumber", + "ServerMessagePhoneCallControl", + "ServerMessagePhoneCallControlDestination", + "ServerMessagePhoneCallControlPhoneNumber", + "ServerMessagePhoneCallControlRequest", + "ServerMessageResponse", + "ServerMessageResponseAssistantRequest", + "ServerMessageResponseAssistantRequestDestination", + "ServerMessageResponseCallEndpointingRequest", + "ServerMessageResponseHandoffDestinationRequest", + "ServerMessageResponseKnowledgeBaseRequest", + "ServerMessageResponseMessageResponse", + "ServerMessageResponseToolCalls", + "ServerMessageResponseTransferDestinationRequest", + "ServerMessageResponseTransferDestinationRequestDestination", + "ServerMessageResponseTransferDestinationRequestMessage", + "ServerMessageResponseVoiceRequest", + "ServerMessageSessionCreated", + "ServerMessageSessionCreatedPhoneNumber", + "ServerMessageSessionDeleted", + "ServerMessageSessionDeletedPhoneNumber", + "ServerMessageSessionUpdated", + "ServerMessageSessionUpdatedPhoneNumber", + "ServerMessageSpeechUpdate", + "ServerMessageSpeechUpdatePhoneNumber", + "ServerMessageSpeechUpdateRole", + "ServerMessageSpeechUpdateStatus", + "ServerMessageStatusUpdate", + "ServerMessageStatusUpdateDestination", + "ServerMessageStatusUpdateEndedReason", + "ServerMessageStatusUpdateMessagesItem", + "ServerMessageStatusUpdatePhoneNumber", + "ServerMessageStatusUpdateStatus", + "ServerMessageToolCalls", + "ServerMessageToolCallsPhoneNumber", + "ServerMessageToolCallsToolWithToolCallListItem", + "ServerMessageTranscript", + "ServerMessageTranscriptPhoneNumber", + "ServerMessageTranscriptRole", + "ServerMessageTranscriptTranscriptType", + "ServerMessageTranscriptType", + "ServerMessageTransferDestinationRequest", + "ServerMessageTransferDestinationRequestPhoneNumber", + "ServerMessageTransferUpdate", + "ServerMessageTransferUpdateDestination", + "ServerMessageTransferUpdatePhoneNumber", + "ServerMessageUserInterrupted", + "ServerMessageUserInterruptedPhoneNumber", + "ServerMessageVoiceInput", + "ServerMessageVoiceInputPhoneNumber", + "ServerMessageVoiceRequest", + "ServerMessageVoiceRequestPhoneNumber", + "SesameVoice", + "Session", + "SessionMessagesItem", + "SessionPaginatedResponse", + "SessionStatus", + "SessionsListRequestSortOrder", + "SipAuthentication", + "SipTrunkGateway", + "SipTrunkGatewayOutboundProtocol", + "SipTrunkOutboundAuthenticationPlan", + "SipTrunkOutboundSipRegisterPlan", + "SlackOAuth2AuthorizationCredential", + "SlackSendMessageTool", + "SlackSendMessageToolMessagesItem", + "SmallestAiCredential", + "SmallestAiVoice", + "SmallestAiVoiceId", + "SmallestAiVoiceIdEnum", + "SmartDenoisingPlan", + "SmsTool", + "SmsToolMessagesItem", + "SpeechmaticsCredential", + "SpeechmaticsTranscriber", + "SpeechmaticsTranscriberLanguage", + "SqlInjectionSecurityFilter", + "Squad", + "SquadMemberDto", + "SquadMemberDtoAssistantDestinationsItem", + "SsrfSecurityFilter", + "StartSpeakingPlan", + "StartSpeakingPlanCustomEndpointingRulesItem", + "StartSpeakingPlanSmartEndpointingEnabled", + "StartSpeakingPlanSmartEndpointingPlan", + "StopSpeakingPlan", + "StructuredDataMultiPlan", + "StructuredDataPlan", + "StructuredOutput", + "StructuredOutputControllerFindAllRequestSortOrder", + "StructuredOutputModel", + "StructuredOutputPaginatedResponse", + "Subscription", + "SubscriptionMinutesIncludedResetFrequency", + "SubscriptionStatus", + "SubscriptionType", + "SuccessEvaluationPlan", + "SuccessEvaluationPlanRubric", + "SummaryPlan", + "SupabaseBucketPlan", + "SupabaseBucketPlanRegion", + "SupabaseCredential", + "SyncVoiceLibraryDto", + "SyncVoiceLibraryDtoProvidersItem", + "SystemMessage", + "TalkscriberTranscriber", + "TalkscriberTranscriberLanguage", + "TargetPlan", + "TavusConversationProperties", + "TavusCredential", + "TavusVoice", + "TavusVoiceVoiceId", + "TelnyxPhoneNumber", + "TelnyxPhoneNumberFallbackDestination", + "TelnyxPhoneNumberHooksItem", + "TelnyxPhoneNumberStatus", + "Template", + "TemplateDetails", + "TemplateProvider", + "TemplateProviderDetails", + "TemplateVisibility", + "TestSuite", + "TestSuitePhoneNumber", + "TestSuiteRun", + "TestSuiteRunScorerAi", + "TestSuiteRunScorerAiResult", + "TestSuiteRunStatus", + "TestSuiteRunTestAttempt", + "TestSuiteRunTestAttemptCall", + "TestSuiteRunTestAttemptMetadata", + "TestSuiteRunTestResult", + "TestSuiteRunsPaginatedResponse", + "TestSuiteTestChat", + "TestSuiteTestScorerAi", + "TestSuiteTestVoice", + "TestSuiteTestsPaginatedResponse", + "TestSuiteTestsPaginatedResponseResultsItem", + "TestSuitesPaginatedResponse", + "TesterPlan", + "TextContent", + "TextContentLanguage", + "TextEditorTool", + "TextEditorToolMessagesItem", + "TextEditorToolWithToolCall", + "TextEditorToolWithToolCallMessagesItem", + "TimeRange", + "TimeRangeStep", + "TogetherAiCredential", + "TogetherAiModel", + "TogetherAiModelToolsItem", + "Token", + "TokenRestrictions", + "TokenTag", + "ToolCall", + "ToolCallFunction", + "ToolCallHookAction", + "ToolCallHookActionTool", + "ToolCallMessage", + "ToolCallResult", + "ToolCallResultMessage", + "ToolMessage", + "ToolMessageComplete", + "ToolMessageCompleteRole", + "ToolMessageDelayed", + "ToolMessageFailed", + "ToolMessageStart", + "ToolNode", + "ToolNodeTool", + "ToolRejectionPlan", + "ToolRejectionPlanConditionsItem", + "ToolTemplateMetadata", + "ToolTemplateSetup", + "ToolsCreateRequest", + "ToolsCreateResponse", + "ToolsDeleteResponse", + "ToolsGetResponse", + "ToolsListResponseItem", + "ToolsUpdateRequest", + "ToolsUpdateResponse", + "TranscriberCost", + "TranscriptPlan", + "TranscriptionEndpointingPlan", + "TransferAssistant", + "TransferAssistantFirstMessageMode", + "TransferAssistantHookAction", + "TransferAssistantModel", + "TransferAssistantModelProvider", + "TransferCallTool", + "TransferCallToolDestinationsItem", + "TransferCallToolMessagesItem", + "TransferCancelToolUserEditable", + "TransferCancelToolUserEditableMessagesItem", + "TransferDestinationAssistant", + "TransferDestinationAssistantMessage", + "TransferDestinationNumber", + "TransferDestinationNumberMessage", + "TransferDestinationSip", + "TransferDestinationSipMessage", + "TransferFallbackPlan", + "TransferFallbackPlanMessage", + "TransferHookAction", + "TransferHookActionDestination", + "TransferMode", + "TransferPhoneNumberHookAction", + "TransferPhoneNumberHookActionDestination", + "TransferPlan", + "TransferPlanMessage", + "TransferPlanMode", + "TransferSuccessfulToolUserEditable", + "TransferSuccessfulToolUserEditableMessagesItem", + "TransportConfigurationTwilio", + "TransportConfigurationTwilioRecordingChannels", + "TransportCost", + "TransportCostProvider", + "TrieveCredential", + "TrieveKnowledgeBase", + "TrieveKnowledgeBaseChunkPlan", + "TrieveKnowledgeBaseCreate", + "TrieveKnowledgeBaseImport", + "TrieveKnowledgeBaseSearchPlan", + "TrieveKnowledgeBaseSearchPlanSearchType", + "TurnLatency", + "TwilioCredential", + "TwilioPhoneNumber", + "TwilioPhoneNumberFallbackDestination", + "TwilioPhoneNumberHooksItem", + "TwilioPhoneNumberStatus", + "TwilioVoicemailDetectionPlan", + "TwilioVoicemailDetectionPlanVoicemailDetectionTypesItem", + "UpdateAnthropicCredentialDto", + "UpdateAnyscaleCredentialDto", + "UpdateApiRequestToolDto", + "UpdateApiRequestToolDtoMessagesItem", + "UpdateApiRequestToolDtoMethod", + "UpdateAssemblyAiCredentialDto", + "UpdateAssistantDtoBackgroundSound", + "UpdateAssistantDtoBackgroundSoundZero", + "UpdateAssistantDtoClientMessagesItem", + "UpdateAssistantDtoCredentialsItem", + "UpdateAssistantDtoFirstMessageMode", + "UpdateAssistantDtoHooksItem", + "UpdateAssistantDtoModel", + "UpdateAssistantDtoServerMessagesItem", + "UpdateAssistantDtoTranscriber", + "UpdateAssistantDtoVoice", + "UpdateAssistantDtoVoicemailDetection", + "UpdateAzureCredentialDto", + "UpdateAzureCredentialDtoRegion", + "UpdateAzureCredentialDtoService", + "UpdateAzureOpenAiCredentialDto", + "UpdateAzureOpenAiCredentialDtoModelsItem", + "UpdateAzureOpenAiCredentialDtoRegion", + "UpdateBashToolDto", + "UpdateBashToolDtoMessagesItem", + "UpdateByoPhoneNumberDto", + "UpdateByoPhoneNumberDtoFallbackDestination", + "UpdateByoPhoneNumberDtoHooksItem", + "UpdateByoSipTrunkCredentialDto", + "UpdateCartesiaCredentialDto", + "UpdateCerebrasCredentialDto", + "UpdateCloudflareCredentialDto", + "UpdateComputerToolDto", + "UpdateComputerToolDtoMessagesItem", + "UpdateCustomCredentialDto", + "UpdateCustomCredentialDtoAuthenticationPlan", + "UpdateCustomKnowledgeBaseDto", + "UpdateCustomLlmCredentialDto", + "UpdateDeepInfraCredentialDto", + "UpdateDeepSeekCredentialDto", + "UpdateDeepgramCredentialDto", + "UpdateDtmfToolDto", + "UpdateDtmfToolDtoMessagesItem", + "UpdateElevenLabsCredentialDto", + "UpdateEndCallToolDto", + "UpdateEndCallToolDtoMessagesItem", + "UpdateFunctionToolDto", + "UpdateFunctionToolDtoMessagesItem", + "UpdateGcpCredentialDto", + "UpdateGhlToolDto", + "UpdateGhlToolDtoMessagesItem", + "UpdateGladiaCredentialDto", + "UpdateGoHighLevelCalendarAvailabilityToolDto", + "UpdateGoHighLevelCalendarAvailabilityToolDtoMessagesItem", + "UpdateGoHighLevelCalendarEventCreateToolDto", + "UpdateGoHighLevelCalendarEventCreateToolDtoMessagesItem", + "UpdateGoHighLevelContactCreateToolDto", + "UpdateGoHighLevelContactCreateToolDtoMessagesItem", + "UpdateGoHighLevelContactGetToolDto", + "UpdateGoHighLevelContactGetToolDtoMessagesItem", + "UpdateGoHighLevelCredentialDto", + "UpdateGoHighLevelMcpCredentialDto", + "UpdateGoogleCalendarCheckAvailabilityToolDto", + "UpdateGoogleCalendarCheckAvailabilityToolDtoMessagesItem", + "UpdateGoogleCalendarCreateEventToolDto", + "UpdateGoogleCalendarCreateEventToolDtoMessagesItem", + "UpdateGoogleCalendarOAuth2AuthorizationCredentialDto", + "UpdateGoogleCalendarOAuth2ClientCredentialDto", + "UpdateGoogleCredentialDto", + "UpdateGoogleSheetsOAuth2AuthorizationCredentialDto", + "UpdateGoogleSheetsRowAppendToolDto", + "UpdateGoogleSheetsRowAppendToolDtoMessagesItem", + "UpdateGroqCredentialDto", + "UpdateHandoffToolDto", + "UpdateHandoffToolDtoDestinationsItem", + "UpdateHandoffToolDtoMessagesItem", + "UpdateHumeCredentialDto", + "UpdateInflectionAiCredentialDto", + "UpdateInworldCredentialDto", + "UpdateLangfuseCredentialDto", + "UpdateLmntCredentialDto", + "UpdateMakeCredentialDto", + "UpdateMakeToolDto", + "UpdateMakeToolDtoMessagesItem", + "UpdateMcpToolDto", + "UpdateMcpToolDtoMessagesItem", + "UpdateMistralCredentialDto", + "UpdateNeuphonicCredentialDto", + "UpdateOpenAiCredentialDto", + "UpdateOpenRouterCredentialDto", + "UpdateOrgDto", + "UpdateOrgDtoChannel", + "UpdateOutputToolDto", + "UpdateOutputToolDtoMessagesItem", + "UpdatePerplexityAiCredentialDto", + "UpdatePlayHtCredentialDto", + "UpdateQueryToolDto", + "UpdateQueryToolDtoMessagesItem", + "UpdateRimeAiCredentialDto", + "UpdateRunpodCredentialDto", + "UpdateS3CredentialDto", + "UpdateSessionDtoMessagesItem", + "UpdateSessionDtoStatus", + "UpdateSlackOAuth2AuthorizationCredentialDto", + "UpdateSlackSendMessageToolDto", + "UpdateSlackSendMessageToolDtoMessagesItem", + "UpdateSmallestAiCredentialDto", + "UpdateSmsToolDto", + "UpdateSmsToolDtoMessagesItem", + "UpdateSpeechmaticsCredentialDto", + "UpdateStructuredOutputDtoModel", + "UpdateSupabaseCredentialDto", + "UpdateTavusCredentialDto", + "UpdateTelnyxPhoneNumberDto", + "UpdateTelnyxPhoneNumberDtoFallbackDestination", + "UpdateTelnyxPhoneNumberDtoHooksItem", + "UpdateTestSuiteDto", + "UpdateTestSuiteRunDto", + "UpdateTestSuiteTestChatDto", + "UpdateTestSuiteTestVoiceDto", + "UpdateTextEditorToolDto", + "UpdateTextEditorToolDtoMessagesItem", + "UpdateTogetherAiCredentialDto", + "UpdateTokenDto", + "UpdateTokenDtoTag", + "UpdateToolTemplateDto", + "UpdateToolTemplateDtoDetails", + "UpdateToolTemplateDtoProvider", + "UpdateToolTemplateDtoProviderDetails", + "UpdateToolTemplateDtoVisibility", + "UpdateTransferCallToolDto", + "UpdateTransferCallToolDtoDestinationsItem", + "UpdateTransferCallToolDtoMessagesItem", + "UpdateTrieveCredentialDto", + "UpdateTrieveKnowledgeBaseDto", + "UpdateTwilioCredentialDto", + "UpdateTwilioPhoneNumberDto", + "UpdateTwilioPhoneNumberDtoFallbackDestination", + "UpdateTwilioPhoneNumberDtoHooksItem", + "UpdateUserRoleDto", + "UpdateUserRoleDtoRole", + "UpdateVapiPhoneNumberDto", + "UpdateVapiPhoneNumberDtoFallbackDestination", + "UpdateVapiPhoneNumberDtoHooksItem", + "UpdateVonageCredentialDto", + "UpdateVonagePhoneNumberDto", + "UpdateVonagePhoneNumberDtoFallbackDestination", + "UpdateVonagePhoneNumberDtoHooksItem", + "UpdateWebhookCredentialDto", + "UpdateWebhookCredentialDtoAuthenticationPlan", + "UpdateWorkflowDto", + "UpdateWorkflowDtoBackgroundSound", + "UpdateWorkflowDtoBackgroundSoundZero", + "UpdateWorkflowDtoCredentialsItem", + "UpdateWorkflowDtoHooksItem", + "UpdateWorkflowDtoModel", + "UpdateWorkflowDtoNodesItem", + "UpdateWorkflowDtoTranscriber", + "UpdateWorkflowDtoVoice", + "UpdateXAiCredentialDto", + "User", + "UserMessage", + "Vapi", + "VapiCost", + "VapiCostSubType", + "VapiEnvironment", + "VapiModel", + "VapiModelToolsItem", + "VapiPhoneNumber", + "VapiPhoneNumberFallbackDestination", + "VapiPhoneNumberHooksItem", + "VapiPhoneNumberStatus", + "VapiSmartEndpointingPlan", + "VapiSmartEndpointingPlanProvider", + "VapiVoice", + "VapiVoiceVoiceId", + "VapiVoicemailDetectionPlan", + "VapiVoicemailDetectionPlanType", + "VariableExtractionAlias", + "VariableExtractionPlan", + "VoiceCost", + "VoiceLibrary", + "VoiceLibraryGender", + "VoiceLibraryVoiceResponse", + "VoicemailDetectionBackoffPlan", + "VoicemailDetectionCost", + "VoicemailDetectionCostProvider", + "VonageCredential", + "VonagePhoneNumber", + "VonagePhoneNumberFallbackDestination", + "VonagePhoneNumberHooksItem", + "VonagePhoneNumberStatus", + "WebChat", + "WebChatOutputItem", + "WebhookCredential", + "WebhookCredentialAuthenticationPlan", + "Workflow", + "WorkflowAnthropicModel", + "WorkflowAnthropicModelModel", + "WorkflowBackgroundSound", + "WorkflowBackgroundSoundZero", + "WorkflowCredentialsItem", + "WorkflowCustomModel", + "WorkflowCustomModelMetadataSendMode", + "WorkflowGoogleModel", + "WorkflowGoogleModelModel", + "WorkflowHooksItem", + "WorkflowModel", + "WorkflowNodesItem", + "WorkflowOpenAiModel", + "WorkflowOpenAiModelModel", + "WorkflowOverrides", + "WorkflowTranscriber", + "WorkflowUserEditable", + "WorkflowUserEditableBackgroundSound", + "WorkflowUserEditableBackgroundSoundZero", + "WorkflowUserEditableCredentialsItem", + "WorkflowUserEditableHooksItem", + "WorkflowUserEditableModel", + "WorkflowUserEditableNodesItem", + "WorkflowUserEditableTranscriber", + "WorkflowUserEditableVoice", + "WorkflowVoice", + "XAiCredential", + "XaiModel", + "XaiModelModel", + "XaiModelToolsItem", + "XssSecurityFilter", + "__version__", + "analytics", + "assistants", + "calls", + "campaigns", + "chats", + "files", + "phone_numbers", + "provider_resources", + "sessions", + "squads", + "structured_outputs", + "tools", ] diff --git a/src/vapi/assistants/__init__.py b/src/vapi/assistants/__init__.py index 5191f4b..064d063 100644 --- a/src/vapi/assistants/__init__.py +++ b/src/vapi/assistants/__init__.py @@ -2,19 +2,56 @@ # isort: skip_file -from .types import ( - UpdateAssistantDtoBackgroundSound, - UpdateAssistantDtoBackgroundSoundZero, - UpdateAssistantDtoClientMessagesItem, - UpdateAssistantDtoCredentialsItem, - UpdateAssistantDtoFirstMessageMode, - UpdateAssistantDtoHooksItem, - UpdateAssistantDtoModel, - UpdateAssistantDtoServerMessagesItem, - UpdateAssistantDtoTranscriber, - UpdateAssistantDtoVoice, - UpdateAssistantDtoVoicemailDetection, -) +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import ( + UpdateAssistantDtoBackgroundSound, + UpdateAssistantDtoBackgroundSoundZero, + UpdateAssistantDtoClientMessagesItem, + UpdateAssistantDtoCredentialsItem, + UpdateAssistantDtoFirstMessageMode, + UpdateAssistantDtoHooksItem, + UpdateAssistantDtoModel, + UpdateAssistantDtoServerMessagesItem, + UpdateAssistantDtoTranscriber, + UpdateAssistantDtoVoice, + UpdateAssistantDtoVoicemailDetection, + ) +_dynamic_imports: typing.Dict[str, str] = { + "UpdateAssistantDtoBackgroundSound": ".types", + "UpdateAssistantDtoBackgroundSoundZero": ".types", + "UpdateAssistantDtoClientMessagesItem": ".types", + "UpdateAssistantDtoCredentialsItem": ".types", + "UpdateAssistantDtoFirstMessageMode": ".types", + "UpdateAssistantDtoHooksItem": ".types", + "UpdateAssistantDtoModel": ".types", + "UpdateAssistantDtoServerMessagesItem": ".types", + "UpdateAssistantDtoTranscriber": ".types", + "UpdateAssistantDtoVoice": ".types", + "UpdateAssistantDtoVoicemailDetection": ".types", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + __all__ = [ "UpdateAssistantDtoBackgroundSound", diff --git a/src/vapi/assistants/client.py b/src/vapi/assistants/client.py index f5cd4d7..759d134 100644 --- a/src/vapi/assistants/client.py +++ b/src/vapi/assistants/client.py @@ -22,7 +22,6 @@ from ..types.create_assistant_dto_voicemail_detection import CreateAssistantDtoVoicemailDetection from ..types.keypad_input_plan import KeypadInputPlan from ..types.langfuse_observability_plan import LangfuseObservabilityPlan -from ..types.message_plan import MessagePlan from ..types.monitor_plan import MonitorPlan from ..types.server import Server from ..types.start_speaking_plan import StartSpeakingPlan @@ -146,10 +145,8 @@ def create( voicemail_detection: typing.Optional[CreateAssistantDtoVoicemailDetection] = OMIT, client_messages: typing.Optional[typing.Sequence[CreateAssistantDtoClientMessagesItem]] = OMIT, server_messages: typing.Optional[typing.Sequence[CreateAssistantDtoServerMessagesItem]] = OMIT, - silence_timeout_seconds: typing.Optional[float] = OMIT, max_duration_seconds: typing.Optional[float] = OMIT, background_sound: typing.Optional[CreateAssistantDtoBackgroundSound] = OMIT, - background_denoising_enabled: typing.Optional[bool] = OMIT, model_output_in_messages_enabled: typing.Optional[bool] = OMIT, transport_configurations: typing.Optional[typing.Sequence[TransportConfigurationTwilio]] = OMIT, observability_plan: typing.Optional[LangfuseObservabilityPlan] = OMIT, @@ -164,7 +161,6 @@ def create( background_speech_denoising_plan: typing.Optional[BackgroundSpeechDenoisingPlan] = OMIT, analysis_plan: typing.Optional[AnalysisPlan] = OMIT, artifact_plan: typing.Optional[ArtifactPlan] = OMIT, - message_plan: typing.Optional[MessagePlan] = OMIT, start_speaking_plan: typing.Optional[StartSpeakingPlan] = OMIT, stop_speaking_plan: typing.Optional[StopSpeakingPlan] = OMIT, monitor_plan: typing.Optional[MonitorPlan] = OMIT, @@ -211,12 +207,7 @@ def create( These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transfer-update,transcript,tool-calls,user-interrupted,voice-input,workflow.node.started. You can check the shape of the messages in ClientMessage schema. server_messages : typing.Optional[typing.Sequence[CreateAssistantDtoServerMessagesItem]] - These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema. - - silence_timeout_seconds : typing.Optional[float] - How many seconds of silence to wait before ending the call. Defaults to 30. - - @default 30 + These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,handoff-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema. max_duration_seconds : typing.Optional[float] This is the maximum number of seconds that the call will last. When the call reaches this duration, it will be ended. @@ -227,13 +218,6 @@ def create( This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'. You can also provide a custom sound by providing a URL to an audio file. - background_denoising_enabled : typing.Optional[bool] - This enables filtering of noise and background speech while the user is talking. - - Default `false` while in beta. - - @default false - model_output_in_messages_enabled : typing.Optional[bool] This determines whether the model's output is used in conversation history rather than the transcription of assistant's speech. @@ -297,11 +281,6 @@ def create( artifact_plan : typing.Optional[ArtifactPlan] This is the plan for artifacts generated during assistant's calls. Stored in `call.artifact`. - message_plan : typing.Optional[MessagePlan] - This is the plan for static predefined messages that can be spoken by the assistant during the call, like `idleMessages`. - - Note: `firstMessage`, `voicemailMessage`, and `endCallMessage` are currently at the root level. They will be moved to `messagePlan` in the future, but will remain backwards compatible. - start_speaking_plan : typing.Optional[StartSpeakingPlan] This is the plan for when the assistant should start talking. @@ -368,10 +347,8 @@ def create( voicemail_detection=voicemail_detection, client_messages=client_messages, server_messages=server_messages, - silence_timeout_seconds=silence_timeout_seconds, max_duration_seconds=max_duration_seconds, background_sound=background_sound, - background_denoising_enabled=background_denoising_enabled, model_output_in_messages_enabled=model_output_in_messages_enabled, transport_configurations=transport_configurations, observability_plan=observability_plan, @@ -386,7 +363,6 @@ def create( background_speech_denoising_plan=background_speech_denoising_plan, analysis_plan=analysis_plan, artifact_plan=artifact_plan, - message_plan=message_plan, start_speaking_plan=start_speaking_plan, stop_speaking_plan=stop_speaking_plan, monitor_plan=monitor_plan, @@ -466,10 +442,8 @@ def update( voicemail_detection: typing.Optional[UpdateAssistantDtoVoicemailDetection] = OMIT, client_messages: typing.Optional[typing.Sequence[UpdateAssistantDtoClientMessagesItem]] = OMIT, server_messages: typing.Optional[typing.Sequence[UpdateAssistantDtoServerMessagesItem]] = OMIT, - silence_timeout_seconds: typing.Optional[float] = OMIT, max_duration_seconds: typing.Optional[float] = OMIT, background_sound: typing.Optional[UpdateAssistantDtoBackgroundSound] = OMIT, - background_denoising_enabled: typing.Optional[bool] = OMIT, model_output_in_messages_enabled: typing.Optional[bool] = OMIT, transport_configurations: typing.Optional[typing.Sequence[TransportConfigurationTwilio]] = OMIT, observability_plan: typing.Optional[LangfuseObservabilityPlan] = OMIT, @@ -484,7 +458,6 @@ def update( background_speech_denoising_plan: typing.Optional[BackgroundSpeechDenoisingPlan] = OMIT, analysis_plan: typing.Optional[AnalysisPlan] = OMIT, artifact_plan: typing.Optional[ArtifactPlan] = OMIT, - message_plan: typing.Optional[MessagePlan] = OMIT, start_speaking_plan: typing.Optional[StartSpeakingPlan] = OMIT, stop_speaking_plan: typing.Optional[StopSpeakingPlan] = OMIT, monitor_plan: typing.Optional[MonitorPlan] = OMIT, @@ -533,12 +506,7 @@ def update( These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transfer-update,transcript,tool-calls,user-interrupted,voice-input,workflow.node.started. You can check the shape of the messages in ClientMessage schema. server_messages : typing.Optional[typing.Sequence[UpdateAssistantDtoServerMessagesItem]] - These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema. - - silence_timeout_seconds : typing.Optional[float] - How many seconds of silence to wait before ending the call. Defaults to 30. - - @default 30 + These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,handoff-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema. max_duration_seconds : typing.Optional[float] This is the maximum number of seconds that the call will last. When the call reaches this duration, it will be ended. @@ -549,13 +517,6 @@ def update( This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'. You can also provide a custom sound by providing a URL to an audio file. - background_denoising_enabled : typing.Optional[bool] - This enables filtering of noise and background speech while the user is talking. - - Default `false` while in beta. - - @default false - model_output_in_messages_enabled : typing.Optional[bool] This determines whether the model's output is used in conversation history rather than the transcription of assistant's speech. @@ -619,11 +580,6 @@ def update( artifact_plan : typing.Optional[ArtifactPlan] This is the plan for artifacts generated during assistant's calls. Stored in `call.artifact`. - message_plan : typing.Optional[MessagePlan] - This is the plan for static predefined messages that can be spoken by the assistant during the call, like `idleMessages`. - - Note: `firstMessage`, `voicemailMessage`, and `endCallMessage` are currently at the root level. They will be moved to `messagePlan` in the future, but will remain backwards compatible. - start_speaking_plan : typing.Optional[StartSpeakingPlan] This is the plan for when the assistant should start talking. @@ -693,10 +649,8 @@ def update( voicemail_detection=voicemail_detection, client_messages=client_messages, server_messages=server_messages, - silence_timeout_seconds=silence_timeout_seconds, max_duration_seconds=max_duration_seconds, background_sound=background_sound, - background_denoising_enabled=background_denoising_enabled, model_output_in_messages_enabled=model_output_in_messages_enabled, transport_configurations=transport_configurations, observability_plan=observability_plan, @@ -711,7 +665,6 @@ def update( background_speech_denoising_plan=background_speech_denoising_plan, analysis_plan=analysis_plan, artifact_plan=artifact_plan, - message_plan=message_plan, start_speaking_plan=start_speaking_plan, stop_speaking_plan=stop_speaking_plan, monitor_plan=monitor_plan, @@ -833,10 +786,8 @@ async def create( voicemail_detection: typing.Optional[CreateAssistantDtoVoicemailDetection] = OMIT, client_messages: typing.Optional[typing.Sequence[CreateAssistantDtoClientMessagesItem]] = OMIT, server_messages: typing.Optional[typing.Sequence[CreateAssistantDtoServerMessagesItem]] = OMIT, - silence_timeout_seconds: typing.Optional[float] = OMIT, max_duration_seconds: typing.Optional[float] = OMIT, background_sound: typing.Optional[CreateAssistantDtoBackgroundSound] = OMIT, - background_denoising_enabled: typing.Optional[bool] = OMIT, model_output_in_messages_enabled: typing.Optional[bool] = OMIT, transport_configurations: typing.Optional[typing.Sequence[TransportConfigurationTwilio]] = OMIT, observability_plan: typing.Optional[LangfuseObservabilityPlan] = OMIT, @@ -851,7 +802,6 @@ async def create( background_speech_denoising_plan: typing.Optional[BackgroundSpeechDenoisingPlan] = OMIT, analysis_plan: typing.Optional[AnalysisPlan] = OMIT, artifact_plan: typing.Optional[ArtifactPlan] = OMIT, - message_plan: typing.Optional[MessagePlan] = OMIT, start_speaking_plan: typing.Optional[StartSpeakingPlan] = OMIT, stop_speaking_plan: typing.Optional[StopSpeakingPlan] = OMIT, monitor_plan: typing.Optional[MonitorPlan] = OMIT, @@ -898,12 +848,7 @@ async def create( These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transfer-update,transcript,tool-calls,user-interrupted,voice-input,workflow.node.started. You can check the shape of the messages in ClientMessage schema. server_messages : typing.Optional[typing.Sequence[CreateAssistantDtoServerMessagesItem]] - These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema. - - silence_timeout_seconds : typing.Optional[float] - How many seconds of silence to wait before ending the call. Defaults to 30. - - @default 30 + These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,handoff-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema. max_duration_seconds : typing.Optional[float] This is the maximum number of seconds that the call will last. When the call reaches this duration, it will be ended. @@ -914,13 +859,6 @@ async def create( This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'. You can also provide a custom sound by providing a URL to an audio file. - background_denoising_enabled : typing.Optional[bool] - This enables filtering of noise and background speech while the user is talking. - - Default `false` while in beta. - - @default false - model_output_in_messages_enabled : typing.Optional[bool] This determines whether the model's output is used in conversation history rather than the transcription of assistant's speech. @@ -984,11 +922,6 @@ async def create( artifact_plan : typing.Optional[ArtifactPlan] This is the plan for artifacts generated during assistant's calls. Stored in `call.artifact`. - message_plan : typing.Optional[MessagePlan] - This is the plan for static predefined messages that can be spoken by the assistant during the call, like `idleMessages`. - - Note: `firstMessage`, `voicemailMessage`, and `endCallMessage` are currently at the root level. They will be moved to `messagePlan` in the future, but will remain backwards compatible. - start_speaking_plan : typing.Optional[StartSpeakingPlan] This is the plan for when the assistant should start talking. @@ -1063,10 +996,8 @@ async def main() -> None: voicemail_detection=voicemail_detection, client_messages=client_messages, server_messages=server_messages, - silence_timeout_seconds=silence_timeout_seconds, max_duration_seconds=max_duration_seconds, background_sound=background_sound, - background_denoising_enabled=background_denoising_enabled, model_output_in_messages_enabled=model_output_in_messages_enabled, transport_configurations=transport_configurations, observability_plan=observability_plan, @@ -1081,7 +1012,6 @@ async def main() -> None: background_speech_denoising_plan=background_speech_denoising_plan, analysis_plan=analysis_plan, artifact_plan=artifact_plan, - message_plan=message_plan, start_speaking_plan=start_speaking_plan, stop_speaking_plan=stop_speaking_plan, monitor_plan=monitor_plan, @@ -1177,10 +1107,8 @@ async def update( voicemail_detection: typing.Optional[UpdateAssistantDtoVoicemailDetection] = OMIT, client_messages: typing.Optional[typing.Sequence[UpdateAssistantDtoClientMessagesItem]] = OMIT, server_messages: typing.Optional[typing.Sequence[UpdateAssistantDtoServerMessagesItem]] = OMIT, - silence_timeout_seconds: typing.Optional[float] = OMIT, max_duration_seconds: typing.Optional[float] = OMIT, background_sound: typing.Optional[UpdateAssistantDtoBackgroundSound] = OMIT, - background_denoising_enabled: typing.Optional[bool] = OMIT, model_output_in_messages_enabled: typing.Optional[bool] = OMIT, transport_configurations: typing.Optional[typing.Sequence[TransportConfigurationTwilio]] = OMIT, observability_plan: typing.Optional[LangfuseObservabilityPlan] = OMIT, @@ -1195,7 +1123,6 @@ async def update( background_speech_denoising_plan: typing.Optional[BackgroundSpeechDenoisingPlan] = OMIT, analysis_plan: typing.Optional[AnalysisPlan] = OMIT, artifact_plan: typing.Optional[ArtifactPlan] = OMIT, - message_plan: typing.Optional[MessagePlan] = OMIT, start_speaking_plan: typing.Optional[StartSpeakingPlan] = OMIT, stop_speaking_plan: typing.Optional[StopSpeakingPlan] = OMIT, monitor_plan: typing.Optional[MonitorPlan] = OMIT, @@ -1244,12 +1171,7 @@ async def update( These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transfer-update,transcript,tool-calls,user-interrupted,voice-input,workflow.node.started. You can check the shape of the messages in ClientMessage schema. server_messages : typing.Optional[typing.Sequence[UpdateAssistantDtoServerMessagesItem]] - These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema. - - silence_timeout_seconds : typing.Optional[float] - How many seconds of silence to wait before ending the call. Defaults to 30. - - @default 30 + These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,handoff-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema. max_duration_seconds : typing.Optional[float] This is the maximum number of seconds that the call will last. When the call reaches this duration, it will be ended. @@ -1260,13 +1182,6 @@ async def update( This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'. You can also provide a custom sound by providing a URL to an audio file. - background_denoising_enabled : typing.Optional[bool] - This enables filtering of noise and background speech while the user is talking. - - Default `false` while in beta. - - @default false - model_output_in_messages_enabled : typing.Optional[bool] This determines whether the model's output is used in conversation history rather than the transcription of assistant's speech. @@ -1330,11 +1245,6 @@ async def update( artifact_plan : typing.Optional[ArtifactPlan] This is the plan for artifacts generated during assistant's calls. Stored in `call.artifact`. - message_plan : typing.Optional[MessagePlan] - This is the plan for static predefined messages that can be spoken by the assistant during the call, like `idleMessages`. - - Note: `firstMessage`, `voicemailMessage`, and `endCallMessage` are currently at the root level. They will be moved to `messagePlan` in the future, but will remain backwards compatible. - start_speaking_plan : typing.Optional[StartSpeakingPlan] This is the plan for when the assistant should start talking. @@ -1412,10 +1322,8 @@ async def main() -> None: voicemail_detection=voicemail_detection, client_messages=client_messages, server_messages=server_messages, - silence_timeout_seconds=silence_timeout_seconds, max_duration_seconds=max_duration_seconds, background_sound=background_sound, - background_denoising_enabled=background_denoising_enabled, model_output_in_messages_enabled=model_output_in_messages_enabled, transport_configurations=transport_configurations, observability_plan=observability_plan, @@ -1430,7 +1338,6 @@ async def main() -> None: background_speech_denoising_plan=background_speech_denoising_plan, analysis_plan=analysis_plan, artifact_plan=artifact_plan, - message_plan=message_plan, start_speaking_plan=start_speaking_plan, stop_speaking_plan=stop_speaking_plan, monitor_plan=monitor_plan, diff --git a/src/vapi/assistants/raw_client.py b/src/vapi/assistants/raw_client.py index 36c0835..990690e 100644 --- a/src/vapi/assistants/raw_client.py +++ b/src/vapi/assistants/raw_client.py @@ -29,7 +29,6 @@ from ..types.create_assistant_dto_voicemail_detection import CreateAssistantDtoVoicemailDetection from ..types.keypad_input_plan import KeypadInputPlan from ..types.langfuse_observability_plan import LangfuseObservabilityPlan -from ..types.message_plan import MessagePlan from ..types.monitor_plan import MonitorPlan from ..types.server import Server from ..types.start_speaking_plan import StartSpeakingPlan @@ -149,10 +148,8 @@ def create( voicemail_detection: typing.Optional[CreateAssistantDtoVoicemailDetection] = OMIT, client_messages: typing.Optional[typing.Sequence[CreateAssistantDtoClientMessagesItem]] = OMIT, server_messages: typing.Optional[typing.Sequence[CreateAssistantDtoServerMessagesItem]] = OMIT, - silence_timeout_seconds: typing.Optional[float] = OMIT, max_duration_seconds: typing.Optional[float] = OMIT, background_sound: typing.Optional[CreateAssistantDtoBackgroundSound] = OMIT, - background_denoising_enabled: typing.Optional[bool] = OMIT, model_output_in_messages_enabled: typing.Optional[bool] = OMIT, transport_configurations: typing.Optional[typing.Sequence[TransportConfigurationTwilio]] = OMIT, observability_plan: typing.Optional[LangfuseObservabilityPlan] = OMIT, @@ -167,7 +164,6 @@ def create( background_speech_denoising_plan: typing.Optional[BackgroundSpeechDenoisingPlan] = OMIT, analysis_plan: typing.Optional[AnalysisPlan] = OMIT, artifact_plan: typing.Optional[ArtifactPlan] = OMIT, - message_plan: typing.Optional[MessagePlan] = OMIT, start_speaking_plan: typing.Optional[StartSpeakingPlan] = OMIT, stop_speaking_plan: typing.Optional[StopSpeakingPlan] = OMIT, monitor_plan: typing.Optional[MonitorPlan] = OMIT, @@ -214,12 +210,7 @@ def create( These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transfer-update,transcript,tool-calls,user-interrupted,voice-input,workflow.node.started. You can check the shape of the messages in ClientMessage schema. server_messages : typing.Optional[typing.Sequence[CreateAssistantDtoServerMessagesItem]] - These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema. - - silence_timeout_seconds : typing.Optional[float] - How many seconds of silence to wait before ending the call. Defaults to 30. - - @default 30 + These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,handoff-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema. max_duration_seconds : typing.Optional[float] This is the maximum number of seconds that the call will last. When the call reaches this duration, it will be ended. @@ -230,13 +221,6 @@ def create( This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'. You can also provide a custom sound by providing a URL to an audio file. - background_denoising_enabled : typing.Optional[bool] - This enables filtering of noise and background speech while the user is talking. - - Default `false` while in beta. - - @default false - model_output_in_messages_enabled : typing.Optional[bool] This determines whether the model's output is used in conversation history rather than the transcription of assistant's speech. @@ -300,11 +284,6 @@ def create( artifact_plan : typing.Optional[ArtifactPlan] This is the plan for artifacts generated during assistant's calls. Stored in `call.artifact`. - message_plan : typing.Optional[MessagePlan] - This is the plan for static predefined messages that can be spoken by the assistant during the call, like `idleMessages`. - - Note: `firstMessage`, `voicemailMessage`, and `endCallMessage` are currently at the root level. They will be moved to `messagePlan` in the future, but will remain backwards compatible. - start_speaking_plan : typing.Optional[StartSpeakingPlan] This is the plan for when the assistant should start talking. @@ -373,12 +352,10 @@ def create( ), "clientMessages": client_messages, "serverMessages": server_messages, - "silenceTimeoutSeconds": silence_timeout_seconds, "maxDurationSeconds": max_duration_seconds, "backgroundSound": convert_and_respect_annotation_metadata( object_=background_sound, annotation=CreateAssistantDtoBackgroundSound, direction="write" ), - "backgroundDenoisingEnabled": background_denoising_enabled, "modelOutputInMessagesEnabled": model_output_in_messages_enabled, "transportConfigurations": convert_and_respect_annotation_metadata( object_=transport_configurations, @@ -415,9 +392,6 @@ def create( "artifactPlan": convert_and_respect_annotation_metadata( object_=artifact_plan, annotation=ArtifactPlan, direction="write" ), - "messagePlan": convert_and_respect_annotation_metadata( - object_=message_plan, annotation=MessagePlan, direction="write" - ), "startSpeakingPlan": convert_and_respect_annotation_metadata( object_=start_speaking_plan, annotation=StartSpeakingPlan, direction="write" ), @@ -535,10 +509,8 @@ def update( voicemail_detection: typing.Optional[UpdateAssistantDtoVoicemailDetection] = OMIT, client_messages: typing.Optional[typing.Sequence[UpdateAssistantDtoClientMessagesItem]] = OMIT, server_messages: typing.Optional[typing.Sequence[UpdateAssistantDtoServerMessagesItem]] = OMIT, - silence_timeout_seconds: typing.Optional[float] = OMIT, max_duration_seconds: typing.Optional[float] = OMIT, background_sound: typing.Optional[UpdateAssistantDtoBackgroundSound] = OMIT, - background_denoising_enabled: typing.Optional[bool] = OMIT, model_output_in_messages_enabled: typing.Optional[bool] = OMIT, transport_configurations: typing.Optional[typing.Sequence[TransportConfigurationTwilio]] = OMIT, observability_plan: typing.Optional[LangfuseObservabilityPlan] = OMIT, @@ -553,7 +525,6 @@ def update( background_speech_denoising_plan: typing.Optional[BackgroundSpeechDenoisingPlan] = OMIT, analysis_plan: typing.Optional[AnalysisPlan] = OMIT, artifact_plan: typing.Optional[ArtifactPlan] = OMIT, - message_plan: typing.Optional[MessagePlan] = OMIT, start_speaking_plan: typing.Optional[StartSpeakingPlan] = OMIT, stop_speaking_plan: typing.Optional[StopSpeakingPlan] = OMIT, monitor_plan: typing.Optional[MonitorPlan] = OMIT, @@ -602,12 +573,7 @@ def update( These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transfer-update,transcript,tool-calls,user-interrupted,voice-input,workflow.node.started. You can check the shape of the messages in ClientMessage schema. server_messages : typing.Optional[typing.Sequence[UpdateAssistantDtoServerMessagesItem]] - These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema. - - silence_timeout_seconds : typing.Optional[float] - How many seconds of silence to wait before ending the call. Defaults to 30. - - @default 30 + These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,handoff-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema. max_duration_seconds : typing.Optional[float] This is the maximum number of seconds that the call will last. When the call reaches this duration, it will be ended. @@ -618,13 +584,6 @@ def update( This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'. You can also provide a custom sound by providing a URL to an audio file. - background_denoising_enabled : typing.Optional[bool] - This enables filtering of noise and background speech while the user is talking. - - Default `false` while in beta. - - @default false - model_output_in_messages_enabled : typing.Optional[bool] This determines whether the model's output is used in conversation history rather than the transcription of assistant's speech. @@ -688,11 +647,6 @@ def update( artifact_plan : typing.Optional[ArtifactPlan] This is the plan for artifacts generated during assistant's calls. Stored in `call.artifact`. - message_plan : typing.Optional[MessagePlan] - This is the plan for static predefined messages that can be spoken by the assistant during the call, like `idleMessages`. - - Note: `firstMessage`, `voicemailMessage`, and `endCallMessage` are currently at the root level. They will be moved to `messagePlan` in the future, but will remain backwards compatible. - start_speaking_plan : typing.Optional[StartSpeakingPlan] This is the plan for when the assistant should start talking. @@ -761,12 +715,10 @@ def update( ), "clientMessages": client_messages, "serverMessages": server_messages, - "silenceTimeoutSeconds": silence_timeout_seconds, "maxDurationSeconds": max_duration_seconds, "backgroundSound": convert_and_respect_annotation_metadata( object_=background_sound, annotation=UpdateAssistantDtoBackgroundSound, direction="write" ), - "backgroundDenoisingEnabled": background_denoising_enabled, "modelOutputInMessagesEnabled": model_output_in_messages_enabled, "transportConfigurations": convert_and_respect_annotation_metadata( object_=transport_configurations, @@ -803,9 +755,6 @@ def update( "artifactPlan": convert_and_respect_annotation_metadata( object_=artifact_plan, annotation=ArtifactPlan, direction="write" ), - "messagePlan": convert_and_respect_annotation_metadata( - object_=message_plan, annotation=MessagePlan, direction="write" - ), "startSpeakingPlan": convert_and_respect_annotation_metadata( object_=start_speaking_plan, annotation=StartSpeakingPlan, direction="write" ), @@ -942,10 +891,8 @@ async def create( voicemail_detection: typing.Optional[CreateAssistantDtoVoicemailDetection] = OMIT, client_messages: typing.Optional[typing.Sequence[CreateAssistantDtoClientMessagesItem]] = OMIT, server_messages: typing.Optional[typing.Sequence[CreateAssistantDtoServerMessagesItem]] = OMIT, - silence_timeout_seconds: typing.Optional[float] = OMIT, max_duration_seconds: typing.Optional[float] = OMIT, background_sound: typing.Optional[CreateAssistantDtoBackgroundSound] = OMIT, - background_denoising_enabled: typing.Optional[bool] = OMIT, model_output_in_messages_enabled: typing.Optional[bool] = OMIT, transport_configurations: typing.Optional[typing.Sequence[TransportConfigurationTwilio]] = OMIT, observability_plan: typing.Optional[LangfuseObservabilityPlan] = OMIT, @@ -960,7 +907,6 @@ async def create( background_speech_denoising_plan: typing.Optional[BackgroundSpeechDenoisingPlan] = OMIT, analysis_plan: typing.Optional[AnalysisPlan] = OMIT, artifact_plan: typing.Optional[ArtifactPlan] = OMIT, - message_plan: typing.Optional[MessagePlan] = OMIT, start_speaking_plan: typing.Optional[StartSpeakingPlan] = OMIT, stop_speaking_plan: typing.Optional[StopSpeakingPlan] = OMIT, monitor_plan: typing.Optional[MonitorPlan] = OMIT, @@ -1007,12 +953,7 @@ async def create( These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transfer-update,transcript,tool-calls,user-interrupted,voice-input,workflow.node.started. You can check the shape of the messages in ClientMessage schema. server_messages : typing.Optional[typing.Sequence[CreateAssistantDtoServerMessagesItem]] - These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema. - - silence_timeout_seconds : typing.Optional[float] - How many seconds of silence to wait before ending the call. Defaults to 30. - - @default 30 + These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,handoff-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema. max_duration_seconds : typing.Optional[float] This is the maximum number of seconds that the call will last. When the call reaches this duration, it will be ended. @@ -1023,13 +964,6 @@ async def create( This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'. You can also provide a custom sound by providing a URL to an audio file. - background_denoising_enabled : typing.Optional[bool] - This enables filtering of noise and background speech while the user is talking. - - Default `false` while in beta. - - @default false - model_output_in_messages_enabled : typing.Optional[bool] This determines whether the model's output is used in conversation history rather than the transcription of assistant's speech. @@ -1093,11 +1027,6 @@ async def create( artifact_plan : typing.Optional[ArtifactPlan] This is the plan for artifacts generated during assistant's calls. Stored in `call.artifact`. - message_plan : typing.Optional[MessagePlan] - This is the plan for static predefined messages that can be spoken by the assistant during the call, like `idleMessages`. - - Note: `firstMessage`, `voicemailMessage`, and `endCallMessage` are currently at the root level. They will be moved to `messagePlan` in the future, but will remain backwards compatible. - start_speaking_plan : typing.Optional[StartSpeakingPlan] This is the plan for when the assistant should start talking. @@ -1166,12 +1095,10 @@ async def create( ), "clientMessages": client_messages, "serverMessages": server_messages, - "silenceTimeoutSeconds": silence_timeout_seconds, "maxDurationSeconds": max_duration_seconds, "backgroundSound": convert_and_respect_annotation_metadata( object_=background_sound, annotation=CreateAssistantDtoBackgroundSound, direction="write" ), - "backgroundDenoisingEnabled": background_denoising_enabled, "modelOutputInMessagesEnabled": model_output_in_messages_enabled, "transportConfigurations": convert_and_respect_annotation_metadata( object_=transport_configurations, @@ -1208,9 +1135,6 @@ async def create( "artifactPlan": convert_and_respect_annotation_metadata( object_=artifact_plan, annotation=ArtifactPlan, direction="write" ), - "messagePlan": convert_and_respect_annotation_metadata( - object_=message_plan, annotation=MessagePlan, direction="write" - ), "startSpeakingPlan": convert_and_respect_annotation_metadata( object_=start_speaking_plan, annotation=StartSpeakingPlan, direction="write" ), @@ -1332,10 +1256,8 @@ async def update( voicemail_detection: typing.Optional[UpdateAssistantDtoVoicemailDetection] = OMIT, client_messages: typing.Optional[typing.Sequence[UpdateAssistantDtoClientMessagesItem]] = OMIT, server_messages: typing.Optional[typing.Sequence[UpdateAssistantDtoServerMessagesItem]] = OMIT, - silence_timeout_seconds: typing.Optional[float] = OMIT, max_duration_seconds: typing.Optional[float] = OMIT, background_sound: typing.Optional[UpdateAssistantDtoBackgroundSound] = OMIT, - background_denoising_enabled: typing.Optional[bool] = OMIT, model_output_in_messages_enabled: typing.Optional[bool] = OMIT, transport_configurations: typing.Optional[typing.Sequence[TransportConfigurationTwilio]] = OMIT, observability_plan: typing.Optional[LangfuseObservabilityPlan] = OMIT, @@ -1350,7 +1272,6 @@ async def update( background_speech_denoising_plan: typing.Optional[BackgroundSpeechDenoisingPlan] = OMIT, analysis_plan: typing.Optional[AnalysisPlan] = OMIT, artifact_plan: typing.Optional[ArtifactPlan] = OMIT, - message_plan: typing.Optional[MessagePlan] = OMIT, start_speaking_plan: typing.Optional[StartSpeakingPlan] = OMIT, stop_speaking_plan: typing.Optional[StopSpeakingPlan] = OMIT, monitor_plan: typing.Optional[MonitorPlan] = OMIT, @@ -1399,12 +1320,7 @@ async def update( These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transfer-update,transcript,tool-calls,user-interrupted,voice-input,workflow.node.started. You can check the shape of the messages in ClientMessage schema. server_messages : typing.Optional[typing.Sequence[UpdateAssistantDtoServerMessagesItem]] - These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema. - - silence_timeout_seconds : typing.Optional[float] - How many seconds of silence to wait before ending the call. Defaults to 30. - - @default 30 + These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,handoff-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema. max_duration_seconds : typing.Optional[float] This is the maximum number of seconds that the call will last. When the call reaches this duration, it will be ended. @@ -1415,13 +1331,6 @@ async def update( This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'. You can also provide a custom sound by providing a URL to an audio file. - background_denoising_enabled : typing.Optional[bool] - This enables filtering of noise and background speech while the user is talking. - - Default `false` while in beta. - - @default false - model_output_in_messages_enabled : typing.Optional[bool] This determines whether the model's output is used in conversation history rather than the transcription of assistant's speech. @@ -1485,11 +1394,6 @@ async def update( artifact_plan : typing.Optional[ArtifactPlan] This is the plan for artifacts generated during assistant's calls. Stored in `call.artifact`. - message_plan : typing.Optional[MessagePlan] - This is the plan for static predefined messages that can be spoken by the assistant during the call, like `idleMessages`. - - Note: `firstMessage`, `voicemailMessage`, and `endCallMessage` are currently at the root level. They will be moved to `messagePlan` in the future, but will remain backwards compatible. - start_speaking_plan : typing.Optional[StartSpeakingPlan] This is the plan for when the assistant should start talking. @@ -1558,12 +1462,10 @@ async def update( ), "clientMessages": client_messages, "serverMessages": server_messages, - "silenceTimeoutSeconds": silence_timeout_seconds, "maxDurationSeconds": max_duration_seconds, "backgroundSound": convert_and_respect_annotation_metadata( object_=background_sound, annotation=UpdateAssistantDtoBackgroundSound, direction="write" ), - "backgroundDenoisingEnabled": background_denoising_enabled, "modelOutputInMessagesEnabled": model_output_in_messages_enabled, "transportConfigurations": convert_and_respect_annotation_metadata( object_=transport_configurations, @@ -1600,9 +1502,6 @@ async def update( "artifactPlan": convert_and_respect_annotation_metadata( object_=artifact_plan, annotation=ArtifactPlan, direction="write" ), - "messagePlan": convert_and_respect_annotation_metadata( - object_=message_plan, annotation=MessagePlan, direction="write" - ), "startSpeakingPlan": convert_and_respect_annotation_metadata( object_=start_speaking_plan, annotation=StartSpeakingPlan, direction="write" ), diff --git a/src/vapi/assistants/types/__init__.py b/src/vapi/assistants/types/__init__.py index 40aaa49..6263fbd 100644 --- a/src/vapi/assistants/types/__init__.py +++ b/src/vapi/assistants/types/__init__.py @@ -2,17 +2,54 @@ # isort: skip_file -from .update_assistant_dto_background_sound import UpdateAssistantDtoBackgroundSound -from .update_assistant_dto_background_sound_zero import UpdateAssistantDtoBackgroundSoundZero -from .update_assistant_dto_client_messages_item import UpdateAssistantDtoClientMessagesItem -from .update_assistant_dto_credentials_item import UpdateAssistantDtoCredentialsItem -from .update_assistant_dto_first_message_mode import UpdateAssistantDtoFirstMessageMode -from .update_assistant_dto_hooks_item import UpdateAssistantDtoHooksItem -from .update_assistant_dto_model import UpdateAssistantDtoModel -from .update_assistant_dto_server_messages_item import UpdateAssistantDtoServerMessagesItem -from .update_assistant_dto_transcriber import UpdateAssistantDtoTranscriber -from .update_assistant_dto_voice import UpdateAssistantDtoVoice -from .update_assistant_dto_voicemail_detection import UpdateAssistantDtoVoicemailDetection +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .update_assistant_dto_background_sound import UpdateAssistantDtoBackgroundSound + from .update_assistant_dto_background_sound_zero import UpdateAssistantDtoBackgroundSoundZero + from .update_assistant_dto_client_messages_item import UpdateAssistantDtoClientMessagesItem + from .update_assistant_dto_credentials_item import UpdateAssistantDtoCredentialsItem + from .update_assistant_dto_first_message_mode import UpdateAssistantDtoFirstMessageMode + from .update_assistant_dto_hooks_item import UpdateAssistantDtoHooksItem + from .update_assistant_dto_model import UpdateAssistantDtoModel + from .update_assistant_dto_server_messages_item import UpdateAssistantDtoServerMessagesItem + from .update_assistant_dto_transcriber import UpdateAssistantDtoTranscriber + from .update_assistant_dto_voice import UpdateAssistantDtoVoice + from .update_assistant_dto_voicemail_detection import UpdateAssistantDtoVoicemailDetection +_dynamic_imports: typing.Dict[str, str] = { + "UpdateAssistantDtoBackgroundSound": ".update_assistant_dto_background_sound", + "UpdateAssistantDtoBackgroundSoundZero": ".update_assistant_dto_background_sound_zero", + "UpdateAssistantDtoClientMessagesItem": ".update_assistant_dto_client_messages_item", + "UpdateAssistantDtoCredentialsItem": ".update_assistant_dto_credentials_item", + "UpdateAssistantDtoFirstMessageMode": ".update_assistant_dto_first_message_mode", + "UpdateAssistantDtoHooksItem": ".update_assistant_dto_hooks_item", + "UpdateAssistantDtoModel": ".update_assistant_dto_model", + "UpdateAssistantDtoServerMessagesItem": ".update_assistant_dto_server_messages_item", + "UpdateAssistantDtoTranscriber": ".update_assistant_dto_transcriber", + "UpdateAssistantDtoVoice": ".update_assistant_dto_voice", + "UpdateAssistantDtoVoicemailDetection": ".update_assistant_dto_voicemail_detection", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + __all__ = [ "UpdateAssistantDtoBackgroundSound", diff --git a/src/vapi/assistants/types/update_assistant_dto_credentials_item.py b/src/vapi/assistants/types/update_assistant_dto_credentials_item.py index 11c5467..903968f 100644 --- a/src/vapi/assistants/types/update_assistant_dto_credentials_item.py +++ b/src/vapi/assistants/types/update_assistant_dto_credentials_item.py @@ -11,6 +11,7 @@ from ...types.create_cartesia_credential_dto import CreateCartesiaCredentialDto from ...types.create_cerebras_credential_dto import CreateCerebrasCredentialDto from ...types.create_cloudflare_credential_dto import CreateCloudflareCredentialDto +from ...types.create_custom_credential_dto import CreateCustomCredentialDto from ...types.create_custom_llm_credential_dto import CreateCustomLlmCredentialDto from ...types.create_deep_infra_credential_dto import CreateDeepInfraCredentialDto from ...types.create_deep_seek_credential_dto import CreateDeepSeekCredentialDto @@ -31,9 +32,11 @@ from ...types.create_groq_credential_dto import CreateGroqCredentialDto from ...types.create_hume_credential_dto import CreateHumeCredentialDto from ...types.create_inflection_ai_credential_dto import CreateInflectionAiCredentialDto +from ...types.create_inworld_credential_dto import CreateInworldCredentialDto from ...types.create_langfuse_credential_dto import CreateLangfuseCredentialDto from ...types.create_lmnt_credential_dto import CreateLmntCredentialDto from ...types.create_make_credential_dto import CreateMakeCredentialDto +from ...types.create_minimax_credential_dto import CreateMinimaxCredentialDto from ...types.create_mistral_credential_dto import CreateMistralCredentialDto from ...types.create_neuphonic_credential_dto import CreateNeuphonicCredentialDto from ...types.create_open_ai_credential_dto import CreateOpenAiCredentialDto @@ -93,6 +96,7 @@ CreateTwilioCredentialDto, CreateVonageCredentialDto, CreateWebhookCredentialDto, + CreateCustomCredentialDto, CreateXAiCredentialDto, CreateNeuphonicCredentialDto, CreateHumeCredentialDto, @@ -104,5 +108,6 @@ CreateGoogleSheetsOAuth2AuthorizationCredentialDto, CreateSlackOAuth2AuthorizationCredentialDto, CreateGoHighLevelMcpCredentialDto, - typing.Optional[typing.Any], + CreateInworldCredentialDto, + CreateMinimaxCredentialDto, ] diff --git a/src/vapi/assistants/types/update_assistant_dto_hooks_item.py b/src/vapi/assistants/types/update_assistant_dto_hooks_item.py index a6fba1a..666e3a5 100644 --- a/src/vapi/assistants/types/update_assistant_dto_hooks_item.py +++ b/src/vapi/assistants/types/update_assistant_dto_hooks_item.py @@ -2,10 +2,14 @@ import typing -from ...types.assistant_hook_assistant_speech_interrupted import AssistantHookAssistantSpeechInterrupted -from ...types.assistant_hook_call_ending import AssistantHookCallEnding -from ...types.assistant_hook_customer_speech_interrupted import AssistantHookCustomerSpeechInterrupted +from ...types.call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted +from ...types.call_hook_call_ending import CallHookCallEnding +from ...types.call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted +from ...types.call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout UpdateAssistantDtoHooksItem = typing.Union[ - AssistantHookCallEnding, AssistantHookAssistantSpeechInterrupted, AssistantHookCustomerSpeechInterrupted + CallHookCallEnding, + CallHookAssistantSpeechInterrupted, + CallHookCustomerSpeechInterrupted, + CallHookCustomerSpeechTimeout, ] diff --git a/src/vapi/assistants/types/update_assistant_dto_voice.py b/src/vapi/assistants/types/update_assistant_dto_voice.py index 5e8df37..5805d1e 100644 --- a/src/vapi/assistants/types/update_assistant_dto_voice.py +++ b/src/vapi/assistants/types/update_assistant_dto_voice.py @@ -10,6 +10,7 @@ from ...types.hume_voice import HumeVoice from ...types.inworld_voice import InworldVoice from ...types.lmnt_voice import LmntVoice +from ...types.minimax_voice import MinimaxVoice from ...types.neuphonic_voice import NeuphonicVoice from ...types.open_ai_voice import OpenAiVoice from ...types.play_ht_voice import PlayHtVoice @@ -36,4 +37,5 @@ VapiVoice, SesameVoice, InworldVoice, + MinimaxVoice, ] diff --git a/src/vapi/calls/__init__.py b/src/vapi/calls/__init__.py index b2fdb6f..3d98d88 100644 --- a/src/vapi/calls/__init__.py +++ b/src/vapi/calls/__init__.py @@ -2,6 +2,31 @@ # isort: skip_file -from .types import CallsCreateResponse +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import CallsCreateResponse +_dynamic_imports: typing.Dict[str, str] = {"CallsCreateResponse": ".types"} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + __all__ = ["CallsCreateResponse"] diff --git a/src/vapi/calls/types/__init__.py b/src/vapi/calls/types/__init__.py index 85cc7c2..3706c46 100644 --- a/src/vapi/calls/types/__init__.py +++ b/src/vapi/calls/types/__init__.py @@ -2,6 +2,31 @@ # isort: skip_file -from .calls_create_response import CallsCreateResponse +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .calls_create_response import CallsCreateResponse +_dynamic_imports: typing.Dict[str, str] = {"CallsCreateResponse": ".calls_create_response"} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + __all__ = ["CallsCreateResponse"] diff --git a/src/vapi/campaigns/__init__.py b/src/vapi/campaigns/__init__.py index a571e76..f2102e1 100644 --- a/src/vapi/campaigns/__init__.py +++ b/src/vapi/campaigns/__init__.py @@ -2,6 +2,34 @@ # isort: skip_file -from .types import CampaignControllerFindAllRequestSortOrder, CampaignControllerFindAllRequestStatus +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import CampaignControllerFindAllRequestSortOrder, CampaignControllerFindAllRequestStatus +_dynamic_imports: typing.Dict[str, str] = { + "CampaignControllerFindAllRequestSortOrder": ".types", + "CampaignControllerFindAllRequestStatus": ".types", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + __all__ = ["CampaignControllerFindAllRequestSortOrder", "CampaignControllerFindAllRequestStatus"] diff --git a/src/vapi/campaigns/types/__init__.py b/src/vapi/campaigns/types/__init__.py index bd8215b..451e8ea 100644 --- a/src/vapi/campaigns/types/__init__.py +++ b/src/vapi/campaigns/types/__init__.py @@ -2,7 +2,35 @@ # isort: skip_file -from .campaign_controller_find_all_request_sort_order import CampaignControllerFindAllRequestSortOrder -from .campaign_controller_find_all_request_status import CampaignControllerFindAllRequestStatus +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .campaign_controller_find_all_request_sort_order import CampaignControllerFindAllRequestSortOrder + from .campaign_controller_find_all_request_status import CampaignControllerFindAllRequestStatus +_dynamic_imports: typing.Dict[str, str] = { + "CampaignControllerFindAllRequestSortOrder": ".campaign_controller_find_all_request_sort_order", + "CampaignControllerFindAllRequestStatus": ".campaign_controller_find_all_request_status", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + __all__ = ["CampaignControllerFindAllRequestSortOrder", "CampaignControllerFindAllRequestStatus"] diff --git a/src/vapi/chats/__init__.py b/src/vapi/chats/__init__.py index 86059bb..cdc9072 100644 --- a/src/vapi/chats/__init__.py +++ b/src/vapi/chats/__init__.py @@ -2,15 +2,48 @@ # isort: skip_file -from .types import ( - ChatsCreateResponse, - ChatsCreateResponseResponse, - ChatsListRequestSortOrder, - CreateChatDtoInput, - CreateChatDtoInputItem, - OpenAiResponsesRequestInput, - OpenAiResponsesRequestInputItem, -) +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import ( + ChatsCreateResponse, + ChatsCreateResponseResponse, + ChatsListRequestSortOrder, + CreateChatDtoInput, + CreateChatDtoInputItem, + OpenAiResponsesRequestInput, + OpenAiResponsesRequestInputItem, + ) +_dynamic_imports: typing.Dict[str, str] = { + "ChatsCreateResponse": ".types", + "ChatsCreateResponseResponse": ".types", + "ChatsListRequestSortOrder": ".types", + "CreateChatDtoInput": ".types", + "CreateChatDtoInputItem": ".types", + "OpenAiResponsesRequestInput": ".types", + "OpenAiResponsesRequestInputItem": ".types", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + __all__ = [ "ChatsCreateResponse", diff --git a/src/vapi/chats/types/__init__.py b/src/vapi/chats/types/__init__.py index 3dbe2d1..6b0e2db 100644 --- a/src/vapi/chats/types/__init__.py +++ b/src/vapi/chats/types/__init__.py @@ -2,13 +2,46 @@ # isort: skip_file -from .chats_create_response import ChatsCreateResponse -from .chats_create_response_response import ChatsCreateResponseResponse -from .chats_list_request_sort_order import ChatsListRequestSortOrder -from .create_chat_dto_input import CreateChatDtoInput -from .create_chat_dto_input_item import CreateChatDtoInputItem -from .open_ai_responses_request_input import OpenAiResponsesRequestInput -from .open_ai_responses_request_input_item import OpenAiResponsesRequestInputItem +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .chats_create_response import ChatsCreateResponse + from .chats_create_response_response import ChatsCreateResponseResponse + from .chats_list_request_sort_order import ChatsListRequestSortOrder + from .create_chat_dto_input import CreateChatDtoInput + from .create_chat_dto_input_item import CreateChatDtoInputItem + from .open_ai_responses_request_input import OpenAiResponsesRequestInput + from .open_ai_responses_request_input_item import OpenAiResponsesRequestInputItem +_dynamic_imports: typing.Dict[str, str] = { + "ChatsCreateResponse": ".chats_create_response", + "ChatsCreateResponseResponse": ".chats_create_response_response", + "ChatsListRequestSortOrder": ".chats_list_request_sort_order", + "CreateChatDtoInput": ".create_chat_dto_input", + "CreateChatDtoInputItem": ".create_chat_dto_input_item", + "OpenAiResponsesRequestInput": ".open_ai_responses_request_input", + "OpenAiResponsesRequestInputItem": ".open_ai_responses_request_input_item", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + __all__ = [ "ChatsCreateResponse", diff --git a/src/vapi/client.py b/src/vapi/client.py index e283590..4979b5b 100644 --- a/src/vapi/client.py +++ b/src/vapi/client.py @@ -1,26 +1,26 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import httpx -from .analytics.client import AnalyticsClient, AsyncAnalyticsClient -from .assistants.client import AssistantsClient, AsyncAssistantsClient -from .calls.client import AsyncCallsClient, CallsClient -from .campaigns.client import AsyncCampaignsClient, CampaignsClient -from .chats.client import AsyncChatsClient, ChatsClient from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from .environment import VapiEnvironment -from .files.client import AsyncFilesClient, FilesClient -from .knowledge_bases.client import AsyncKnowledgeBasesClient, KnowledgeBasesClient -from .logs.client import AsyncLogsClient, LogsClient -from .phone_numbers.client import AsyncPhoneNumbersClient, PhoneNumbersClient -from .sessions.client import AsyncSessionsClient, SessionsClient -from .squads.client import AsyncSquadsClient, SquadsClient -from .test_suite_runs.client import AsyncTestSuiteRunsClient, TestSuiteRunsClient -from .test_suite_tests.client import AsyncTestSuiteTestsClient, TestSuiteTestsClient -from .test_suites.client import AsyncTestSuitesClient, TestSuitesClient -from .tools.client import AsyncToolsClient, ToolsClient -from .workflow.client import AsyncWorkflowClient, WorkflowClient + +if typing.TYPE_CHECKING: + from .analytics.client import AnalyticsClient, AsyncAnalyticsClient + from .assistants.client import AssistantsClient, AsyncAssistantsClient + from .calls.client import AsyncCallsClient, CallsClient + from .campaigns.client import AsyncCampaignsClient, CampaignsClient + from .chats.client import AsyncChatsClient, ChatsClient + from .files.client import AsyncFilesClient, FilesClient + from .phone_numbers.client import AsyncPhoneNumbersClient, PhoneNumbersClient + from .provider_resources.client import AsyncProviderResourcesClient, ProviderResourcesClient + from .sessions.client import AsyncSessionsClient, SessionsClient + from .squads.client import AsyncSquadsClient, SquadsClient + from .structured_outputs.client import AsyncStructuredOutputsClient, StructuredOutputsClient + from .tools.client import AsyncToolsClient, ToolsClient class Vapi: @@ -88,22 +88,114 @@ def __init__( else httpx.Client(timeout=_defaulted_timeout), timeout=_defaulted_timeout, ) - self.calls = CallsClient(client_wrapper=self._client_wrapper) - self.chats = ChatsClient(client_wrapper=self._client_wrapper) - self.campaigns = CampaignsClient(client_wrapper=self._client_wrapper) - self.sessions = SessionsClient(client_wrapper=self._client_wrapper) - self.assistants = AssistantsClient(client_wrapper=self._client_wrapper) - self.phone_numbers = PhoneNumbersClient(client_wrapper=self._client_wrapper) - self.tools = ToolsClient(client_wrapper=self._client_wrapper) - self.files = FilesClient(client_wrapper=self._client_wrapper) - self.knowledge_bases = KnowledgeBasesClient(client_wrapper=self._client_wrapper) - self.workflow = WorkflowClient(client_wrapper=self._client_wrapper) - self.squads = SquadsClient(client_wrapper=self._client_wrapper) - self.test_suites = TestSuitesClient(client_wrapper=self._client_wrapper) - self.test_suite_tests = TestSuiteTestsClient(client_wrapper=self._client_wrapper) - self.test_suite_runs = TestSuiteRunsClient(client_wrapper=self._client_wrapper) - self.analytics = AnalyticsClient(client_wrapper=self._client_wrapper) - self.logs = LogsClient(client_wrapper=self._client_wrapper) + self._assistants: typing.Optional[AssistantsClient] = None + self._squads: typing.Optional[SquadsClient] = None + self._calls: typing.Optional[CallsClient] = None + self._chats: typing.Optional[ChatsClient] = None + self._campaigns: typing.Optional[CampaignsClient] = None + self._sessions: typing.Optional[SessionsClient] = None + self._phone_numbers: typing.Optional[PhoneNumbersClient] = None + self._tools: typing.Optional[ToolsClient] = None + self._files: typing.Optional[FilesClient] = None + self._structured_outputs: typing.Optional[StructuredOutputsClient] = None + self._provider_resources: typing.Optional[ProviderResourcesClient] = None + self._analytics: typing.Optional[AnalyticsClient] = None + + @property + def assistants(self): + if self._assistants is None: + from .assistants.client import AssistantsClient # noqa: E402 + + self._assistants = AssistantsClient(client_wrapper=self._client_wrapper) + return self._assistants + + @property + def squads(self): + if self._squads is None: + from .squads.client import SquadsClient # noqa: E402 + + self._squads = SquadsClient(client_wrapper=self._client_wrapper) + return self._squads + + @property + def calls(self): + if self._calls is None: + from .calls.client import CallsClient # noqa: E402 + + self._calls = CallsClient(client_wrapper=self._client_wrapper) + return self._calls + + @property + def chats(self): + if self._chats is None: + from .chats.client import ChatsClient # noqa: E402 + + self._chats = ChatsClient(client_wrapper=self._client_wrapper) + return self._chats + + @property + def campaigns(self): + if self._campaigns is None: + from .campaigns.client import CampaignsClient # noqa: E402 + + self._campaigns = CampaignsClient(client_wrapper=self._client_wrapper) + return self._campaigns + + @property + def sessions(self): + if self._sessions is None: + from .sessions.client import SessionsClient # noqa: E402 + + self._sessions = SessionsClient(client_wrapper=self._client_wrapper) + return self._sessions + + @property + def phone_numbers(self): + if self._phone_numbers is None: + from .phone_numbers.client import PhoneNumbersClient # noqa: E402 + + self._phone_numbers = PhoneNumbersClient(client_wrapper=self._client_wrapper) + return self._phone_numbers + + @property + def tools(self): + if self._tools is None: + from .tools.client import ToolsClient # noqa: E402 + + self._tools = ToolsClient(client_wrapper=self._client_wrapper) + return self._tools + + @property + def files(self): + if self._files is None: + from .files.client import FilesClient # noqa: E402 + + self._files = FilesClient(client_wrapper=self._client_wrapper) + return self._files + + @property + def structured_outputs(self): + if self._structured_outputs is None: + from .structured_outputs.client import StructuredOutputsClient # noqa: E402 + + self._structured_outputs = StructuredOutputsClient(client_wrapper=self._client_wrapper) + return self._structured_outputs + + @property + def provider_resources(self): + if self._provider_resources is None: + from .provider_resources.client import ProviderResourcesClient # noqa: E402 + + self._provider_resources = ProviderResourcesClient(client_wrapper=self._client_wrapper) + return self._provider_resources + + @property + def analytics(self): + if self._analytics is None: + from .analytics.client import AnalyticsClient # noqa: E402 + + self._analytics = AnalyticsClient(client_wrapper=self._client_wrapper) + return self._analytics class AsyncVapi: @@ -171,22 +263,114 @@ def __init__( else httpx.AsyncClient(timeout=_defaulted_timeout), timeout=_defaulted_timeout, ) - self.calls = AsyncCallsClient(client_wrapper=self._client_wrapper) - self.chats = AsyncChatsClient(client_wrapper=self._client_wrapper) - self.campaigns = AsyncCampaignsClient(client_wrapper=self._client_wrapper) - self.sessions = AsyncSessionsClient(client_wrapper=self._client_wrapper) - self.assistants = AsyncAssistantsClient(client_wrapper=self._client_wrapper) - self.phone_numbers = AsyncPhoneNumbersClient(client_wrapper=self._client_wrapper) - self.tools = AsyncToolsClient(client_wrapper=self._client_wrapper) - self.files = AsyncFilesClient(client_wrapper=self._client_wrapper) - self.knowledge_bases = AsyncKnowledgeBasesClient(client_wrapper=self._client_wrapper) - self.workflow = AsyncWorkflowClient(client_wrapper=self._client_wrapper) - self.squads = AsyncSquadsClient(client_wrapper=self._client_wrapper) - self.test_suites = AsyncTestSuitesClient(client_wrapper=self._client_wrapper) - self.test_suite_tests = AsyncTestSuiteTestsClient(client_wrapper=self._client_wrapper) - self.test_suite_runs = AsyncTestSuiteRunsClient(client_wrapper=self._client_wrapper) - self.analytics = AsyncAnalyticsClient(client_wrapper=self._client_wrapper) - self.logs = AsyncLogsClient(client_wrapper=self._client_wrapper) + self._assistants: typing.Optional[AsyncAssistantsClient] = None + self._squads: typing.Optional[AsyncSquadsClient] = None + self._calls: typing.Optional[AsyncCallsClient] = None + self._chats: typing.Optional[AsyncChatsClient] = None + self._campaigns: typing.Optional[AsyncCampaignsClient] = None + self._sessions: typing.Optional[AsyncSessionsClient] = None + self._phone_numbers: typing.Optional[AsyncPhoneNumbersClient] = None + self._tools: typing.Optional[AsyncToolsClient] = None + self._files: typing.Optional[AsyncFilesClient] = None + self._structured_outputs: typing.Optional[AsyncStructuredOutputsClient] = None + self._provider_resources: typing.Optional[AsyncProviderResourcesClient] = None + self._analytics: typing.Optional[AsyncAnalyticsClient] = None + + @property + def assistants(self): + if self._assistants is None: + from .assistants.client import AsyncAssistantsClient # noqa: E402 + + self._assistants = AsyncAssistantsClient(client_wrapper=self._client_wrapper) + return self._assistants + + @property + def squads(self): + if self._squads is None: + from .squads.client import AsyncSquadsClient # noqa: E402 + + self._squads = AsyncSquadsClient(client_wrapper=self._client_wrapper) + return self._squads + + @property + def calls(self): + if self._calls is None: + from .calls.client import AsyncCallsClient # noqa: E402 + + self._calls = AsyncCallsClient(client_wrapper=self._client_wrapper) + return self._calls + + @property + def chats(self): + if self._chats is None: + from .chats.client import AsyncChatsClient # noqa: E402 + + self._chats = AsyncChatsClient(client_wrapper=self._client_wrapper) + return self._chats + + @property + def campaigns(self): + if self._campaigns is None: + from .campaigns.client import AsyncCampaignsClient # noqa: E402 + + self._campaigns = AsyncCampaignsClient(client_wrapper=self._client_wrapper) + return self._campaigns + + @property + def sessions(self): + if self._sessions is None: + from .sessions.client import AsyncSessionsClient # noqa: E402 + + self._sessions = AsyncSessionsClient(client_wrapper=self._client_wrapper) + return self._sessions + + @property + def phone_numbers(self): + if self._phone_numbers is None: + from .phone_numbers.client import AsyncPhoneNumbersClient # noqa: E402 + + self._phone_numbers = AsyncPhoneNumbersClient(client_wrapper=self._client_wrapper) + return self._phone_numbers + + @property + def tools(self): + if self._tools is None: + from .tools.client import AsyncToolsClient # noqa: E402 + + self._tools = AsyncToolsClient(client_wrapper=self._client_wrapper) + return self._tools + + @property + def files(self): + if self._files is None: + from .files.client import AsyncFilesClient # noqa: E402 + + self._files = AsyncFilesClient(client_wrapper=self._client_wrapper) + return self._files + + @property + def structured_outputs(self): + if self._structured_outputs is None: + from .structured_outputs.client import AsyncStructuredOutputsClient # noqa: E402 + + self._structured_outputs = AsyncStructuredOutputsClient(client_wrapper=self._client_wrapper) + return self._structured_outputs + + @property + def provider_resources(self): + if self._provider_resources is None: + from .provider_resources.client import AsyncProviderResourcesClient # noqa: E402 + + self._provider_resources = AsyncProviderResourcesClient(client_wrapper=self._client_wrapper) + return self._provider_resources + + @property + def analytics(self): + if self._analytics is None: + from .analytics.client import AsyncAnalyticsClient # noqa: E402 + + self._analytics = AsyncAnalyticsClient(client_wrapper=self._client_wrapper) + return self._analytics def _get_base_url(*, base_url: typing.Optional[str] = None, environment: VapiEnvironment) -> str: diff --git a/src/vapi/core/__init__.py b/src/vapi/core/__init__.py index 4bb6c84..1822852 100644 --- a/src/vapi/core/__init__.py +++ b/src/vapi/core/__init__.py @@ -1 +1,110 @@ -from .file import File, convert_file_dict_to_httpx_tuples, with_content_type \ No newline at end of file +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .api_error import ApiError + from .client_wrapper import AsyncClientWrapper, BaseClientWrapper, SyncClientWrapper + from .datetime_utils import serialize_datetime + from .file import File, convert_file_dict_to_httpx_tuples, with_content_type + from .http_client import AsyncHttpClient, HttpClient + from .http_response import AsyncHttpResponse, HttpResponse + from .jsonable_encoder import jsonable_encoder + from .pydantic_utilities import ( + IS_PYDANTIC_V2, + UniversalBaseModel, + UniversalRootModel, + parse_obj_as, + universal_field_validator, + universal_root_validator, + update_forward_refs, + ) + from .query_encoder import encode_query + from .remove_none_from_dict import remove_none_from_dict + from .request_options import RequestOptions + from .serialization import FieldMetadata, convert_and_respect_annotation_metadata + from .unchecked_base_model import UncheckedBaseModel, UnionMetadata, construct_type +_dynamic_imports: typing.Dict[str, str] = { + "ApiError": ".api_error", + "AsyncClientWrapper": ".client_wrapper", + "AsyncHttpClient": ".http_client", + "AsyncHttpResponse": ".http_response", + "BaseClientWrapper": ".client_wrapper", + "FieldMetadata": ".serialization", + "File": ".file", + "HttpClient": ".http_client", + "HttpResponse": ".http_response", + "IS_PYDANTIC_V2": ".pydantic_utilities", + "RequestOptions": ".request_options", + "SyncClientWrapper": ".client_wrapper", + "UncheckedBaseModel": ".unchecked_base_model", + "UnionMetadata": ".unchecked_base_model", + "UniversalBaseModel": ".pydantic_utilities", + "UniversalRootModel": ".pydantic_utilities", + "construct_type": ".unchecked_base_model", + "convert_and_respect_annotation_metadata": ".serialization", + "convert_file_dict_to_httpx_tuples": ".file", + "encode_query": ".query_encoder", + "jsonable_encoder": ".jsonable_encoder", + "parse_obj_as": ".pydantic_utilities", + "remove_none_from_dict": ".remove_none_from_dict", + "serialize_datetime": ".datetime_utils", + "universal_field_validator": ".pydantic_utilities", + "universal_root_validator": ".pydantic_utilities", + "update_forward_refs": ".pydantic_utilities", + "with_content_type": ".file", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = [ + "ApiError", + "AsyncClientWrapper", + "AsyncHttpClient", + "AsyncHttpResponse", + "BaseClientWrapper", + "FieldMetadata", + "File", + "HttpClient", + "HttpResponse", + "IS_PYDANTIC_V2", + "RequestOptions", + "SyncClientWrapper", + "UncheckedBaseModel", + "UnionMetadata", + "UniversalBaseModel", + "UniversalRootModel", + "construct_type", + "convert_and_respect_annotation_metadata", + "convert_file_dict_to_httpx_tuples", + "encode_query", + "jsonable_encoder", + "parse_obj_as", + "remove_none_from_dict", + "serialize_datetime", + "universal_field_validator", + "universal_root_validator", + "update_forward_refs", + "with_content_type", +] diff --git a/src/vapi/core/client_wrapper.py b/src/vapi/core/client_wrapper.py index 1d126cc..1689300 100644 --- a/src/vapi/core/client_wrapper.py +++ b/src/vapi/core/client_wrapper.py @@ -22,10 +22,10 @@ def __init__( def get_headers(self) -> typing.Dict[str, str]: headers: typing.Dict[str, str] = { - "User-Agent": "vapi_server_sdk/1.7.0", + "User-Agent": "vapi_server_sdk/1.7.1", "X-Fern-Language": "Python", "X-Fern-SDK-Name": "vapi_server_sdk", - "X-Fern-SDK-Version": "1.7.0", + "X-Fern-SDK-Version": "1.7.1", **(self.get_custom_headers() or {}), } headers["Authorization"] = f"Bearer {self._get_token()}" diff --git a/src/vapi/core/force_multipart.py b/src/vapi/core/force_multipart.py index ae24ccf..5440913 100644 --- a/src/vapi/core/force_multipart.py +++ b/src/vapi/core/force_multipart.py @@ -1,7 +1,9 @@ # This file was auto-generated by Fern from our API Definition. +from typing import Any, Dict -class ForceMultipartDict(dict): + +class ForceMultipartDict(Dict[str, Any]): """ A dictionary subclass that always evaluates to True in boolean contexts. @@ -9,7 +11,7 @@ class ForceMultipartDict(dict): the dictionary is empty, which would normally evaluate to False. """ - def __bool__(self): + def __bool__(self) -> bool: return True diff --git a/src/vapi/core/http_response.py b/src/vapi/core/http_response.py index 48a1798..2479747 100644 --- a/src/vapi/core/http_response.py +++ b/src/vapi/core/http_response.py @@ -4,8 +4,8 @@ import httpx +# Generic to represent the underlying type of the data wrapped by the HTTP response. T = TypeVar("T") -"""Generic to represent the underlying type of the data wrapped by the HTTP response.""" class BaseHttpResponse: diff --git a/src/vapi/core/pagination.py b/src/vapi/core/pagination.py deleted file mode 100644 index 209a1ff..0000000 --- a/src/vapi/core/pagination.py +++ /dev/null @@ -1,82 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from __future__ import annotations - -from dataclasses import dataclass -from typing import AsyncIterator, Awaitable, Callable, Generic, Iterator, List, Optional, TypeVar - -from .http_response import BaseHttpResponse - -T = TypeVar("T") -"""Generic to represent the underlying type of the results within a page""" - - -# SDKs implement a Page ABC per-pagination request, the endpoint then returns a pager that wraps this type -# for example, an endpoint will return SyncPager[UserPage] where UserPage implements the Page ABC. ex: -# -# SyncPager( -# has_next=response.list_metadata.after is not None, -# items=response.data, -# # This should be the outer function that returns the SyncPager again -# get_next=lambda: list(..., cursor: response.cursor) (or list(..., offset: offset + 1)) -# ) - - -@dataclass(frozen=True) -class SyncPager(Generic[T]): - get_next: Optional[Callable[[], Optional[SyncPager[T]]]] - has_next: bool - items: Optional[List[T]] - response: Optional[BaseHttpResponse] - - # Here we type ignore the iterator to avoid a mypy error - # caused by the type conflict with Pydanitc's __iter__ method - # brought in by extending the base model - def __iter__(self) -> Iterator[T]: # type: ignore[override] - for page in self.iter_pages(): - if page.items is not None: - yield from page.items - - def iter_pages(self) -> Iterator[SyncPager[T]]: - page: Optional[SyncPager[T]] = self - while page is not None: - yield page - - if not page.has_next or page.get_next is None: - return - - page = page.get_next() - if page is None or page.items is None or len(page.items) == 0: - return - - def next_page(self) -> Optional[SyncPager[T]]: - return self.get_next() if self.get_next is not None else None - - -@dataclass(frozen=True) -class AsyncPager(Generic[T]): - get_next: Optional[Callable[[], Awaitable[Optional[AsyncPager[T]]]]] - has_next: bool - items: Optional[List[T]] - response: Optional[BaseHttpResponse] - - async def __aiter__(self) -> AsyncIterator[T]: - async for page in self.iter_pages(): - if page.items is not None: - for item in page.items: - yield item - - async def iter_pages(self) -> AsyncIterator[AsyncPager[T]]: - page: Optional[AsyncPager[T]] = self - while page is not None: - yield page - - if not page.has_next or page.get_next is None: - return - - page = await page.get_next() - if page is None or page.items is None or len(page.items) == 0: - return - - async def next_page(self) -> Optional[AsyncPager[T]]: - return await self.get_next() if self.get_next is not None else None diff --git a/src/vapi/core/pydantic_utilities.py b/src/vapi/core/pydantic_utilities.py index 7db2950..dd7d89f 100644 --- a/src/vapi/core/pydantic_utilities.py +++ b/src/vapi/core/pydantic_utilities.py @@ -61,7 +61,7 @@ class UniversalBaseModel(pydantic.BaseModel): @pydantic.model_serializer(mode="plain", when_used="json") # type: ignore[attr-defined] def serialize_model(self) -> Any: # type: ignore[name-defined] - serialized = self.model_dump() + serialized = self.model_dump() # type: ignore[attr-defined] data = {k: serialize_datetime(v) if isinstance(v, dt.datetime) else v for k, v in serialized.items()} return data @@ -147,7 +147,10 @@ def dict(self, **kwargs: Any) -> Dict[str, Any]: dict_dump = super().dict(**kwargs_with_defaults_exclude_unset_include_fields) - return convert_and_respect_annotation_metadata(object_=dict_dump, annotation=self.__class__, direction="write") + return cast( + Dict[str, Any], + convert_and_respect_annotation_metadata(object_=dict_dump, annotation=self.__class__, direction="write"), + ) def _union_list_of_pydantic_dicts(source: List[Any], destination: List[Any]) -> List[Any]: diff --git a/src/vapi/core/unchecked_base_model.py b/src/vapi/core/unchecked_base_model.py index 2c2d92a..ae59845 100644 --- a/src/vapi/core/unchecked_base_model.py +++ b/src/vapi/core/unchecked_base_model.py @@ -124,12 +124,50 @@ def construct( return m +def _validate_collection_items_compatible(collection: typing.Any, target_type: typing.Type[typing.Any]) -> bool: + """ + Validate that all items in a collection are compatible with the target type. + + Args: + collection: The collection to validate (list, set, or dict values) + target_type: The target type to validate against + + Returns: + True if all items are compatible, False otherwise + """ + if inspect.isclass(target_type) and issubclass(target_type, pydantic.BaseModel): + for item in collection: + try: + # Try to validate the item against the target type + if isinstance(item, dict): + parse_obj_as(target_type, item) + else: + # If it's not a dict, it might already be the right type + if not isinstance(item, target_type): + return False + except Exception: + return False + return True + + def _convert_undiscriminated_union_type(union_type: typing.Type[typing.Any], object_: typing.Any) -> typing.Any: inner_types = get_args(union_type) if typing.Any in inner_types: return object_ for inner_type in inner_types: + # Handle lists of objects that need parsing + if get_origin(inner_type) is list and isinstance(object_, list): + list_inner_type = get_args(inner_type)[0] + try: + if inspect.isclass(list_inner_type) and issubclass(list_inner_type, pydantic.BaseModel): + # Validate that all items in the list are compatible with the target type + if _validate_collection_items_compatible(object_, list_inner_type): + parsed_list = [parse_obj_as(object_=item, type_=list_inner_type) for item in object_] + return parsed_list + except Exception: + pass + try: if inspect.isclass(inner_type) and issubclass(inner_type, pydantic.BaseModel): # Attempt a validated parse until one works @@ -148,7 +186,7 @@ def _convert_undiscriminated_union_type(union_type: typing.Type[typing.Any], obj def _convert_union_type(type_: typing.Type[typing.Any], object_: typing.Any) -> typing.Any: base_type = get_origin(type_) or type_ union_type = type_ - if base_type == typing_extensions.Annotated: + if base_type == typing_extensions.Annotated: # type: ignore[comparison-overlap] union_type = get_args(type_)[0] annotated_metadata = get_args(type_)[1:] for metadata in annotated_metadata: @@ -179,11 +217,11 @@ def construct_type(*, type_: typing.Type[typing.Any], object_: typing.Any) -> ty return None base_type = get_origin(type_) or type_ - is_annotated = base_type == typing_extensions.Annotated + is_annotated = base_type == typing_extensions.Annotated # type: ignore[comparison-overlap] maybe_annotation_members = get_args(type_) is_annotated_union = is_annotated and is_union(get_origin(maybe_annotation_members[0])) - if base_type == typing.Any: + if base_type == typing.Any: # type: ignore[comparison-overlap] return object_ if base_type == dict: diff --git a/src/vapi/errors/__init__.py b/src/vapi/errors/__init__.py index f5e4144..0bb98d6 100644 --- a/src/vapi/errors/__init__.py +++ b/src/vapi/errors/__init__.py @@ -2,6 +2,32 @@ # isort: skip_file -from .bad_request_error import BadRequestError +import typing +from importlib import import_module -__all__ = ["BadRequestError"] +if typing.TYPE_CHECKING: + from .bad_request_error import BadRequestError + from .not_found_error import NotFoundError +_dynamic_imports: typing.Dict[str, str] = {"BadRequestError": ".bad_request_error", "NotFoundError": ".not_found_error"} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = ["BadRequestError", "NotFoundError"] diff --git a/src/vapi/errors/not_found_error.py b/src/vapi/errors/not_found_error.py new file mode 100644 index 0000000..dcd60e3 --- /dev/null +++ b/src/vapi/errors/not_found_error.py @@ -0,0 +1,10 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from ..core.api_error import ApiError + + +class NotFoundError(ApiError): + def __init__(self, body: typing.Optional[typing.Any], headers: typing.Optional[typing.Dict[str, str]] = None): + super().__init__(status_code=404, headers=headers, body=body) diff --git a/src/vapi/knowledge_bases/__init__.py b/src/vapi/knowledge_bases/__init__.py deleted file mode 100644 index 65eb332..0000000 --- a/src/vapi/knowledge_bases/__init__.py +++ /dev/null @@ -1,23 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - -from .types import ( - KnowledgeBasesCreateRequest, - KnowledgeBasesCreateResponse, - KnowledgeBasesDeleteResponse, - KnowledgeBasesGetResponse, - KnowledgeBasesListResponseItem, - KnowledgeBasesUpdateRequest, - KnowledgeBasesUpdateResponse, -) - -__all__ = [ - "KnowledgeBasesCreateRequest", - "KnowledgeBasesCreateResponse", - "KnowledgeBasesDeleteResponse", - "KnowledgeBasesGetResponse", - "KnowledgeBasesListResponseItem", - "KnowledgeBasesUpdateRequest", - "KnowledgeBasesUpdateResponse", -] diff --git a/src/vapi/knowledge_bases/client.py b/src/vapi/knowledge_bases/client.py deleted file mode 100644 index accd728..0000000 --- a/src/vapi/knowledge_bases/client.py +++ /dev/null @@ -1,484 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.request_options import RequestOptions -from .raw_client import AsyncRawKnowledgeBasesClient, RawKnowledgeBasesClient -from .types.knowledge_bases_create_request import KnowledgeBasesCreateRequest -from .types.knowledge_bases_create_response import KnowledgeBasesCreateResponse -from .types.knowledge_bases_delete_response import KnowledgeBasesDeleteResponse -from .types.knowledge_bases_get_response import KnowledgeBasesGetResponse -from .types.knowledge_bases_list_response_item import KnowledgeBasesListResponseItem -from .types.knowledge_bases_update_request import KnowledgeBasesUpdateRequest -from .types.knowledge_bases_update_response import KnowledgeBasesUpdateResponse - -# this is used as the default value for optional parameters -OMIT = typing.cast(typing.Any, ...) - - -class KnowledgeBasesClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._raw_client = RawKnowledgeBasesClient(client_wrapper=client_wrapper) - - @property - def with_raw_response(self) -> RawKnowledgeBasesClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - RawKnowledgeBasesClient - """ - return self._raw_client - - def list( - self, - *, - limit: typing.Optional[float] = None, - created_at_gt: typing.Optional[dt.datetime] = None, - created_at_lt: typing.Optional[dt.datetime] = None, - created_at_ge: typing.Optional[dt.datetime] = None, - created_at_le: typing.Optional[dt.datetime] = None, - updated_at_gt: typing.Optional[dt.datetime] = None, - updated_at_lt: typing.Optional[dt.datetime] = None, - updated_at_ge: typing.Optional[dt.datetime] = None, - updated_at_le: typing.Optional[dt.datetime] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> typing.List[KnowledgeBasesListResponseItem]: - """ - Parameters - ---------- - limit : typing.Optional[float] - This is the maximum number of items to return. Defaults to 100. - - created_at_gt : typing.Optional[dt.datetime] - This will return items where the createdAt is greater than the specified value. - - created_at_lt : typing.Optional[dt.datetime] - This will return items where the createdAt is less than the specified value. - - created_at_ge : typing.Optional[dt.datetime] - This will return items where the createdAt is greater than or equal to the specified value. - - created_at_le : typing.Optional[dt.datetime] - This will return items where the createdAt is less than or equal to the specified value. - - updated_at_gt : typing.Optional[dt.datetime] - This will return items where the updatedAt is greater than the specified value. - - updated_at_lt : typing.Optional[dt.datetime] - This will return items where the updatedAt is less than the specified value. - - updated_at_ge : typing.Optional[dt.datetime] - This will return items where the updatedAt is greater than or equal to the specified value. - - updated_at_le : typing.Optional[dt.datetime] - This will return items where the updatedAt is less than or equal to the specified value. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - typing.List[KnowledgeBasesListResponseItem] - - - Examples - -------- - from vapi import Vapi - - client = Vapi( - token="YOUR_TOKEN", - ) - client.knowledge_bases.list() - """ - _response = self._raw_client.list( - limit=limit, - created_at_gt=created_at_gt, - created_at_lt=created_at_lt, - created_at_ge=created_at_ge, - created_at_le=created_at_le, - updated_at_gt=updated_at_gt, - updated_at_lt=updated_at_lt, - updated_at_ge=updated_at_ge, - updated_at_le=updated_at_le, - request_options=request_options, - ) - return _response.data - - def create( - self, *, request: KnowledgeBasesCreateRequest, request_options: typing.Optional[RequestOptions] = None - ) -> KnowledgeBasesCreateResponse: - """ - Parameters - ---------- - request : KnowledgeBasesCreateRequest - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - KnowledgeBasesCreateResponse - - - Examples - -------- - from vapi import CreateTrieveKnowledgeBaseDto, Vapi - - client = Vapi( - token="YOUR_TOKEN", - ) - client.knowledge_bases.create( - request=CreateTrieveKnowledgeBaseDto(), - ) - """ - _response = self._raw_client.create(request=request, request_options=request_options) - return _response.data - - def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> KnowledgeBasesGetResponse: - """ - Parameters - ---------- - id : str - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - KnowledgeBasesGetResponse - - - Examples - -------- - from vapi import Vapi - - client = Vapi( - token="YOUR_TOKEN", - ) - client.knowledge_bases.get( - id="id", - ) - """ - _response = self._raw_client.get(id, request_options=request_options) - return _response.data - - def delete( - self, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> KnowledgeBasesDeleteResponse: - """ - Parameters - ---------- - id : str - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - KnowledgeBasesDeleteResponse - - - Examples - -------- - from vapi import Vapi - - client = Vapi( - token="YOUR_TOKEN", - ) - client.knowledge_bases.delete( - id="id", - ) - """ - _response = self._raw_client.delete(id, request_options=request_options) - return _response.data - - def update( - self, id: str, *, request: KnowledgeBasesUpdateRequest, request_options: typing.Optional[RequestOptions] = None - ) -> KnowledgeBasesUpdateResponse: - """ - Parameters - ---------- - id : str - - request : KnowledgeBasesUpdateRequest - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - KnowledgeBasesUpdateResponse - - - Examples - -------- - from vapi import UpdateTrieveKnowledgeBaseDto, Vapi - - client = Vapi( - token="YOUR_TOKEN", - ) - client.knowledge_bases.update( - id="id", - request=UpdateTrieveKnowledgeBaseDto(), - ) - """ - _response = self._raw_client.update(id, request=request, request_options=request_options) - return _response.data - - -class AsyncKnowledgeBasesClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._raw_client = AsyncRawKnowledgeBasesClient(client_wrapper=client_wrapper) - - @property - def with_raw_response(self) -> AsyncRawKnowledgeBasesClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - AsyncRawKnowledgeBasesClient - """ - return self._raw_client - - async def list( - self, - *, - limit: typing.Optional[float] = None, - created_at_gt: typing.Optional[dt.datetime] = None, - created_at_lt: typing.Optional[dt.datetime] = None, - created_at_ge: typing.Optional[dt.datetime] = None, - created_at_le: typing.Optional[dt.datetime] = None, - updated_at_gt: typing.Optional[dt.datetime] = None, - updated_at_lt: typing.Optional[dt.datetime] = None, - updated_at_ge: typing.Optional[dt.datetime] = None, - updated_at_le: typing.Optional[dt.datetime] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> typing.List[KnowledgeBasesListResponseItem]: - """ - Parameters - ---------- - limit : typing.Optional[float] - This is the maximum number of items to return. Defaults to 100. - - created_at_gt : typing.Optional[dt.datetime] - This will return items where the createdAt is greater than the specified value. - - created_at_lt : typing.Optional[dt.datetime] - This will return items where the createdAt is less than the specified value. - - created_at_ge : typing.Optional[dt.datetime] - This will return items where the createdAt is greater than or equal to the specified value. - - created_at_le : typing.Optional[dt.datetime] - This will return items where the createdAt is less than or equal to the specified value. - - updated_at_gt : typing.Optional[dt.datetime] - This will return items where the updatedAt is greater than the specified value. - - updated_at_lt : typing.Optional[dt.datetime] - This will return items where the updatedAt is less than the specified value. - - updated_at_ge : typing.Optional[dt.datetime] - This will return items where the updatedAt is greater than or equal to the specified value. - - updated_at_le : typing.Optional[dt.datetime] - This will return items where the updatedAt is less than or equal to the specified value. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - typing.List[KnowledgeBasesListResponseItem] - - - Examples - -------- - import asyncio - - from vapi import AsyncVapi - - client = AsyncVapi( - token="YOUR_TOKEN", - ) - - - async def main() -> None: - await client.knowledge_bases.list() - - - asyncio.run(main()) - """ - _response = await self._raw_client.list( - limit=limit, - created_at_gt=created_at_gt, - created_at_lt=created_at_lt, - created_at_ge=created_at_ge, - created_at_le=created_at_le, - updated_at_gt=updated_at_gt, - updated_at_lt=updated_at_lt, - updated_at_ge=updated_at_ge, - updated_at_le=updated_at_le, - request_options=request_options, - ) - return _response.data - - async def create( - self, *, request: KnowledgeBasesCreateRequest, request_options: typing.Optional[RequestOptions] = None - ) -> KnowledgeBasesCreateResponse: - """ - Parameters - ---------- - request : KnowledgeBasesCreateRequest - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - KnowledgeBasesCreateResponse - - - Examples - -------- - import asyncio - - from vapi import AsyncVapi, CreateTrieveKnowledgeBaseDto - - client = AsyncVapi( - token="YOUR_TOKEN", - ) - - - async def main() -> None: - await client.knowledge_bases.create( - request=CreateTrieveKnowledgeBaseDto(), - ) - - - asyncio.run(main()) - """ - _response = await self._raw_client.create(request=request, request_options=request_options) - return _response.data - - async def get( - self, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> KnowledgeBasesGetResponse: - """ - Parameters - ---------- - id : str - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - KnowledgeBasesGetResponse - - - Examples - -------- - import asyncio - - from vapi import AsyncVapi - - client = AsyncVapi( - token="YOUR_TOKEN", - ) - - - async def main() -> None: - await client.knowledge_bases.get( - id="id", - ) - - - asyncio.run(main()) - """ - _response = await self._raw_client.get(id, request_options=request_options) - return _response.data - - async def delete( - self, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> KnowledgeBasesDeleteResponse: - """ - Parameters - ---------- - id : str - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - KnowledgeBasesDeleteResponse - - - Examples - -------- - import asyncio - - from vapi import AsyncVapi - - client = AsyncVapi( - token="YOUR_TOKEN", - ) - - - async def main() -> None: - await client.knowledge_bases.delete( - id="id", - ) - - - asyncio.run(main()) - """ - _response = await self._raw_client.delete(id, request_options=request_options) - return _response.data - - async def update( - self, id: str, *, request: KnowledgeBasesUpdateRequest, request_options: typing.Optional[RequestOptions] = None - ) -> KnowledgeBasesUpdateResponse: - """ - Parameters - ---------- - id : str - - request : KnowledgeBasesUpdateRequest - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - KnowledgeBasesUpdateResponse - - - Examples - -------- - import asyncio - - from vapi import AsyncVapi, UpdateTrieveKnowledgeBaseDto - - client = AsyncVapi( - token="YOUR_TOKEN", - ) - - - async def main() -> None: - await client.knowledge_bases.update( - id="id", - request=UpdateTrieveKnowledgeBaseDto(), - ) - - - asyncio.run(main()) - """ - _response = await self._raw_client.update(id, request=request, request_options=request_options) - return _response.data diff --git a/src/vapi/knowledge_bases/raw_client.py b/src/vapi/knowledge_bases/raw_client.py deleted file mode 100644 index 710e156..0000000 --- a/src/vapi/knowledge_bases/raw_client.py +++ /dev/null @@ -1,520 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing -from json.decoder import JSONDecodeError - -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.datetime_utils import serialize_datetime -from ..core.http_response import AsyncHttpResponse, HttpResponse -from ..core.jsonable_encoder import jsonable_encoder -from ..core.request_options import RequestOptions -from ..core.serialization import convert_and_respect_annotation_metadata -from ..core.unchecked_base_model import construct_type -from .types.knowledge_bases_create_request import KnowledgeBasesCreateRequest -from .types.knowledge_bases_create_response import KnowledgeBasesCreateResponse -from .types.knowledge_bases_delete_response import KnowledgeBasesDeleteResponse -from .types.knowledge_bases_get_response import KnowledgeBasesGetResponse -from .types.knowledge_bases_list_response_item import KnowledgeBasesListResponseItem -from .types.knowledge_bases_update_request import KnowledgeBasesUpdateRequest -from .types.knowledge_bases_update_response import KnowledgeBasesUpdateResponse - -# this is used as the default value for optional parameters -OMIT = typing.cast(typing.Any, ...) - - -class RawKnowledgeBasesClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._client_wrapper = client_wrapper - - def list( - self, - *, - limit: typing.Optional[float] = None, - created_at_gt: typing.Optional[dt.datetime] = None, - created_at_lt: typing.Optional[dt.datetime] = None, - created_at_ge: typing.Optional[dt.datetime] = None, - created_at_le: typing.Optional[dt.datetime] = None, - updated_at_gt: typing.Optional[dt.datetime] = None, - updated_at_lt: typing.Optional[dt.datetime] = None, - updated_at_ge: typing.Optional[dt.datetime] = None, - updated_at_le: typing.Optional[dt.datetime] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[typing.List[KnowledgeBasesListResponseItem]]: - """ - Parameters - ---------- - limit : typing.Optional[float] - This is the maximum number of items to return. Defaults to 100. - - created_at_gt : typing.Optional[dt.datetime] - This will return items where the createdAt is greater than the specified value. - - created_at_lt : typing.Optional[dt.datetime] - This will return items where the createdAt is less than the specified value. - - created_at_ge : typing.Optional[dt.datetime] - This will return items where the createdAt is greater than or equal to the specified value. - - created_at_le : typing.Optional[dt.datetime] - This will return items where the createdAt is less than or equal to the specified value. - - updated_at_gt : typing.Optional[dt.datetime] - This will return items where the updatedAt is greater than the specified value. - - updated_at_lt : typing.Optional[dt.datetime] - This will return items where the updatedAt is less than the specified value. - - updated_at_ge : typing.Optional[dt.datetime] - This will return items where the updatedAt is greater than or equal to the specified value. - - updated_at_le : typing.Optional[dt.datetime] - This will return items where the updatedAt is less than or equal to the specified value. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[typing.List[KnowledgeBasesListResponseItem]] - - """ - _response = self._client_wrapper.httpx_client.request( - "knowledge-base", - method="GET", - params={ - "limit": limit, - "createdAtGt": serialize_datetime(created_at_gt) if created_at_gt is not None else None, - "createdAtLt": serialize_datetime(created_at_lt) if created_at_lt is not None else None, - "createdAtGe": serialize_datetime(created_at_ge) if created_at_ge is not None else None, - "createdAtLe": serialize_datetime(created_at_le) if created_at_le is not None else None, - "updatedAtGt": serialize_datetime(updated_at_gt) if updated_at_gt is not None else None, - "updatedAtLt": serialize_datetime(updated_at_lt) if updated_at_lt is not None else None, - "updatedAtGe": serialize_datetime(updated_at_ge) if updated_at_ge is not None else None, - "updatedAtLe": serialize_datetime(updated_at_le) if updated_at_le is not None else None, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - typing.List[KnowledgeBasesListResponseItem], - construct_type( - type_=typing.List[KnowledgeBasesListResponseItem], # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def create( - self, *, request: KnowledgeBasesCreateRequest, request_options: typing.Optional[RequestOptions] = None - ) -> HttpResponse[KnowledgeBasesCreateResponse]: - """ - Parameters - ---------- - request : KnowledgeBasesCreateRequest - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[KnowledgeBasesCreateResponse] - - """ - _response = self._client_wrapper.httpx_client.request( - "knowledge-base", - method="POST", - json=convert_and_respect_annotation_metadata( - object_=request, annotation=KnowledgeBasesCreateRequest, direction="write" - ), - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - KnowledgeBasesCreateResponse, - construct_type( - type_=KnowledgeBasesCreateResponse, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def get( - self, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> HttpResponse[KnowledgeBasesGetResponse]: - """ - Parameters - ---------- - id : str - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[KnowledgeBasesGetResponse] - - """ - _response = self._client_wrapper.httpx_client.request( - f"knowledge-base/{jsonable_encoder(id)}", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - KnowledgeBasesGetResponse, - construct_type( - type_=KnowledgeBasesGetResponse, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def delete( - self, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> HttpResponse[KnowledgeBasesDeleteResponse]: - """ - Parameters - ---------- - id : str - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[KnowledgeBasesDeleteResponse] - - """ - _response = self._client_wrapper.httpx_client.request( - f"knowledge-base/{jsonable_encoder(id)}", - method="DELETE", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - KnowledgeBasesDeleteResponse, - construct_type( - type_=KnowledgeBasesDeleteResponse, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def update( - self, id: str, *, request: KnowledgeBasesUpdateRequest, request_options: typing.Optional[RequestOptions] = None - ) -> HttpResponse[KnowledgeBasesUpdateResponse]: - """ - Parameters - ---------- - id : str - - request : KnowledgeBasesUpdateRequest - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[KnowledgeBasesUpdateResponse] - - """ - _response = self._client_wrapper.httpx_client.request( - f"knowledge-base/{jsonable_encoder(id)}", - method="PATCH", - json=convert_and_respect_annotation_metadata( - object_=request, annotation=KnowledgeBasesUpdateRequest, direction="write" - ), - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - KnowledgeBasesUpdateResponse, - construct_type( - type_=KnowledgeBasesUpdateResponse, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - -class AsyncRawKnowledgeBasesClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._client_wrapper = client_wrapper - - async def list( - self, - *, - limit: typing.Optional[float] = None, - created_at_gt: typing.Optional[dt.datetime] = None, - created_at_lt: typing.Optional[dt.datetime] = None, - created_at_ge: typing.Optional[dt.datetime] = None, - created_at_le: typing.Optional[dt.datetime] = None, - updated_at_gt: typing.Optional[dt.datetime] = None, - updated_at_lt: typing.Optional[dt.datetime] = None, - updated_at_ge: typing.Optional[dt.datetime] = None, - updated_at_le: typing.Optional[dt.datetime] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[typing.List[KnowledgeBasesListResponseItem]]: - """ - Parameters - ---------- - limit : typing.Optional[float] - This is the maximum number of items to return. Defaults to 100. - - created_at_gt : typing.Optional[dt.datetime] - This will return items where the createdAt is greater than the specified value. - - created_at_lt : typing.Optional[dt.datetime] - This will return items where the createdAt is less than the specified value. - - created_at_ge : typing.Optional[dt.datetime] - This will return items where the createdAt is greater than or equal to the specified value. - - created_at_le : typing.Optional[dt.datetime] - This will return items where the createdAt is less than or equal to the specified value. - - updated_at_gt : typing.Optional[dt.datetime] - This will return items where the updatedAt is greater than the specified value. - - updated_at_lt : typing.Optional[dt.datetime] - This will return items where the updatedAt is less than the specified value. - - updated_at_ge : typing.Optional[dt.datetime] - This will return items where the updatedAt is greater than or equal to the specified value. - - updated_at_le : typing.Optional[dt.datetime] - This will return items where the updatedAt is less than or equal to the specified value. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[typing.List[KnowledgeBasesListResponseItem]] - - """ - _response = await self._client_wrapper.httpx_client.request( - "knowledge-base", - method="GET", - params={ - "limit": limit, - "createdAtGt": serialize_datetime(created_at_gt) if created_at_gt is not None else None, - "createdAtLt": serialize_datetime(created_at_lt) if created_at_lt is not None else None, - "createdAtGe": serialize_datetime(created_at_ge) if created_at_ge is not None else None, - "createdAtLe": serialize_datetime(created_at_le) if created_at_le is not None else None, - "updatedAtGt": serialize_datetime(updated_at_gt) if updated_at_gt is not None else None, - "updatedAtLt": serialize_datetime(updated_at_lt) if updated_at_lt is not None else None, - "updatedAtGe": serialize_datetime(updated_at_ge) if updated_at_ge is not None else None, - "updatedAtLe": serialize_datetime(updated_at_le) if updated_at_le is not None else None, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - typing.List[KnowledgeBasesListResponseItem], - construct_type( - type_=typing.List[KnowledgeBasesListResponseItem], # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def create( - self, *, request: KnowledgeBasesCreateRequest, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncHttpResponse[KnowledgeBasesCreateResponse]: - """ - Parameters - ---------- - request : KnowledgeBasesCreateRequest - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[KnowledgeBasesCreateResponse] - - """ - _response = await self._client_wrapper.httpx_client.request( - "knowledge-base", - method="POST", - json=convert_and_respect_annotation_metadata( - object_=request, annotation=KnowledgeBasesCreateRequest, direction="write" - ), - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - KnowledgeBasesCreateResponse, - construct_type( - type_=KnowledgeBasesCreateResponse, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def get( - self, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncHttpResponse[KnowledgeBasesGetResponse]: - """ - Parameters - ---------- - id : str - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[KnowledgeBasesGetResponse] - - """ - _response = await self._client_wrapper.httpx_client.request( - f"knowledge-base/{jsonable_encoder(id)}", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - KnowledgeBasesGetResponse, - construct_type( - type_=KnowledgeBasesGetResponse, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def delete( - self, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncHttpResponse[KnowledgeBasesDeleteResponse]: - """ - Parameters - ---------- - id : str - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[KnowledgeBasesDeleteResponse] - - """ - _response = await self._client_wrapper.httpx_client.request( - f"knowledge-base/{jsonable_encoder(id)}", - method="DELETE", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - KnowledgeBasesDeleteResponse, - construct_type( - type_=KnowledgeBasesDeleteResponse, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def update( - self, id: str, *, request: KnowledgeBasesUpdateRequest, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncHttpResponse[KnowledgeBasesUpdateResponse]: - """ - Parameters - ---------- - id : str - - request : KnowledgeBasesUpdateRequest - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[KnowledgeBasesUpdateResponse] - - """ - _response = await self._client_wrapper.httpx_client.request( - f"knowledge-base/{jsonable_encoder(id)}", - method="PATCH", - json=convert_and_respect_annotation_metadata( - object_=request, annotation=KnowledgeBasesUpdateRequest, direction="write" - ), - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - KnowledgeBasesUpdateResponse, - construct_type( - type_=KnowledgeBasesUpdateResponse, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) diff --git a/src/vapi/knowledge_bases/types/__init__.py b/src/vapi/knowledge_bases/types/__init__.py deleted file mode 100644 index d3e9f92..0000000 --- a/src/vapi/knowledge_bases/types/__init__.py +++ /dev/null @@ -1,21 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - -from .knowledge_bases_create_request import KnowledgeBasesCreateRequest -from .knowledge_bases_create_response import KnowledgeBasesCreateResponse -from .knowledge_bases_delete_response import KnowledgeBasesDeleteResponse -from .knowledge_bases_get_response import KnowledgeBasesGetResponse -from .knowledge_bases_list_response_item import KnowledgeBasesListResponseItem -from .knowledge_bases_update_request import KnowledgeBasesUpdateRequest -from .knowledge_bases_update_response import KnowledgeBasesUpdateResponse - -__all__ = [ - "KnowledgeBasesCreateRequest", - "KnowledgeBasesCreateResponse", - "KnowledgeBasesDeleteResponse", - "KnowledgeBasesGetResponse", - "KnowledgeBasesListResponseItem", - "KnowledgeBasesUpdateRequest", - "KnowledgeBasesUpdateResponse", -] diff --git a/src/vapi/knowledge_bases/types/knowledge_bases_create_request.py b/src/vapi/knowledge_bases/types/knowledge_bases_create_request.py deleted file mode 100644 index ee438c8..0000000 --- a/src/vapi/knowledge_bases/types/knowledge_bases_create_request.py +++ /dev/null @@ -1,8 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from ...types.create_custom_knowledge_base_dto import CreateCustomKnowledgeBaseDto -from ...types.create_trieve_knowledge_base_dto import CreateTrieveKnowledgeBaseDto - -KnowledgeBasesCreateRequest = typing.Union[CreateTrieveKnowledgeBaseDto, CreateCustomKnowledgeBaseDto] diff --git a/src/vapi/knowledge_bases/types/knowledge_bases_create_response.py b/src/vapi/knowledge_bases/types/knowledge_bases_create_response.py deleted file mode 100644 index e3508e2..0000000 --- a/src/vapi/knowledge_bases/types/knowledge_bases_create_response.py +++ /dev/null @@ -1,8 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from ...types.custom_knowledge_base import CustomKnowledgeBase -from ...types.trieve_knowledge_base import TrieveKnowledgeBase - -KnowledgeBasesCreateResponse = typing.Union[TrieveKnowledgeBase, CustomKnowledgeBase] diff --git a/src/vapi/knowledge_bases/types/knowledge_bases_delete_response.py b/src/vapi/knowledge_bases/types/knowledge_bases_delete_response.py deleted file mode 100644 index 9a40a5d..0000000 --- a/src/vapi/knowledge_bases/types/knowledge_bases_delete_response.py +++ /dev/null @@ -1,8 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from ...types.custom_knowledge_base import CustomKnowledgeBase -from ...types.trieve_knowledge_base import TrieveKnowledgeBase - -KnowledgeBasesDeleteResponse = typing.Union[TrieveKnowledgeBase, CustomKnowledgeBase] diff --git a/src/vapi/knowledge_bases/types/knowledge_bases_get_response.py b/src/vapi/knowledge_bases/types/knowledge_bases_get_response.py deleted file mode 100644 index e13812a..0000000 --- a/src/vapi/knowledge_bases/types/knowledge_bases_get_response.py +++ /dev/null @@ -1,8 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from ...types.custom_knowledge_base import CustomKnowledgeBase -from ...types.trieve_knowledge_base import TrieveKnowledgeBase - -KnowledgeBasesGetResponse = typing.Union[TrieveKnowledgeBase, CustomKnowledgeBase] diff --git a/src/vapi/knowledge_bases/types/knowledge_bases_list_response_item.py b/src/vapi/knowledge_bases/types/knowledge_bases_list_response_item.py deleted file mode 100644 index 49f7f77..0000000 --- a/src/vapi/knowledge_bases/types/knowledge_bases_list_response_item.py +++ /dev/null @@ -1,8 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from ...types.custom_knowledge_base import CustomKnowledgeBase -from ...types.trieve_knowledge_base import TrieveKnowledgeBase - -KnowledgeBasesListResponseItem = typing.Union[TrieveKnowledgeBase, CustomKnowledgeBase] diff --git a/src/vapi/knowledge_bases/types/knowledge_bases_update_request.py b/src/vapi/knowledge_bases/types/knowledge_bases_update_request.py deleted file mode 100644 index d5d9333..0000000 --- a/src/vapi/knowledge_bases/types/knowledge_bases_update_request.py +++ /dev/null @@ -1,8 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from ...types.update_custom_knowledge_base_dto import UpdateCustomKnowledgeBaseDto -from ...types.update_trieve_knowledge_base_dto import UpdateTrieveKnowledgeBaseDto - -KnowledgeBasesUpdateRequest = typing.Union[UpdateTrieveKnowledgeBaseDto, UpdateCustomKnowledgeBaseDto] diff --git a/src/vapi/knowledge_bases/types/knowledge_bases_update_response.py b/src/vapi/knowledge_bases/types/knowledge_bases_update_response.py deleted file mode 100644 index 28b5e4a..0000000 --- a/src/vapi/knowledge_bases/types/knowledge_bases_update_response.py +++ /dev/null @@ -1,8 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from ...types.custom_knowledge_base import CustomKnowledgeBase -from ...types.trieve_knowledge_base import TrieveKnowledgeBase - -KnowledgeBasesUpdateResponse = typing.Union[TrieveKnowledgeBase, CustomKnowledgeBase] diff --git a/src/vapi/logs/__init__.py b/src/vapi/logs/__init__.py deleted file mode 100644 index a56eae8..0000000 --- a/src/vapi/logs/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - -from .types import LoggingControllerLogsDeleteQueryRequestType, LogsGetRequestSortOrder, LogsGetRequestType - -__all__ = ["LoggingControllerLogsDeleteQueryRequestType", "LogsGetRequestSortOrder", "LogsGetRequestType"] diff --git a/src/vapi/logs/client.py b/src/vapi/logs/client.py deleted file mode 100644 index 8deeee4..0000000 --- a/src/vapi/logs/client.py +++ /dev/null @@ -1,426 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.pagination import AsyncPager, SyncPager -from ..core.request_options import RequestOptions -from ..types.log import Log -from .raw_client import AsyncRawLogsClient, RawLogsClient -from .types.logging_controller_logs_delete_query_request_type import LoggingControllerLogsDeleteQueryRequestType -from .types.logs_get_request_sort_order import LogsGetRequestSortOrder -from .types.logs_get_request_type import LogsGetRequestType - - -class LogsClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._raw_client = RawLogsClient(client_wrapper=client_wrapper) - - @property - def with_raw_response(self) -> RawLogsClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - RawLogsClient - """ - return self._raw_client - - def get( - self, - *, - type: typing.Optional[LogsGetRequestType] = None, - webhook_type: typing.Optional[str] = None, - assistant_id: typing.Optional[str] = None, - phone_number_id: typing.Optional[str] = None, - customer_id: typing.Optional[str] = None, - squad_id: typing.Optional[str] = None, - call_id: typing.Optional[str] = None, - page: typing.Optional[float] = None, - sort_order: typing.Optional[LogsGetRequestSortOrder] = None, - limit: typing.Optional[float] = None, - created_at_gt: typing.Optional[dt.datetime] = None, - created_at_lt: typing.Optional[dt.datetime] = None, - created_at_ge: typing.Optional[dt.datetime] = None, - created_at_le: typing.Optional[dt.datetime] = None, - updated_at_gt: typing.Optional[dt.datetime] = None, - updated_at_lt: typing.Optional[dt.datetime] = None, - updated_at_ge: typing.Optional[dt.datetime] = None, - updated_at_le: typing.Optional[dt.datetime] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[Log]: - """ - Parameters - ---------- - type : typing.Optional[LogsGetRequestType] - This is the type of the log. - - webhook_type : typing.Optional[str] - This is the type of the webhook, given the log is from a webhook. - - assistant_id : typing.Optional[str] - This is the ID of the assistant. - - phone_number_id : typing.Optional[str] - This is the ID of the phone number. - - customer_id : typing.Optional[str] - This is the ID of the customer. - - squad_id : typing.Optional[str] - This is the ID of the squad. - - call_id : typing.Optional[str] - This is the ID of the call. - - page : typing.Optional[float] - This is the page number to return. Defaults to 1. - - sort_order : typing.Optional[LogsGetRequestSortOrder] - This is the sort order for pagination. Defaults to 'DESC'. - - limit : typing.Optional[float] - This is the maximum number of items to return. Defaults to 100. - - created_at_gt : typing.Optional[dt.datetime] - This will return items where the createdAt is greater than the specified value. - - created_at_lt : typing.Optional[dt.datetime] - This will return items where the createdAt is less than the specified value. - - created_at_ge : typing.Optional[dt.datetime] - This will return items where the createdAt is greater than or equal to the specified value. - - created_at_le : typing.Optional[dt.datetime] - This will return items where the createdAt is less than or equal to the specified value. - - updated_at_gt : typing.Optional[dt.datetime] - This will return items where the updatedAt is greater than the specified value. - - updated_at_lt : typing.Optional[dt.datetime] - This will return items where the updatedAt is less than the specified value. - - updated_at_ge : typing.Optional[dt.datetime] - This will return items where the updatedAt is greater than or equal to the specified value. - - updated_at_le : typing.Optional[dt.datetime] - This will return items where the updatedAt is less than or equal to the specified value. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[Log] - - - Examples - -------- - from vapi import Vapi - - client = Vapi( - token="YOUR_TOKEN", - ) - response = client.logs.get() - for item in response: - yield item - # alternatively, you can paginate page-by-page - for page in response.iter_pages(): - yield page - """ - return self._raw_client.get( - type=type, - webhook_type=webhook_type, - assistant_id=assistant_id, - phone_number_id=phone_number_id, - customer_id=customer_id, - squad_id=squad_id, - call_id=call_id, - page=page, - sort_order=sort_order, - limit=limit, - created_at_gt=created_at_gt, - created_at_lt=created_at_lt, - created_at_ge=created_at_ge, - created_at_le=created_at_le, - updated_at_gt=updated_at_gt, - updated_at_lt=updated_at_lt, - updated_at_ge=updated_at_ge, - updated_at_le=updated_at_le, - request_options=request_options, - ) - - def logging_controller_logs_delete_query( - self, - *, - type: typing.Optional[LoggingControllerLogsDeleteQueryRequestType] = None, - assistant_id: typing.Optional[str] = None, - phone_number_id: typing.Optional[str] = None, - customer_id: typing.Optional[str] = None, - squad_id: typing.Optional[str] = None, - call_id: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> None: - """ - Parameters - ---------- - type : typing.Optional[LoggingControllerLogsDeleteQueryRequestType] - This is the type of the log. - - assistant_id : typing.Optional[str] - - phone_number_id : typing.Optional[str] - This is the ID of the phone number. - - customer_id : typing.Optional[str] - This is the ID of the customer. - - squad_id : typing.Optional[str] - This is the ID of the squad. - - call_id : typing.Optional[str] - This is the ID of the call. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - None - - Examples - -------- - from vapi import Vapi - - client = Vapi( - token="YOUR_TOKEN", - ) - client.logs.logging_controller_logs_delete_query() - """ - _response = self._raw_client.logging_controller_logs_delete_query( - type=type, - assistant_id=assistant_id, - phone_number_id=phone_number_id, - customer_id=customer_id, - squad_id=squad_id, - call_id=call_id, - request_options=request_options, - ) - return _response.data - - -class AsyncLogsClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._raw_client = AsyncRawLogsClient(client_wrapper=client_wrapper) - - @property - def with_raw_response(self) -> AsyncRawLogsClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - AsyncRawLogsClient - """ - return self._raw_client - - async def get( - self, - *, - type: typing.Optional[LogsGetRequestType] = None, - webhook_type: typing.Optional[str] = None, - assistant_id: typing.Optional[str] = None, - phone_number_id: typing.Optional[str] = None, - customer_id: typing.Optional[str] = None, - squad_id: typing.Optional[str] = None, - call_id: typing.Optional[str] = None, - page: typing.Optional[float] = None, - sort_order: typing.Optional[LogsGetRequestSortOrder] = None, - limit: typing.Optional[float] = None, - created_at_gt: typing.Optional[dt.datetime] = None, - created_at_lt: typing.Optional[dt.datetime] = None, - created_at_ge: typing.Optional[dt.datetime] = None, - created_at_le: typing.Optional[dt.datetime] = None, - updated_at_gt: typing.Optional[dt.datetime] = None, - updated_at_lt: typing.Optional[dt.datetime] = None, - updated_at_ge: typing.Optional[dt.datetime] = None, - updated_at_le: typing.Optional[dt.datetime] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[Log]: - """ - Parameters - ---------- - type : typing.Optional[LogsGetRequestType] - This is the type of the log. - - webhook_type : typing.Optional[str] - This is the type of the webhook, given the log is from a webhook. - - assistant_id : typing.Optional[str] - This is the ID of the assistant. - - phone_number_id : typing.Optional[str] - This is the ID of the phone number. - - customer_id : typing.Optional[str] - This is the ID of the customer. - - squad_id : typing.Optional[str] - This is the ID of the squad. - - call_id : typing.Optional[str] - This is the ID of the call. - - page : typing.Optional[float] - This is the page number to return. Defaults to 1. - - sort_order : typing.Optional[LogsGetRequestSortOrder] - This is the sort order for pagination. Defaults to 'DESC'. - - limit : typing.Optional[float] - This is the maximum number of items to return. Defaults to 100. - - created_at_gt : typing.Optional[dt.datetime] - This will return items where the createdAt is greater than the specified value. - - created_at_lt : typing.Optional[dt.datetime] - This will return items where the createdAt is less than the specified value. - - created_at_ge : typing.Optional[dt.datetime] - This will return items where the createdAt is greater than or equal to the specified value. - - created_at_le : typing.Optional[dt.datetime] - This will return items where the createdAt is less than or equal to the specified value. - - updated_at_gt : typing.Optional[dt.datetime] - This will return items where the updatedAt is greater than the specified value. - - updated_at_lt : typing.Optional[dt.datetime] - This will return items where the updatedAt is less than the specified value. - - updated_at_ge : typing.Optional[dt.datetime] - This will return items where the updatedAt is greater than or equal to the specified value. - - updated_at_le : typing.Optional[dt.datetime] - This will return items where the updatedAt is less than or equal to the specified value. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[Log] - - - Examples - -------- - import asyncio - - from vapi import AsyncVapi - - client = AsyncVapi( - token="YOUR_TOKEN", - ) - - - async def main() -> None: - response = await client.logs.get() - async for item in response: - yield item - - # alternatively, you can paginate page-by-page - async for page in response.iter_pages(): - yield page - - - asyncio.run(main()) - """ - return await self._raw_client.get( - type=type, - webhook_type=webhook_type, - assistant_id=assistant_id, - phone_number_id=phone_number_id, - customer_id=customer_id, - squad_id=squad_id, - call_id=call_id, - page=page, - sort_order=sort_order, - limit=limit, - created_at_gt=created_at_gt, - created_at_lt=created_at_lt, - created_at_ge=created_at_ge, - created_at_le=created_at_le, - updated_at_gt=updated_at_gt, - updated_at_lt=updated_at_lt, - updated_at_ge=updated_at_ge, - updated_at_le=updated_at_le, - request_options=request_options, - ) - - async def logging_controller_logs_delete_query( - self, - *, - type: typing.Optional[LoggingControllerLogsDeleteQueryRequestType] = None, - assistant_id: typing.Optional[str] = None, - phone_number_id: typing.Optional[str] = None, - customer_id: typing.Optional[str] = None, - squad_id: typing.Optional[str] = None, - call_id: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> None: - """ - Parameters - ---------- - type : typing.Optional[LoggingControllerLogsDeleteQueryRequestType] - This is the type of the log. - - assistant_id : typing.Optional[str] - - phone_number_id : typing.Optional[str] - This is the ID of the phone number. - - customer_id : typing.Optional[str] - This is the ID of the customer. - - squad_id : typing.Optional[str] - This is the ID of the squad. - - call_id : typing.Optional[str] - This is the ID of the call. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - None - - Examples - -------- - import asyncio - - from vapi import AsyncVapi - - client = AsyncVapi( - token="YOUR_TOKEN", - ) - - - async def main() -> None: - await client.logs.logging_controller_logs_delete_query() - - - asyncio.run(main()) - """ - _response = await self._raw_client.logging_controller_logs_delete_query( - type=type, - assistant_id=assistant_id, - phone_number_id=phone_number_id, - customer_id=customer_id, - squad_id=squad_id, - call_id=call_id, - request_options=request_options, - ) - return _response.data diff --git a/src/vapi/logs/raw_client.py b/src/vapi/logs/raw_client.py deleted file mode 100644 index aa7387b..0000000 --- a/src/vapi/logs/raw_client.py +++ /dev/null @@ -1,459 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing -from json.decoder import JSONDecodeError - -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.datetime_utils import serialize_datetime -from ..core.http_response import AsyncHttpResponse, HttpResponse -from ..core.pagination import AsyncPager, BaseHttpResponse, SyncPager -from ..core.request_options import RequestOptions -from ..core.unchecked_base_model import construct_type -from ..types.log import Log -from ..types.logs_paginated_response import LogsPaginatedResponse -from .types.logging_controller_logs_delete_query_request_type import LoggingControllerLogsDeleteQueryRequestType -from .types.logs_get_request_sort_order import LogsGetRequestSortOrder -from .types.logs_get_request_type import LogsGetRequestType - - -class RawLogsClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._client_wrapper = client_wrapper - - def get( - self, - *, - type: typing.Optional[LogsGetRequestType] = None, - webhook_type: typing.Optional[str] = None, - assistant_id: typing.Optional[str] = None, - phone_number_id: typing.Optional[str] = None, - customer_id: typing.Optional[str] = None, - squad_id: typing.Optional[str] = None, - call_id: typing.Optional[str] = None, - page: typing.Optional[float] = None, - sort_order: typing.Optional[LogsGetRequestSortOrder] = None, - limit: typing.Optional[float] = None, - created_at_gt: typing.Optional[dt.datetime] = None, - created_at_lt: typing.Optional[dt.datetime] = None, - created_at_ge: typing.Optional[dt.datetime] = None, - created_at_le: typing.Optional[dt.datetime] = None, - updated_at_gt: typing.Optional[dt.datetime] = None, - updated_at_lt: typing.Optional[dt.datetime] = None, - updated_at_ge: typing.Optional[dt.datetime] = None, - updated_at_le: typing.Optional[dt.datetime] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[Log]: - """ - Parameters - ---------- - type : typing.Optional[LogsGetRequestType] - This is the type of the log. - - webhook_type : typing.Optional[str] - This is the type of the webhook, given the log is from a webhook. - - assistant_id : typing.Optional[str] - This is the ID of the assistant. - - phone_number_id : typing.Optional[str] - This is the ID of the phone number. - - customer_id : typing.Optional[str] - This is the ID of the customer. - - squad_id : typing.Optional[str] - This is the ID of the squad. - - call_id : typing.Optional[str] - This is the ID of the call. - - page : typing.Optional[float] - This is the page number to return. Defaults to 1. - - sort_order : typing.Optional[LogsGetRequestSortOrder] - This is the sort order for pagination. Defaults to 'DESC'. - - limit : typing.Optional[float] - This is the maximum number of items to return. Defaults to 100. - - created_at_gt : typing.Optional[dt.datetime] - This will return items where the createdAt is greater than the specified value. - - created_at_lt : typing.Optional[dt.datetime] - This will return items where the createdAt is less than the specified value. - - created_at_ge : typing.Optional[dt.datetime] - This will return items where the createdAt is greater than or equal to the specified value. - - created_at_le : typing.Optional[dt.datetime] - This will return items where the createdAt is less than or equal to the specified value. - - updated_at_gt : typing.Optional[dt.datetime] - This will return items where the updatedAt is greater than the specified value. - - updated_at_lt : typing.Optional[dt.datetime] - This will return items where the updatedAt is less than the specified value. - - updated_at_ge : typing.Optional[dt.datetime] - This will return items where the updatedAt is greater than or equal to the specified value. - - updated_at_le : typing.Optional[dt.datetime] - This will return items where the updatedAt is less than or equal to the specified value. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - SyncPager[Log] - - """ - page = page if page is not None else 1 - - _response = self._client_wrapper.httpx_client.request( - "logs", - method="GET", - params={ - "type": type, - "webhookType": webhook_type, - "assistantId": assistant_id, - "phoneNumberId": phone_number_id, - "customerId": customer_id, - "squadId": squad_id, - "callId": call_id, - "page": page, - "sortOrder": sort_order, - "limit": limit, - "createdAtGt": serialize_datetime(created_at_gt) if created_at_gt is not None else None, - "createdAtLt": serialize_datetime(created_at_lt) if created_at_lt is not None else None, - "createdAtGe": serialize_datetime(created_at_ge) if created_at_ge is not None else None, - "createdAtLe": serialize_datetime(created_at_le) if created_at_le is not None else None, - "updatedAtGt": serialize_datetime(updated_at_gt) if updated_at_gt is not None else None, - "updatedAtLt": serialize_datetime(updated_at_lt) if updated_at_lt is not None else None, - "updatedAtGe": serialize_datetime(updated_at_ge) if updated_at_ge is not None else None, - "updatedAtLe": serialize_datetime(updated_at_le) if updated_at_le is not None else None, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - LogsPaginatedResponse, - construct_type( - type_=LogsPaginatedResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.results - _has_next = True - _get_next = lambda: self.get( - type=type, - webhook_type=webhook_type, - assistant_id=assistant_id, - phone_number_id=phone_number_id, - customer_id=customer_id, - squad_id=squad_id, - call_id=call_id, - page=page + 1, - sort_order=sort_order, - limit=limit, - created_at_gt=created_at_gt, - created_at_lt=created_at_lt, - created_at_ge=created_at_ge, - created_at_le=created_at_le, - updated_at_gt=updated_at_gt, - updated_at_lt=updated_at_lt, - updated_at_ge=updated_at_ge, - updated_at_le=updated_at_le, - request_options=request_options, - ) - return SyncPager( - has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response) - ) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def logging_controller_logs_delete_query( - self, - *, - type: typing.Optional[LoggingControllerLogsDeleteQueryRequestType] = None, - assistant_id: typing.Optional[str] = None, - phone_number_id: typing.Optional[str] = None, - customer_id: typing.Optional[str] = None, - squad_id: typing.Optional[str] = None, - call_id: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[None]: - """ - Parameters - ---------- - type : typing.Optional[LoggingControllerLogsDeleteQueryRequestType] - This is the type of the log. - - assistant_id : typing.Optional[str] - - phone_number_id : typing.Optional[str] - This is the ID of the phone number. - - customer_id : typing.Optional[str] - This is the ID of the customer. - - squad_id : typing.Optional[str] - This is the ID of the squad. - - call_id : typing.Optional[str] - This is the ID of the call. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[None] - """ - _response = self._client_wrapper.httpx_client.request( - "logs", - method="DELETE", - params={ - "type": type, - "assistantId": assistant_id, - "phoneNumberId": phone_number_id, - "customerId": customer_id, - "squadId": squad_id, - "callId": call_id, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return HttpResponse(response=_response, data=None) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - -class AsyncRawLogsClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._client_wrapper = client_wrapper - - async def get( - self, - *, - type: typing.Optional[LogsGetRequestType] = None, - webhook_type: typing.Optional[str] = None, - assistant_id: typing.Optional[str] = None, - phone_number_id: typing.Optional[str] = None, - customer_id: typing.Optional[str] = None, - squad_id: typing.Optional[str] = None, - call_id: typing.Optional[str] = None, - page: typing.Optional[float] = None, - sort_order: typing.Optional[LogsGetRequestSortOrder] = None, - limit: typing.Optional[float] = None, - created_at_gt: typing.Optional[dt.datetime] = None, - created_at_lt: typing.Optional[dt.datetime] = None, - created_at_ge: typing.Optional[dt.datetime] = None, - created_at_le: typing.Optional[dt.datetime] = None, - updated_at_gt: typing.Optional[dt.datetime] = None, - updated_at_lt: typing.Optional[dt.datetime] = None, - updated_at_ge: typing.Optional[dt.datetime] = None, - updated_at_le: typing.Optional[dt.datetime] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[Log]: - """ - Parameters - ---------- - type : typing.Optional[LogsGetRequestType] - This is the type of the log. - - webhook_type : typing.Optional[str] - This is the type of the webhook, given the log is from a webhook. - - assistant_id : typing.Optional[str] - This is the ID of the assistant. - - phone_number_id : typing.Optional[str] - This is the ID of the phone number. - - customer_id : typing.Optional[str] - This is the ID of the customer. - - squad_id : typing.Optional[str] - This is the ID of the squad. - - call_id : typing.Optional[str] - This is the ID of the call. - - page : typing.Optional[float] - This is the page number to return. Defaults to 1. - - sort_order : typing.Optional[LogsGetRequestSortOrder] - This is the sort order for pagination. Defaults to 'DESC'. - - limit : typing.Optional[float] - This is the maximum number of items to return. Defaults to 100. - - created_at_gt : typing.Optional[dt.datetime] - This will return items where the createdAt is greater than the specified value. - - created_at_lt : typing.Optional[dt.datetime] - This will return items where the createdAt is less than the specified value. - - created_at_ge : typing.Optional[dt.datetime] - This will return items where the createdAt is greater than or equal to the specified value. - - created_at_le : typing.Optional[dt.datetime] - This will return items where the createdAt is less than or equal to the specified value. - - updated_at_gt : typing.Optional[dt.datetime] - This will return items where the updatedAt is greater than the specified value. - - updated_at_lt : typing.Optional[dt.datetime] - This will return items where the updatedAt is less than the specified value. - - updated_at_ge : typing.Optional[dt.datetime] - This will return items where the updatedAt is greater than or equal to the specified value. - - updated_at_le : typing.Optional[dt.datetime] - This will return items where the updatedAt is less than or equal to the specified value. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncPager[Log] - - """ - page = page if page is not None else 1 - - _response = await self._client_wrapper.httpx_client.request( - "logs", - method="GET", - params={ - "type": type, - "webhookType": webhook_type, - "assistantId": assistant_id, - "phoneNumberId": phone_number_id, - "customerId": customer_id, - "squadId": squad_id, - "callId": call_id, - "page": page, - "sortOrder": sort_order, - "limit": limit, - "createdAtGt": serialize_datetime(created_at_gt) if created_at_gt is not None else None, - "createdAtLt": serialize_datetime(created_at_lt) if created_at_lt is not None else None, - "createdAtGe": serialize_datetime(created_at_ge) if created_at_ge is not None else None, - "createdAtLe": serialize_datetime(created_at_le) if created_at_le is not None else None, - "updatedAtGt": serialize_datetime(updated_at_gt) if updated_at_gt is not None else None, - "updatedAtLt": serialize_datetime(updated_at_lt) if updated_at_lt is not None else None, - "updatedAtGe": serialize_datetime(updated_at_ge) if updated_at_ge is not None else None, - "updatedAtLe": serialize_datetime(updated_at_le) if updated_at_le is not None else None, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _parsed_response = typing.cast( - LogsPaginatedResponse, - construct_type( - type_=LogsPaginatedResponse, # type: ignore - object_=_response.json(), - ), - ) - _items = _parsed_response.results - _has_next = True - - async def _get_next(): - return await self.get( - type=type, - webhook_type=webhook_type, - assistant_id=assistant_id, - phone_number_id=phone_number_id, - customer_id=customer_id, - squad_id=squad_id, - call_id=call_id, - page=page + 1, - sort_order=sort_order, - limit=limit, - created_at_gt=created_at_gt, - created_at_lt=created_at_lt, - created_at_ge=created_at_ge, - created_at_le=created_at_le, - updated_at_gt=updated_at_gt, - updated_at_lt=updated_at_lt, - updated_at_ge=updated_at_ge, - updated_at_le=updated_at_le, - request_options=request_options, - ) - - return AsyncPager( - has_next=_has_next, items=_items, get_next=_get_next, response=BaseHttpResponse(response=_response) - ) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def logging_controller_logs_delete_query( - self, - *, - type: typing.Optional[LoggingControllerLogsDeleteQueryRequestType] = None, - assistant_id: typing.Optional[str] = None, - phone_number_id: typing.Optional[str] = None, - customer_id: typing.Optional[str] = None, - squad_id: typing.Optional[str] = None, - call_id: typing.Optional[str] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[None]: - """ - Parameters - ---------- - type : typing.Optional[LoggingControllerLogsDeleteQueryRequestType] - This is the type of the log. - - assistant_id : typing.Optional[str] - - phone_number_id : typing.Optional[str] - This is the ID of the phone number. - - customer_id : typing.Optional[str] - This is the ID of the customer. - - squad_id : typing.Optional[str] - This is the ID of the squad. - - call_id : typing.Optional[str] - This is the ID of the call. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[None] - """ - _response = await self._client_wrapper.httpx_client.request( - "logs", - method="DELETE", - params={ - "type": type, - "assistantId": assistant_id, - "phoneNumberId": phone_number_id, - "customerId": customer_id, - "squadId": squad_id, - "callId": call_id, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return AsyncHttpResponse(response=_response, data=None) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) diff --git a/src/vapi/logs/types/__init__.py b/src/vapi/logs/types/__init__.py deleted file mode 100644 index ce2c27f..0000000 --- a/src/vapi/logs/types/__init__.py +++ /dev/null @@ -1,9 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - -from .logging_controller_logs_delete_query_request_type import LoggingControllerLogsDeleteQueryRequestType -from .logs_get_request_sort_order import LogsGetRequestSortOrder -from .logs_get_request_type import LogsGetRequestType - -__all__ = ["LoggingControllerLogsDeleteQueryRequestType", "LogsGetRequestSortOrder", "LogsGetRequestType"] diff --git a/src/vapi/logs/types/logging_controller_logs_delete_query_request_type.py b/src/vapi/logs/types/logging_controller_logs_delete_query_request_type.py deleted file mode 100644 index 1fa21bb..0000000 --- a/src/vapi/logs/types/logging_controller_logs_delete_query_request_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -LoggingControllerLogsDeleteQueryRequestType = typing.Union[ - typing.Literal["API", "Webhook", "Call", "Provider"], typing.Any -] diff --git a/src/vapi/logs/types/logs_get_request_sort_order.py b/src/vapi/logs/types/logs_get_request_sort_order.py deleted file mode 100644 index a7531eb..0000000 --- a/src/vapi/logs/types/logs_get_request_sort_order.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -LogsGetRequestSortOrder = typing.Union[typing.Literal["ASC", "DESC"], typing.Any] diff --git a/src/vapi/logs/types/logs_get_request_type.py b/src/vapi/logs/types/logs_get_request_type.py deleted file mode 100644 index 94c2502..0000000 --- a/src/vapi/logs/types/logs_get_request_type.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -LogsGetRequestType = typing.Union[typing.Literal["API", "Webhook", "Call", "Provider"], typing.Any] diff --git a/src/vapi/phone_numbers/__init__.py b/src/vapi/phone_numbers/__init__.py index abd4da1..d5e6737 100644 --- a/src/vapi/phone_numbers/__init__.py +++ b/src/vapi/phone_numbers/__init__.py @@ -2,15 +2,48 @@ # isort: skip_file -from .types import ( - PhoneNumbersCreateRequest, - PhoneNumbersCreateResponse, - PhoneNumbersDeleteResponse, - PhoneNumbersGetResponse, - PhoneNumbersListResponseItem, - PhoneNumbersUpdateRequest, - PhoneNumbersUpdateResponse, -) +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import ( + PhoneNumbersCreateRequest, + PhoneNumbersCreateResponse, + PhoneNumbersDeleteResponse, + PhoneNumbersGetResponse, + PhoneNumbersListResponseItem, + PhoneNumbersUpdateRequest, + PhoneNumbersUpdateResponse, + ) +_dynamic_imports: typing.Dict[str, str] = { + "PhoneNumbersCreateRequest": ".types", + "PhoneNumbersCreateResponse": ".types", + "PhoneNumbersDeleteResponse": ".types", + "PhoneNumbersGetResponse": ".types", + "PhoneNumbersListResponseItem": ".types", + "PhoneNumbersUpdateRequest": ".types", + "PhoneNumbersUpdateResponse": ".types", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + __all__ = [ "PhoneNumbersCreateRequest", diff --git a/src/vapi/phone_numbers/types/__init__.py b/src/vapi/phone_numbers/types/__init__.py index 0e731e2..d5c09b0 100644 --- a/src/vapi/phone_numbers/types/__init__.py +++ b/src/vapi/phone_numbers/types/__init__.py @@ -2,13 +2,46 @@ # isort: skip_file -from .phone_numbers_create_request import PhoneNumbersCreateRequest -from .phone_numbers_create_response import PhoneNumbersCreateResponse -from .phone_numbers_delete_response import PhoneNumbersDeleteResponse -from .phone_numbers_get_response import PhoneNumbersGetResponse -from .phone_numbers_list_response_item import PhoneNumbersListResponseItem -from .phone_numbers_update_request import PhoneNumbersUpdateRequest -from .phone_numbers_update_response import PhoneNumbersUpdateResponse +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .phone_numbers_create_request import PhoneNumbersCreateRequest + from .phone_numbers_create_response import PhoneNumbersCreateResponse + from .phone_numbers_delete_response import PhoneNumbersDeleteResponse + from .phone_numbers_get_response import PhoneNumbersGetResponse + from .phone_numbers_list_response_item import PhoneNumbersListResponseItem + from .phone_numbers_update_request import PhoneNumbersUpdateRequest + from .phone_numbers_update_response import PhoneNumbersUpdateResponse +_dynamic_imports: typing.Dict[str, str] = { + "PhoneNumbersCreateRequest": ".phone_numbers_create_request", + "PhoneNumbersCreateResponse": ".phone_numbers_create_response", + "PhoneNumbersDeleteResponse": ".phone_numbers_delete_response", + "PhoneNumbersGetResponse": ".phone_numbers_get_response", + "PhoneNumbersListResponseItem": ".phone_numbers_list_response_item", + "PhoneNumbersUpdateRequest": ".phone_numbers_update_request", + "PhoneNumbersUpdateResponse": ".phone_numbers_update_response", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + __all__ = [ "PhoneNumbersCreateRequest", diff --git a/src/vapi/provider_resources/__init__.py b/src/vapi/provider_resources/__init__.py new file mode 100644 index 0000000..89ec0f1 --- /dev/null +++ b/src/vapi/provider_resources/__init__.py @@ -0,0 +1,34 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import ProviderResourceControllerGetProviderResourcesPaginatedRequestSortOrder +_dynamic_imports: typing.Dict[str, str] = { + "ProviderResourceControllerGetProviderResourcesPaginatedRequestSortOrder": ".types" +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = ["ProviderResourceControllerGetProviderResourcesPaginatedRequestSortOrder"] diff --git a/src/vapi/test_suite_runs/client.py b/src/vapi/provider_resources/client.py similarity index 61% rename from src/vapi/test_suite_runs/client.py rename to src/vapi/provider_resources/client.py index 31a4d9b..c081db3 100644 --- a/src/vapi/test_suite_runs/client.py +++ b/src/vapi/provider_resources/client.py @@ -5,38 +5,36 @@ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.request_options import RequestOptions -from ..types.test_suite_run import TestSuiteRun -from ..types.test_suite_runs_paginated_response import TestSuiteRunsPaginatedResponse -from .raw_client import AsyncRawTestSuiteRunsClient, RawTestSuiteRunsClient -from .types.test_suite_run_controller_find_all_paginated_request_sort_order import ( - TestSuiteRunControllerFindAllPaginatedRequestSortOrder, +from ..types.provider_resource import ProviderResource +from ..types.provider_resource_paginated_response import ProviderResourcePaginatedResponse +from .raw_client import AsyncRawProviderResourcesClient, RawProviderResourcesClient +from .types.provider_resource_controller_get_provider_resources_paginated_request_sort_order import ( + ProviderResourceControllerGetProviderResourcesPaginatedRequestSortOrder, ) -# this is used as the default value for optional parameters -OMIT = typing.cast(typing.Any, ...) - -class TestSuiteRunsClient: +class ProviderResourcesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): - self._raw_client = RawTestSuiteRunsClient(client_wrapper=client_wrapper) + self._raw_client = RawProviderResourcesClient(client_wrapper=client_wrapper) @property - def with_raw_response(self) -> RawTestSuiteRunsClient: + def with_raw_response(self) -> RawProviderResourcesClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- - RawTestSuiteRunsClient + RawProviderResourcesClient """ return self._raw_client - def test_suite_run_controller_find_all_paginated( + def provider_resource_controller_get_provider_resources_paginated( self, - test_suite_id: str, *, + id: typing.Optional[str] = None, + resource_id: typing.Optional[str] = None, page: typing.Optional[float] = None, - sort_order: typing.Optional[TestSuiteRunControllerFindAllPaginatedRequestSortOrder] = None, + sort_order: typing.Optional[ProviderResourceControllerGetProviderResourcesPaginatedRequestSortOrder] = None, limit: typing.Optional[float] = None, created_at_gt: typing.Optional[dt.datetime] = None, created_at_lt: typing.Optional[dt.datetime] = None, @@ -47,16 +45,18 @@ def test_suite_run_controller_find_all_paginated( updated_at_ge: typing.Optional[dt.datetime] = None, updated_at_le: typing.Optional[dt.datetime] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> TestSuiteRunsPaginatedResponse: + ) -> ProviderResourcePaginatedResponse: """ Parameters ---------- - test_suite_id : str + id : typing.Optional[str] + + resource_id : typing.Optional[str] page : typing.Optional[float] This is the page number to return. Defaults to 1. - sort_order : typing.Optional[TestSuiteRunControllerFindAllPaginatedRequestSortOrder] + sort_order : typing.Optional[ProviderResourceControllerGetProviderResourcesPaginatedRequestSortOrder] This is the sort order for pagination. Defaults to 'DESC'. limit : typing.Optional[float] @@ -91,8 +91,8 @@ def test_suite_run_controller_find_all_paginated( Returns ------- - TestSuiteRunsPaginatedResponse - + ProviderResourcePaginatedResponse + List of provider resources Examples -------- @@ -101,12 +101,11 @@ def test_suite_run_controller_find_all_paginated( client = Vapi( token="YOUR_TOKEN", ) - client.test_suite_runs.test_suite_run_controller_find_all_paginated( - test_suite_id="testSuiteId", - ) + client.provider_resources.provider_resource_controller_get_provider_resources_paginated() """ - _response = self._raw_client.test_suite_run_controller_find_all_paginated( - test_suite_id, + _response = self._raw_client.provider_resource_controller_get_provider_resources_paginated( + id=id, + resource_id=resource_id, page=page, sort_order=sort_order, limit=limit, @@ -122,28 +121,19 @@ def test_suite_run_controller_find_all_paginated( ) return _response.data - def test_suite_run_controller_create( - self, - test_suite_id: str, - *, - name: typing.Optional[str] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> TestSuiteRun: + def provider_resource_controller_create_provider_resource( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> ProviderResource: """ Parameters ---------- - test_suite_id : str - - name : typing.Optional[str] - This is the name of the test suite run. - request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - TestSuiteRun - + ProviderResource + Successfully created provider resource Examples -------- @@ -152,23 +142,19 @@ def test_suite_run_controller_create( client = Vapi( token="YOUR_TOKEN", ) - client.test_suite_runs.test_suite_run_controller_create( - test_suite_id="testSuiteId", - ) + client.provider_resources.provider_resource_controller_create_provider_resource() """ - _response = self._raw_client.test_suite_run_controller_create( - test_suite_id, name=name, request_options=request_options + _response = self._raw_client.provider_resource_controller_create_provider_resource( + request_options=request_options ) return _response.data - def test_suite_run_controller_find_one( - self, test_suite_id: str, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> TestSuiteRun: + def provider_resource_controller_get_provider_resource( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> ProviderResource: """ Parameters ---------- - test_suite_id : str - id : str request_options : typing.Optional[RequestOptions] @@ -176,8 +162,8 @@ def test_suite_run_controller_find_one( Returns ------- - TestSuiteRun - + ProviderResource + Successfully retrieved provider resource Examples -------- @@ -186,24 +172,21 @@ def test_suite_run_controller_find_one( client = Vapi( token="YOUR_TOKEN", ) - client.test_suite_runs.test_suite_run_controller_find_one( - test_suite_id="testSuiteId", + client.provider_resources.provider_resource_controller_get_provider_resource( id="id", ) """ - _response = self._raw_client.test_suite_run_controller_find_one( - test_suite_id, id, request_options=request_options + _response = self._raw_client.provider_resource_controller_get_provider_resource( + id, request_options=request_options ) return _response.data - def test_suite_run_controller_remove( - self, test_suite_id: str, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> TestSuiteRun: + def provider_resource_controller_delete_provider_resource( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> ProviderResource: """ Parameters ---------- - test_suite_id : str - id : str request_options : typing.Optional[RequestOptions] @@ -211,7 +194,7 @@ def test_suite_run_controller_remove( Returns ------- - TestSuiteRun + ProviderResource Examples @@ -221,40 +204,29 @@ def test_suite_run_controller_remove( client = Vapi( token="YOUR_TOKEN", ) - client.test_suite_runs.test_suite_run_controller_remove( - test_suite_id="testSuiteId", + client.provider_resources.provider_resource_controller_delete_provider_resource( id="id", ) """ - _response = self._raw_client.test_suite_run_controller_remove( - test_suite_id, id, request_options=request_options + _response = self._raw_client.provider_resource_controller_delete_provider_resource( + id, request_options=request_options ) return _response.data - def test_suite_run_controller_update( - self, - test_suite_id: str, - id: str, - *, - name: typing.Optional[str] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> TestSuiteRun: + def provider_resource_controller_update_provider_resource( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> ProviderResource: """ Parameters ---------- - test_suite_id : str - id : str - name : typing.Optional[str] - This is the name of the test suite run. - request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - TestSuiteRun + ProviderResource Examples @@ -264,38 +236,38 @@ def test_suite_run_controller_update( client = Vapi( token="YOUR_TOKEN", ) - client.test_suite_runs.test_suite_run_controller_update( - test_suite_id="testSuiteId", + client.provider_resources.provider_resource_controller_update_provider_resource( id="id", ) """ - _response = self._raw_client.test_suite_run_controller_update( - test_suite_id, id, name=name, request_options=request_options + _response = self._raw_client.provider_resource_controller_update_provider_resource( + id, request_options=request_options ) return _response.data -class AsyncTestSuiteRunsClient: +class AsyncProviderResourcesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._raw_client = AsyncRawTestSuiteRunsClient(client_wrapper=client_wrapper) + self._raw_client = AsyncRawProviderResourcesClient(client_wrapper=client_wrapper) @property - def with_raw_response(self) -> AsyncRawTestSuiteRunsClient: + def with_raw_response(self) -> AsyncRawProviderResourcesClient: """ Retrieves a raw implementation of this client that returns raw responses. Returns ------- - AsyncRawTestSuiteRunsClient + AsyncRawProviderResourcesClient """ return self._raw_client - async def test_suite_run_controller_find_all_paginated( + async def provider_resource_controller_get_provider_resources_paginated( self, - test_suite_id: str, *, + id: typing.Optional[str] = None, + resource_id: typing.Optional[str] = None, page: typing.Optional[float] = None, - sort_order: typing.Optional[TestSuiteRunControllerFindAllPaginatedRequestSortOrder] = None, + sort_order: typing.Optional[ProviderResourceControllerGetProviderResourcesPaginatedRequestSortOrder] = None, limit: typing.Optional[float] = None, created_at_gt: typing.Optional[dt.datetime] = None, created_at_lt: typing.Optional[dt.datetime] = None, @@ -306,16 +278,18 @@ async def test_suite_run_controller_find_all_paginated( updated_at_ge: typing.Optional[dt.datetime] = None, updated_at_le: typing.Optional[dt.datetime] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> TestSuiteRunsPaginatedResponse: + ) -> ProviderResourcePaginatedResponse: """ Parameters ---------- - test_suite_id : str + id : typing.Optional[str] + + resource_id : typing.Optional[str] page : typing.Optional[float] This is the page number to return. Defaults to 1. - sort_order : typing.Optional[TestSuiteRunControllerFindAllPaginatedRequestSortOrder] + sort_order : typing.Optional[ProviderResourceControllerGetProviderResourcesPaginatedRequestSortOrder] This is the sort order for pagination. Defaults to 'DESC'. limit : typing.Optional[float] @@ -350,8 +324,8 @@ async def test_suite_run_controller_find_all_paginated( Returns ------- - TestSuiteRunsPaginatedResponse - + ProviderResourcePaginatedResponse + List of provider resources Examples -------- @@ -365,15 +339,14 @@ async def test_suite_run_controller_find_all_paginated( async def main() -> None: - await client.test_suite_runs.test_suite_run_controller_find_all_paginated( - test_suite_id="testSuiteId", - ) + await client.provider_resources.provider_resource_controller_get_provider_resources_paginated() asyncio.run(main()) """ - _response = await self._raw_client.test_suite_run_controller_find_all_paginated( - test_suite_id, + _response = await self._raw_client.provider_resource_controller_get_provider_resources_paginated( + id=id, + resource_id=resource_id, page=page, sort_order=sort_order, limit=limit, @@ -389,28 +362,19 @@ async def main() -> None: ) return _response.data - async def test_suite_run_controller_create( - self, - test_suite_id: str, - *, - name: typing.Optional[str] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> TestSuiteRun: + async def provider_resource_controller_create_provider_resource( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> ProviderResource: """ Parameters ---------- - test_suite_id : str - - name : typing.Optional[str] - This is the name of the test suite run. - request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - TestSuiteRun - + ProviderResource + Successfully created provider resource Examples -------- @@ -424,26 +388,22 @@ async def test_suite_run_controller_create( async def main() -> None: - await client.test_suite_runs.test_suite_run_controller_create( - test_suite_id="testSuiteId", - ) + await client.provider_resources.provider_resource_controller_create_provider_resource() asyncio.run(main()) """ - _response = await self._raw_client.test_suite_run_controller_create( - test_suite_id, name=name, request_options=request_options + _response = await self._raw_client.provider_resource_controller_create_provider_resource( + request_options=request_options ) return _response.data - async def test_suite_run_controller_find_one( - self, test_suite_id: str, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> TestSuiteRun: + async def provider_resource_controller_get_provider_resource( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> ProviderResource: """ Parameters ---------- - test_suite_id : str - id : str request_options : typing.Optional[RequestOptions] @@ -451,8 +411,8 @@ async def test_suite_run_controller_find_one( Returns ------- - TestSuiteRun - + ProviderResource + Successfully retrieved provider resource Examples -------- @@ -466,27 +426,24 @@ async def test_suite_run_controller_find_one( async def main() -> None: - await client.test_suite_runs.test_suite_run_controller_find_one( - test_suite_id="testSuiteId", + await client.provider_resources.provider_resource_controller_get_provider_resource( id="id", ) asyncio.run(main()) """ - _response = await self._raw_client.test_suite_run_controller_find_one( - test_suite_id, id, request_options=request_options + _response = await self._raw_client.provider_resource_controller_get_provider_resource( + id, request_options=request_options ) return _response.data - async def test_suite_run_controller_remove( - self, test_suite_id: str, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> TestSuiteRun: + async def provider_resource_controller_delete_provider_resource( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> ProviderResource: """ Parameters ---------- - test_suite_id : str - id : str request_options : typing.Optional[RequestOptions] @@ -494,7 +451,7 @@ async def test_suite_run_controller_remove( Returns ------- - TestSuiteRun + ProviderResource Examples @@ -509,43 +466,32 @@ async def test_suite_run_controller_remove( async def main() -> None: - await client.test_suite_runs.test_suite_run_controller_remove( - test_suite_id="testSuiteId", + await client.provider_resources.provider_resource_controller_delete_provider_resource( id="id", ) asyncio.run(main()) """ - _response = await self._raw_client.test_suite_run_controller_remove( - test_suite_id, id, request_options=request_options + _response = await self._raw_client.provider_resource_controller_delete_provider_resource( + id, request_options=request_options ) return _response.data - async def test_suite_run_controller_update( - self, - test_suite_id: str, - id: str, - *, - name: typing.Optional[str] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> TestSuiteRun: + async def provider_resource_controller_update_provider_resource( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> ProviderResource: """ Parameters ---------- - test_suite_id : str - id : str - name : typing.Optional[str] - This is the name of the test suite run. - request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - TestSuiteRun + ProviderResource Examples @@ -560,15 +506,14 @@ async def test_suite_run_controller_update( async def main() -> None: - await client.test_suite_runs.test_suite_run_controller_update( - test_suite_id="testSuiteId", + await client.provider_resources.provider_resource_controller_update_provider_resource( id="id", ) asyncio.run(main()) """ - _response = await self._raw_client.test_suite_run_controller_update( - test_suite_id, id, name=name, request_options=request_options + _response = await self._raw_client.provider_resource_controller_update_provider_resource( + id, request_options=request_options ) return _response.data diff --git a/src/vapi/test_suite_tests/raw_client.py b/src/vapi/provider_resources/raw_client.py similarity index 66% rename from src/vapi/test_suite_tests/raw_client.py rename to src/vapi/provider_resources/raw_client.py index 629f622..c06e179 100644 --- a/src/vapi/test_suite_tests/raw_client.py +++ b/src/vapi/provider_resources/raw_client.py @@ -10,33 +10,26 @@ from ..core.http_response import AsyncHttpResponse, HttpResponse from ..core.jsonable_encoder import jsonable_encoder from ..core.request_options import RequestOptions -from ..core.serialization import convert_and_respect_annotation_metadata from ..core.unchecked_base_model import construct_type -from ..types.test_suite_tests_paginated_response import TestSuiteTestsPaginatedResponse -from .types.test_suite_test_controller_create_request import TestSuiteTestControllerCreateRequest -from .types.test_suite_test_controller_create_response import TestSuiteTestControllerCreateResponse -from .types.test_suite_test_controller_find_all_paginated_request_sort_order import ( - TestSuiteTestControllerFindAllPaginatedRequestSortOrder, +from ..errors.not_found_error import NotFoundError +from ..types.provider_resource import ProviderResource +from ..types.provider_resource_paginated_response import ProviderResourcePaginatedResponse +from .types.provider_resource_controller_get_provider_resources_paginated_request_sort_order import ( + ProviderResourceControllerGetProviderResourcesPaginatedRequestSortOrder, ) -from .types.test_suite_test_controller_find_one_response import TestSuiteTestControllerFindOneResponse -from .types.test_suite_test_controller_remove_response import TestSuiteTestControllerRemoveResponse -from .types.test_suite_test_controller_update_request import TestSuiteTestControllerUpdateRequest -from .types.test_suite_test_controller_update_response import TestSuiteTestControllerUpdateResponse -# this is used as the default value for optional parameters -OMIT = typing.cast(typing.Any, ...) - -class RawTestSuiteTestsClient: +class RawProviderResourcesClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def test_suite_test_controller_find_all_paginated( + def provider_resource_controller_get_provider_resources_paginated( self, - test_suite_id: str, *, + id: typing.Optional[str] = None, + resource_id: typing.Optional[str] = None, page: typing.Optional[float] = None, - sort_order: typing.Optional[TestSuiteTestControllerFindAllPaginatedRequestSortOrder] = None, + sort_order: typing.Optional[ProviderResourceControllerGetProviderResourcesPaginatedRequestSortOrder] = None, limit: typing.Optional[float] = None, created_at_gt: typing.Optional[dt.datetime] = None, created_at_lt: typing.Optional[dt.datetime] = None, @@ -47,16 +40,18 @@ def test_suite_test_controller_find_all_paginated( updated_at_ge: typing.Optional[dt.datetime] = None, updated_at_le: typing.Optional[dt.datetime] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[TestSuiteTestsPaginatedResponse]: + ) -> HttpResponse[ProviderResourcePaginatedResponse]: """ Parameters ---------- - test_suite_id : str + id : typing.Optional[str] + + resource_id : typing.Optional[str] page : typing.Optional[float] This is the page number to return. Defaults to 1. - sort_order : typing.Optional[TestSuiteTestControllerFindAllPaginatedRequestSortOrder] + sort_order : typing.Optional[ProviderResourceControllerGetProviderResourcesPaginatedRequestSortOrder] This is the sort order for pagination. Defaults to 'DESC'. limit : typing.Optional[float] @@ -91,13 +86,15 @@ def test_suite_test_controller_find_all_paginated( Returns ------- - HttpResponse[TestSuiteTestsPaginatedResponse] - + HttpResponse[ProviderResourcePaginatedResponse] + List of provider resources """ _response = self._client_wrapper.httpx_client.request( - f"test-suite/{jsonable_encoder(test_suite_id)}/test", + "provider/11labs/pronunciation-dictionary", method="GET", params={ + "id": id, + "resourceId": resource_id, "page": page, "sortOrder": sort_order, "limit": limit, @@ -115,9 +112,9 @@ def test_suite_test_controller_find_all_paginated( try: if 200 <= _response.status_code < 300: _data = typing.cast( - TestSuiteTestsPaginatedResponse, + ProviderResourcePaginatedResponse, construct_type( - type_=TestSuiteTestsPaginatedResponse, # type: ignore + type_=ProviderResourcePaginatedResponse, # type: ignore object_=_response.json(), ), ) @@ -127,46 +124,31 @@ def test_suite_test_controller_find_all_paginated( raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def test_suite_test_controller_create( - self, - test_suite_id: str, - *, - request: TestSuiteTestControllerCreateRequest, - request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[TestSuiteTestControllerCreateResponse]: + def provider_resource_controller_create_provider_resource( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[ProviderResource]: """ Parameters ---------- - test_suite_id : str - - request : TestSuiteTestControllerCreateRequest - request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - HttpResponse[TestSuiteTestControllerCreateResponse] - + HttpResponse[ProviderResource] + Successfully created provider resource """ _response = self._client_wrapper.httpx_client.request( - f"test-suite/{jsonable_encoder(test_suite_id)}/test", + "provider/11labs/pronunciation-dictionary", method="POST", - json=convert_and_respect_annotation_metadata( - object_=request, annotation=TestSuiteTestControllerCreateRequest, direction="write" - ), - headers={ - "content-type": "application/json", - }, request_options=request_options, - omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( - TestSuiteTestControllerCreateResponse, + ProviderResource, construct_type( - type_=TestSuiteTestControllerCreateResponse, # type: ignore + type_=ProviderResource, # type: ignore object_=_response.json(), ), ) @@ -176,14 +158,12 @@ def test_suite_test_controller_create( raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def test_suite_test_controller_find_one( - self, test_suite_id: str, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> HttpResponse[TestSuiteTestControllerFindOneResponse]: + def provider_resource_controller_get_provider_resource( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[ProviderResource]: """ Parameters ---------- - test_suite_id : str - id : str request_options : typing.Optional[RequestOptions] @@ -191,37 +171,46 @@ def test_suite_test_controller_find_one( Returns ------- - HttpResponse[TestSuiteTestControllerFindOneResponse] - + HttpResponse[ProviderResource] + Successfully retrieved provider resource """ _response = self._client_wrapper.httpx_client.request( - f"test-suite/{jsonable_encoder(test_suite_id)}/test/{jsonable_encoder(id)}", + f"provider/11labs/pronunciation-dictionary/{jsonable_encoder(id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( - TestSuiteTestControllerFindOneResponse, + ProviderResource, construct_type( - type_=TestSuiteTestControllerFindOneResponse, # type: ignore + type_=ProviderResource, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + typing.Optional[typing.Any], + construct_type( + type_=typing.Optional[typing.Any], # type: ignore + object_=_response.json(), + ), + ), + ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def test_suite_test_controller_remove( - self, test_suite_id: str, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> HttpResponse[TestSuiteTestControllerRemoveResponse]: + def provider_resource_controller_delete_provider_resource( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[ProviderResource]: """ Parameters ---------- - test_suite_id : str - id : str request_options : typing.Optional[RequestOptions] @@ -229,92 +218,99 @@ def test_suite_test_controller_remove( Returns ------- - HttpResponse[TestSuiteTestControllerRemoveResponse] + HttpResponse[ProviderResource] """ _response = self._client_wrapper.httpx_client.request( - f"test-suite/{jsonable_encoder(test_suite_id)}/test/{jsonable_encoder(id)}", + f"provider/11labs/pronunciation-dictionary/{jsonable_encoder(id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( - TestSuiteTestControllerRemoveResponse, + ProviderResource, construct_type( - type_=TestSuiteTestControllerRemoveResponse, # type: ignore + type_=ProviderResource, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + typing.Optional[typing.Any], + construct_type( + type_=typing.Optional[typing.Any], # type: ignore + object_=_response.json(), + ), + ), + ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def test_suite_test_controller_update( - self, - test_suite_id: str, - id: str, - *, - request: TestSuiteTestControllerUpdateRequest, - request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[TestSuiteTestControllerUpdateResponse]: + def provider_resource_controller_update_provider_resource( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[ProviderResource]: """ Parameters ---------- - test_suite_id : str - id : str - request : TestSuiteTestControllerUpdateRequest - request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - HttpResponse[TestSuiteTestControllerUpdateResponse] + HttpResponse[ProviderResource] """ _response = self._client_wrapper.httpx_client.request( - f"test-suite/{jsonable_encoder(test_suite_id)}/test/{jsonable_encoder(id)}", + f"provider/11labs/pronunciation-dictionary/{jsonable_encoder(id)}", method="PATCH", - json=convert_and_respect_annotation_metadata( - object_=request, annotation=TestSuiteTestControllerUpdateRequest, direction="write" - ), - headers={ - "content-type": "application/json", - }, request_options=request_options, - omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( - TestSuiteTestControllerUpdateResponse, + ProviderResource, construct_type( - type_=TestSuiteTestControllerUpdateResponse, # type: ignore + type_=ProviderResource, # type: ignore object_=_response.json(), ), ) return HttpResponse(response=_response, data=_data) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + typing.Optional[typing.Any], + construct_type( + type_=typing.Optional[typing.Any], # type: ignore + object_=_response.json(), + ), + ), + ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) -class AsyncRawTestSuiteTestsClient: +class AsyncRawProviderResourcesClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper - async def test_suite_test_controller_find_all_paginated( + async def provider_resource_controller_get_provider_resources_paginated( self, - test_suite_id: str, *, + id: typing.Optional[str] = None, + resource_id: typing.Optional[str] = None, page: typing.Optional[float] = None, - sort_order: typing.Optional[TestSuiteTestControllerFindAllPaginatedRequestSortOrder] = None, + sort_order: typing.Optional[ProviderResourceControllerGetProviderResourcesPaginatedRequestSortOrder] = None, limit: typing.Optional[float] = None, created_at_gt: typing.Optional[dt.datetime] = None, created_at_lt: typing.Optional[dt.datetime] = None, @@ -325,16 +321,18 @@ async def test_suite_test_controller_find_all_paginated( updated_at_ge: typing.Optional[dt.datetime] = None, updated_at_le: typing.Optional[dt.datetime] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[TestSuiteTestsPaginatedResponse]: + ) -> AsyncHttpResponse[ProviderResourcePaginatedResponse]: """ Parameters ---------- - test_suite_id : str + id : typing.Optional[str] + + resource_id : typing.Optional[str] page : typing.Optional[float] This is the page number to return. Defaults to 1. - sort_order : typing.Optional[TestSuiteTestControllerFindAllPaginatedRequestSortOrder] + sort_order : typing.Optional[ProviderResourceControllerGetProviderResourcesPaginatedRequestSortOrder] This is the sort order for pagination. Defaults to 'DESC'. limit : typing.Optional[float] @@ -369,13 +367,15 @@ async def test_suite_test_controller_find_all_paginated( Returns ------- - AsyncHttpResponse[TestSuiteTestsPaginatedResponse] - + AsyncHttpResponse[ProviderResourcePaginatedResponse] + List of provider resources """ _response = await self._client_wrapper.httpx_client.request( - f"test-suite/{jsonable_encoder(test_suite_id)}/test", + "provider/11labs/pronunciation-dictionary", method="GET", params={ + "id": id, + "resourceId": resource_id, "page": page, "sortOrder": sort_order, "limit": limit, @@ -393,9 +393,9 @@ async def test_suite_test_controller_find_all_paginated( try: if 200 <= _response.status_code < 300: _data = typing.cast( - TestSuiteTestsPaginatedResponse, + ProviderResourcePaginatedResponse, construct_type( - type_=TestSuiteTestsPaginatedResponse, # type: ignore + type_=ProviderResourcePaginatedResponse, # type: ignore object_=_response.json(), ), ) @@ -405,46 +405,31 @@ async def test_suite_test_controller_find_all_paginated( raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - async def test_suite_test_controller_create( - self, - test_suite_id: str, - *, - request: TestSuiteTestControllerCreateRequest, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[TestSuiteTestControllerCreateResponse]: + async def provider_resource_controller_create_provider_resource( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[ProviderResource]: """ Parameters ---------- - test_suite_id : str - - request : TestSuiteTestControllerCreateRequest - request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - AsyncHttpResponse[TestSuiteTestControllerCreateResponse] - + AsyncHttpResponse[ProviderResource] + Successfully created provider resource """ _response = await self._client_wrapper.httpx_client.request( - f"test-suite/{jsonable_encoder(test_suite_id)}/test", + "provider/11labs/pronunciation-dictionary", method="POST", - json=convert_and_respect_annotation_metadata( - object_=request, annotation=TestSuiteTestControllerCreateRequest, direction="write" - ), - headers={ - "content-type": "application/json", - }, request_options=request_options, - omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( - TestSuiteTestControllerCreateResponse, + ProviderResource, construct_type( - type_=TestSuiteTestControllerCreateResponse, # type: ignore + type_=ProviderResource, # type: ignore object_=_response.json(), ), ) @@ -454,14 +439,12 @@ async def test_suite_test_controller_create( raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - async def test_suite_test_controller_find_one( - self, test_suite_id: str, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncHttpResponse[TestSuiteTestControllerFindOneResponse]: + async def provider_resource_controller_get_provider_resource( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[ProviderResource]: """ Parameters ---------- - test_suite_id : str - id : str request_options : typing.Optional[RequestOptions] @@ -469,37 +452,46 @@ async def test_suite_test_controller_find_one( Returns ------- - AsyncHttpResponse[TestSuiteTestControllerFindOneResponse] - + AsyncHttpResponse[ProviderResource] + Successfully retrieved provider resource """ _response = await self._client_wrapper.httpx_client.request( - f"test-suite/{jsonable_encoder(test_suite_id)}/test/{jsonable_encoder(id)}", + f"provider/11labs/pronunciation-dictionary/{jsonable_encoder(id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( - TestSuiteTestControllerFindOneResponse, + ProviderResource, construct_type( - type_=TestSuiteTestControllerFindOneResponse, # type: ignore + type_=ProviderResource, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + typing.Optional[typing.Any], + construct_type( + type_=typing.Optional[typing.Any], # type: ignore + object_=_response.json(), + ), + ), + ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - async def test_suite_test_controller_remove( - self, test_suite_id: str, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncHttpResponse[TestSuiteTestControllerRemoveResponse]: + async def provider_resource_controller_delete_provider_resource( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[ProviderResource]: """ Parameters ---------- - test_suite_id : str - id : str request_options : typing.Optional[RequestOptions] @@ -507,76 +499,82 @@ async def test_suite_test_controller_remove( Returns ------- - AsyncHttpResponse[TestSuiteTestControllerRemoveResponse] + AsyncHttpResponse[ProviderResource] """ _response = await self._client_wrapper.httpx_client.request( - f"test-suite/{jsonable_encoder(test_suite_id)}/test/{jsonable_encoder(id)}", + f"provider/11labs/pronunciation-dictionary/{jsonable_encoder(id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( - TestSuiteTestControllerRemoveResponse, + ProviderResource, construct_type( - type_=TestSuiteTestControllerRemoveResponse, # type: ignore + type_=ProviderResource, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + typing.Optional[typing.Any], + construct_type( + type_=typing.Optional[typing.Any], # type: ignore + object_=_response.json(), + ), + ), + ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - async def test_suite_test_controller_update( - self, - test_suite_id: str, - id: str, - *, - request: TestSuiteTestControllerUpdateRequest, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[TestSuiteTestControllerUpdateResponse]: + async def provider_resource_controller_update_provider_resource( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[ProviderResource]: """ Parameters ---------- - test_suite_id : str - id : str - request : TestSuiteTestControllerUpdateRequest - request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - AsyncHttpResponse[TestSuiteTestControllerUpdateResponse] + AsyncHttpResponse[ProviderResource] """ _response = await self._client_wrapper.httpx_client.request( - f"test-suite/{jsonable_encoder(test_suite_id)}/test/{jsonable_encoder(id)}", + f"provider/11labs/pronunciation-dictionary/{jsonable_encoder(id)}", method="PATCH", - json=convert_and_respect_annotation_metadata( - object_=request, annotation=TestSuiteTestControllerUpdateRequest, direction="write" - ), - headers={ - "content-type": "application/json", - }, request_options=request_options, - omit=OMIT, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( - TestSuiteTestControllerUpdateResponse, + ProviderResource, construct_type( - type_=TestSuiteTestControllerUpdateResponse, # type: ignore + type_=ProviderResource, # type: ignore object_=_response.json(), ), ) return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 404: + raise NotFoundError( + headers=dict(_response.headers), + body=typing.cast( + typing.Optional[typing.Any], + construct_type( + type_=typing.Optional[typing.Any], # type: ignore + object_=_response.json(), + ), + ), + ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) diff --git a/src/vapi/provider_resources/types/__init__.py b/src/vapi/provider_resources/types/__init__.py new file mode 100644 index 0000000..1d75a93 --- /dev/null +++ b/src/vapi/provider_resources/types/__init__.py @@ -0,0 +1,36 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .provider_resource_controller_get_provider_resources_paginated_request_sort_order import ( + ProviderResourceControllerGetProviderResourcesPaginatedRequestSortOrder, + ) +_dynamic_imports: typing.Dict[str, str] = { + "ProviderResourceControllerGetProviderResourcesPaginatedRequestSortOrder": ".provider_resource_controller_get_provider_resources_paginated_request_sort_order" +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = ["ProviderResourceControllerGetProviderResourcesPaginatedRequestSortOrder"] diff --git a/src/vapi/provider_resources/types/provider_resource_controller_get_provider_resources_paginated_request_sort_order.py b/src/vapi/provider_resources/types/provider_resource_controller_get_provider_resources_paginated_request_sort_order.py new file mode 100644 index 0000000..c94605b --- /dev/null +++ b/src/vapi/provider_resources/types/provider_resource_controller_get_provider_resources_paginated_request_sort_order.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ProviderResourceControllerGetProviderResourcesPaginatedRequestSortOrder = typing.Union[ + typing.Literal["ASC", "DESC"], typing.Any +] diff --git a/src/vapi/sessions/__init__.py b/src/vapi/sessions/__init__.py index c61581a..0b1aade 100644 --- a/src/vapi/sessions/__init__.py +++ b/src/vapi/sessions/__init__.py @@ -2,13 +2,44 @@ # isort: skip_file -from .types import ( - CreateSessionDtoMessagesItem, - CreateSessionDtoStatus, - SessionsListRequestSortOrder, - UpdateSessionDtoMessagesItem, - UpdateSessionDtoStatus, -) +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import ( + CreateSessionDtoMessagesItem, + CreateSessionDtoStatus, + SessionsListRequestSortOrder, + UpdateSessionDtoMessagesItem, + UpdateSessionDtoStatus, + ) +_dynamic_imports: typing.Dict[str, str] = { + "CreateSessionDtoMessagesItem": ".types", + "CreateSessionDtoStatus": ".types", + "SessionsListRequestSortOrder": ".types", + "UpdateSessionDtoMessagesItem": ".types", + "UpdateSessionDtoStatus": ".types", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + __all__ = [ "CreateSessionDtoMessagesItem", diff --git a/src/vapi/sessions/types/__init__.py b/src/vapi/sessions/types/__init__.py index 9ca25d3..134c5e4 100644 --- a/src/vapi/sessions/types/__init__.py +++ b/src/vapi/sessions/types/__init__.py @@ -2,11 +2,42 @@ # isort: skip_file -from .create_session_dto_messages_item import CreateSessionDtoMessagesItem -from .create_session_dto_status import CreateSessionDtoStatus -from .sessions_list_request_sort_order import SessionsListRequestSortOrder -from .update_session_dto_messages_item import UpdateSessionDtoMessagesItem -from .update_session_dto_status import UpdateSessionDtoStatus +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .create_session_dto_messages_item import CreateSessionDtoMessagesItem + from .create_session_dto_status import CreateSessionDtoStatus + from .sessions_list_request_sort_order import SessionsListRequestSortOrder + from .update_session_dto_messages_item import UpdateSessionDtoMessagesItem + from .update_session_dto_status import UpdateSessionDtoStatus +_dynamic_imports: typing.Dict[str, str] = { + "CreateSessionDtoMessagesItem": ".create_session_dto_messages_item", + "CreateSessionDtoStatus": ".create_session_dto_status", + "SessionsListRequestSortOrder": ".sessions_list_request_sort_order", + "UpdateSessionDtoMessagesItem": ".update_session_dto_messages_item", + "UpdateSessionDtoStatus": ".update_session_dto_status", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + __all__ = [ "CreateSessionDtoMessagesItem", diff --git a/src/vapi/structured_outputs/__init__.py b/src/vapi/structured_outputs/__init__.py new file mode 100644 index 0000000..3c808fc --- /dev/null +++ b/src/vapi/structured_outputs/__init__.py @@ -0,0 +1,44 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import ( + CreateStructuredOutputDtoModel, + StructuredOutputControllerFindAllRequestSortOrder, + UpdateStructuredOutputDtoModel, + ) +_dynamic_imports: typing.Dict[str, str] = { + "CreateStructuredOutputDtoModel": ".types", + "StructuredOutputControllerFindAllRequestSortOrder": ".types", + "UpdateStructuredOutputDtoModel": ".types", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = [ + "CreateStructuredOutputDtoModel", + "StructuredOutputControllerFindAllRequestSortOrder", + "UpdateStructuredOutputDtoModel", +] diff --git a/src/vapi/structured_outputs/client.py b/src/vapi/structured_outputs/client.py new file mode 100644 index 0000000..2a37330 --- /dev/null +++ b/src/vapi/structured_outputs/client.py @@ -0,0 +1,777 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ..core.request_options import RequestOptions +from ..types.json_schema import JsonSchema +from ..types.structured_output import StructuredOutput +from ..types.structured_output_paginated_response import StructuredOutputPaginatedResponse +from .raw_client import AsyncRawStructuredOutputsClient, RawStructuredOutputsClient +from .types.create_structured_output_dto_model import CreateStructuredOutputDtoModel +from .types.structured_output_controller_find_all_request_sort_order import ( + StructuredOutputControllerFindAllRequestSortOrder, +) +from .types.update_structured_output_dto_model import UpdateStructuredOutputDtoModel + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class StructuredOutputsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawStructuredOutputsClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawStructuredOutputsClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawStructuredOutputsClient + """ + return self._raw_client + + def structured_output_controller_find_all( + self, + *, + id: typing.Optional[str] = None, + name: typing.Optional[str] = None, + page: typing.Optional[float] = None, + sort_order: typing.Optional[StructuredOutputControllerFindAllRequestSortOrder] = None, + limit: typing.Optional[float] = None, + created_at_gt: typing.Optional[dt.datetime] = None, + created_at_lt: typing.Optional[dt.datetime] = None, + created_at_ge: typing.Optional[dt.datetime] = None, + created_at_le: typing.Optional[dt.datetime] = None, + updated_at_gt: typing.Optional[dt.datetime] = None, + updated_at_lt: typing.Optional[dt.datetime] = None, + updated_at_ge: typing.Optional[dt.datetime] = None, + updated_at_le: typing.Optional[dt.datetime] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> StructuredOutputPaginatedResponse: + """ + Parameters + ---------- + id : typing.Optional[str] + This will return structured outputs where the id matches the specified value. + + name : typing.Optional[str] + This will return structured outputs where the name matches the specified value. + + page : typing.Optional[float] + This is the page number to return. Defaults to 1. + + sort_order : typing.Optional[StructuredOutputControllerFindAllRequestSortOrder] + This is the sort order for pagination. Defaults to 'DESC'. + + limit : typing.Optional[float] + This is the maximum number of items to return. Defaults to 100. + + created_at_gt : typing.Optional[dt.datetime] + This will return items where the createdAt is greater than the specified value. + + created_at_lt : typing.Optional[dt.datetime] + This will return items where the createdAt is less than the specified value. + + created_at_ge : typing.Optional[dt.datetime] + This will return items where the createdAt is greater than or equal to the specified value. + + created_at_le : typing.Optional[dt.datetime] + This will return items where the createdAt is less than or equal to the specified value. + + updated_at_gt : typing.Optional[dt.datetime] + This will return items where the updatedAt is greater than the specified value. + + updated_at_lt : typing.Optional[dt.datetime] + This will return items where the updatedAt is less than the specified value. + + updated_at_ge : typing.Optional[dt.datetime] + This will return items where the updatedAt is greater than or equal to the specified value. + + updated_at_le : typing.Optional[dt.datetime] + This will return items where the updatedAt is less than or equal to the specified value. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + StructuredOutputPaginatedResponse + + + Examples + -------- + from vapi import Vapi + + client = Vapi( + token="YOUR_TOKEN", + ) + client.structured_outputs.structured_output_controller_find_all() + """ + _response = self._raw_client.structured_output_controller_find_all( + id=id, + name=name, + page=page, + sort_order=sort_order, + limit=limit, + created_at_gt=created_at_gt, + created_at_lt=created_at_lt, + created_at_ge=created_at_ge, + created_at_le=created_at_le, + updated_at_gt=updated_at_gt, + updated_at_lt=updated_at_lt, + updated_at_ge=updated_at_ge, + updated_at_le=updated_at_le, + request_options=request_options, + ) + return _response.data + + def structured_output_controller_create( + self, + *, + name: str, + schema: JsonSchema, + model: typing.Optional[CreateStructuredOutputDtoModel] = OMIT, + description: typing.Optional[str] = OMIT, + assistant_ids: typing.Optional[typing.Sequence[str]] = OMIT, + workflow_ids: typing.Optional[typing.Sequence[str]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> StructuredOutput: + """ + Parameters + ---------- + name : str + This is the name of the structured output. + + schema : JsonSchema + This is the JSON Schema definition for the structured output. + + This is required when creating a structured output. Defines the structure and validation rules for the data that will be extracted. Supports all JSON Schema features including: + - Objects and nested properties + - Arrays and array validation + - String, number, boolean, and null types + - Enums and const values + - Validation constraints (min/max, patterns, etc.) + - Composition with allOf, anyOf, oneOf + + model : typing.Optional[CreateStructuredOutputDtoModel] + This is the model that will be used to extract the structured output. + + To provide your own custom system and user prompts for structured output extraction, populate the messages array with your system and user messages. You can specify liquid templating in your system and user messages. + Between the system or user messages, you must reference either 'transcript' or 'messages' with the '{{}}' syntax to access the conversation history. + Between the system or user messages, you must reference a variation of the structured output with the '{{}}' syntax to access the structured output definition. + i.e.: + {{structuredOutput}} + {{structuredOutput.name}} + {{structuredOutput.description}} + {{structuredOutput.schema}} + + If model is not specified, GPT-4.1 will be used by default for extraction, utilizing default system and user prompts. + If messages or required fields are not specified, the default system and user prompts will be used. + + description : typing.Optional[str] + This is the description of what the structured output extracts. + + Use this to provide context about what data will be extracted and how it will be used. + + assistant_ids : typing.Optional[typing.Sequence[str]] + These are the assistant IDs that this structured output is linked to. + + When linked to assistants, this structured output will be available for extraction during those assistant's calls. + + workflow_ids : typing.Optional[typing.Sequence[str]] + These are the workflow IDs that this structured output is linked to. + + When linked to workflows, this structured output will be available for extraction during those workflow's execution. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + StructuredOutput + + + Examples + -------- + from vapi import JsonSchema, Vapi + + client = Vapi( + token="YOUR_TOKEN", + ) + client.structured_outputs.structured_output_controller_create( + name="name", + schema=JsonSchema( + type="string", + ), + ) + """ + _response = self._raw_client.structured_output_controller_create( + name=name, + schema=schema, + model=model, + description=description, + assistant_ids=assistant_ids, + workflow_ids=workflow_ids, + request_options=request_options, + ) + return _response.data + + def structured_output_controller_find_one( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> StructuredOutput: + """ + Parameters + ---------- + id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + StructuredOutput + + + Examples + -------- + from vapi import Vapi + + client = Vapi( + token="YOUR_TOKEN", + ) + client.structured_outputs.structured_output_controller_find_one( + id="id", + ) + """ + _response = self._raw_client.structured_output_controller_find_one(id, request_options=request_options) + return _response.data + + def structured_output_controller_remove( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> StructuredOutput: + """ + Parameters + ---------- + id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + StructuredOutput + + + Examples + -------- + from vapi import Vapi + + client = Vapi( + token="YOUR_TOKEN", + ) + client.structured_outputs.structured_output_controller_remove( + id="id", + ) + """ + _response = self._raw_client.structured_output_controller_remove(id, request_options=request_options) + return _response.data + + def structured_output_controller_update( + self, + id: str, + *, + schema_override: str, + model: typing.Optional[UpdateStructuredOutputDtoModel] = OMIT, + name: typing.Optional[str] = OMIT, + description: typing.Optional[str] = OMIT, + assistant_ids: typing.Optional[typing.Sequence[str]] = OMIT, + workflow_ids: typing.Optional[typing.Sequence[str]] = OMIT, + schema: typing.Optional[JsonSchema] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> StructuredOutput: + """ + Parameters + ---------- + id : str + + schema_override : str + + model : typing.Optional[UpdateStructuredOutputDtoModel] + This is the model that will be used to extract the structured output. + + To provide your own custom system and user prompts for structured output extraction, populate the messages array with your system and user messages. You can specify liquid templating in your system and user messages. + Between the system or user messages, you must reference either 'transcript' or 'messages' with the '{{}}' syntax to access the conversation history. + Between the system or user messages, you must reference a variation of the structured output with the '{{}}' syntax to access the structured output definition. + i.e.: + {{structuredOutput}} + {{structuredOutput.name}} + {{structuredOutput.description}} + {{structuredOutput.schema}} + + If model is not specified, GPT-4.1 will be used by default for extraction, utilizing default system and user prompts. + If messages or required fields are not specified, the default system and user prompts will be used. + + name : typing.Optional[str] + This is the name of the structured output. + + description : typing.Optional[str] + This is the description of what the structured output extracts. + + Use this to provide context about what data will be extracted and how it will be used. + + assistant_ids : typing.Optional[typing.Sequence[str]] + These are the assistant IDs that this structured output is linked to. + + When linked to assistants, this structured output will be available for extraction during those assistant's calls. + + workflow_ids : typing.Optional[typing.Sequence[str]] + These are the workflow IDs that this structured output is linked to. + + When linked to workflows, this structured output will be available for extraction during those workflow's execution. + + schema : typing.Optional[JsonSchema] + This is the JSON Schema definition for the structured output. + + Defines the structure and validation rules for the data that will be extracted. Supports all JSON Schema features including: + - Objects and nested properties + - Arrays and array validation + - String, number, boolean, and null types + - Enums and const values + - Validation constraints (min/max, patterns, etc.) + - Composition with allOf, anyOf, oneOf + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + StructuredOutput + + + Examples + -------- + from vapi import Vapi + + client = Vapi( + token="YOUR_TOKEN", + ) + client.structured_outputs.structured_output_controller_update( + id="id", + schema_override="schemaOverride", + ) + """ + _response = self._raw_client.structured_output_controller_update( + id, + schema_override=schema_override, + model=model, + name=name, + description=description, + assistant_ids=assistant_ids, + workflow_ids=workflow_ids, + schema=schema, + request_options=request_options, + ) + return _response.data + + +class AsyncStructuredOutputsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawStructuredOutputsClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawStructuredOutputsClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawStructuredOutputsClient + """ + return self._raw_client + + async def structured_output_controller_find_all( + self, + *, + id: typing.Optional[str] = None, + name: typing.Optional[str] = None, + page: typing.Optional[float] = None, + sort_order: typing.Optional[StructuredOutputControllerFindAllRequestSortOrder] = None, + limit: typing.Optional[float] = None, + created_at_gt: typing.Optional[dt.datetime] = None, + created_at_lt: typing.Optional[dt.datetime] = None, + created_at_ge: typing.Optional[dt.datetime] = None, + created_at_le: typing.Optional[dt.datetime] = None, + updated_at_gt: typing.Optional[dt.datetime] = None, + updated_at_lt: typing.Optional[dt.datetime] = None, + updated_at_ge: typing.Optional[dt.datetime] = None, + updated_at_le: typing.Optional[dt.datetime] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> StructuredOutputPaginatedResponse: + """ + Parameters + ---------- + id : typing.Optional[str] + This will return structured outputs where the id matches the specified value. + + name : typing.Optional[str] + This will return structured outputs where the name matches the specified value. + + page : typing.Optional[float] + This is the page number to return. Defaults to 1. + + sort_order : typing.Optional[StructuredOutputControllerFindAllRequestSortOrder] + This is the sort order for pagination. Defaults to 'DESC'. + + limit : typing.Optional[float] + This is the maximum number of items to return. Defaults to 100. + + created_at_gt : typing.Optional[dt.datetime] + This will return items where the createdAt is greater than the specified value. + + created_at_lt : typing.Optional[dt.datetime] + This will return items where the createdAt is less than the specified value. + + created_at_ge : typing.Optional[dt.datetime] + This will return items where the createdAt is greater than or equal to the specified value. + + created_at_le : typing.Optional[dt.datetime] + This will return items where the createdAt is less than or equal to the specified value. + + updated_at_gt : typing.Optional[dt.datetime] + This will return items where the updatedAt is greater than the specified value. + + updated_at_lt : typing.Optional[dt.datetime] + This will return items where the updatedAt is less than the specified value. + + updated_at_ge : typing.Optional[dt.datetime] + This will return items where the updatedAt is greater than or equal to the specified value. + + updated_at_le : typing.Optional[dt.datetime] + This will return items where the updatedAt is less than or equal to the specified value. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + StructuredOutputPaginatedResponse + + + Examples + -------- + import asyncio + + from vapi import AsyncVapi + + client = AsyncVapi( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.structured_outputs.structured_output_controller_find_all() + + + asyncio.run(main()) + """ + _response = await self._raw_client.structured_output_controller_find_all( + id=id, + name=name, + page=page, + sort_order=sort_order, + limit=limit, + created_at_gt=created_at_gt, + created_at_lt=created_at_lt, + created_at_ge=created_at_ge, + created_at_le=created_at_le, + updated_at_gt=updated_at_gt, + updated_at_lt=updated_at_lt, + updated_at_ge=updated_at_ge, + updated_at_le=updated_at_le, + request_options=request_options, + ) + return _response.data + + async def structured_output_controller_create( + self, + *, + name: str, + schema: JsonSchema, + model: typing.Optional[CreateStructuredOutputDtoModel] = OMIT, + description: typing.Optional[str] = OMIT, + assistant_ids: typing.Optional[typing.Sequence[str]] = OMIT, + workflow_ids: typing.Optional[typing.Sequence[str]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> StructuredOutput: + """ + Parameters + ---------- + name : str + This is the name of the structured output. + + schema : JsonSchema + This is the JSON Schema definition for the structured output. + + This is required when creating a structured output. Defines the structure and validation rules for the data that will be extracted. Supports all JSON Schema features including: + - Objects and nested properties + - Arrays and array validation + - String, number, boolean, and null types + - Enums and const values + - Validation constraints (min/max, patterns, etc.) + - Composition with allOf, anyOf, oneOf + + model : typing.Optional[CreateStructuredOutputDtoModel] + This is the model that will be used to extract the structured output. + + To provide your own custom system and user prompts for structured output extraction, populate the messages array with your system and user messages. You can specify liquid templating in your system and user messages. + Between the system or user messages, you must reference either 'transcript' or 'messages' with the '{{}}' syntax to access the conversation history. + Between the system or user messages, you must reference a variation of the structured output with the '{{}}' syntax to access the structured output definition. + i.e.: + {{structuredOutput}} + {{structuredOutput.name}} + {{structuredOutput.description}} + {{structuredOutput.schema}} + + If model is not specified, GPT-4.1 will be used by default for extraction, utilizing default system and user prompts. + If messages or required fields are not specified, the default system and user prompts will be used. + + description : typing.Optional[str] + This is the description of what the structured output extracts. + + Use this to provide context about what data will be extracted and how it will be used. + + assistant_ids : typing.Optional[typing.Sequence[str]] + These are the assistant IDs that this structured output is linked to. + + When linked to assistants, this structured output will be available for extraction during those assistant's calls. + + workflow_ids : typing.Optional[typing.Sequence[str]] + These are the workflow IDs that this structured output is linked to. + + When linked to workflows, this structured output will be available for extraction during those workflow's execution. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + StructuredOutput + + + Examples + -------- + import asyncio + + from vapi import AsyncVapi, JsonSchema + + client = AsyncVapi( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.structured_outputs.structured_output_controller_create( + name="name", + schema=JsonSchema( + type="string", + ), + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.structured_output_controller_create( + name=name, + schema=schema, + model=model, + description=description, + assistant_ids=assistant_ids, + workflow_ids=workflow_ids, + request_options=request_options, + ) + return _response.data + + async def structured_output_controller_find_one( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> StructuredOutput: + """ + Parameters + ---------- + id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + StructuredOutput + + + Examples + -------- + import asyncio + + from vapi import AsyncVapi + + client = AsyncVapi( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.structured_outputs.structured_output_controller_find_one( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.structured_output_controller_find_one(id, request_options=request_options) + return _response.data + + async def structured_output_controller_remove( + self, id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> StructuredOutput: + """ + Parameters + ---------- + id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + StructuredOutput + + + Examples + -------- + import asyncio + + from vapi import AsyncVapi + + client = AsyncVapi( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.structured_outputs.structured_output_controller_remove( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.structured_output_controller_remove(id, request_options=request_options) + return _response.data + + async def structured_output_controller_update( + self, + id: str, + *, + schema_override: str, + model: typing.Optional[UpdateStructuredOutputDtoModel] = OMIT, + name: typing.Optional[str] = OMIT, + description: typing.Optional[str] = OMIT, + assistant_ids: typing.Optional[typing.Sequence[str]] = OMIT, + workflow_ids: typing.Optional[typing.Sequence[str]] = OMIT, + schema: typing.Optional[JsonSchema] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> StructuredOutput: + """ + Parameters + ---------- + id : str + + schema_override : str + + model : typing.Optional[UpdateStructuredOutputDtoModel] + This is the model that will be used to extract the structured output. + + To provide your own custom system and user prompts for structured output extraction, populate the messages array with your system and user messages. You can specify liquid templating in your system and user messages. + Between the system or user messages, you must reference either 'transcript' or 'messages' with the '{{}}' syntax to access the conversation history. + Between the system or user messages, you must reference a variation of the structured output with the '{{}}' syntax to access the structured output definition. + i.e.: + {{structuredOutput}} + {{structuredOutput.name}} + {{structuredOutput.description}} + {{structuredOutput.schema}} + + If model is not specified, GPT-4.1 will be used by default for extraction, utilizing default system and user prompts. + If messages or required fields are not specified, the default system and user prompts will be used. + + name : typing.Optional[str] + This is the name of the structured output. + + description : typing.Optional[str] + This is the description of what the structured output extracts. + + Use this to provide context about what data will be extracted and how it will be used. + + assistant_ids : typing.Optional[typing.Sequence[str]] + These are the assistant IDs that this structured output is linked to. + + When linked to assistants, this structured output will be available for extraction during those assistant's calls. + + workflow_ids : typing.Optional[typing.Sequence[str]] + These are the workflow IDs that this structured output is linked to. + + When linked to workflows, this structured output will be available for extraction during those workflow's execution. + + schema : typing.Optional[JsonSchema] + This is the JSON Schema definition for the structured output. + + Defines the structure and validation rules for the data that will be extracted. Supports all JSON Schema features including: + - Objects and nested properties + - Arrays and array validation + - String, number, boolean, and null types + - Enums and const values + - Validation constraints (min/max, patterns, etc.) + - Composition with allOf, anyOf, oneOf + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + StructuredOutput + + + Examples + -------- + import asyncio + + from vapi import AsyncVapi + + client = AsyncVapi( + token="YOUR_TOKEN", + ) + + + async def main() -> None: + await client.structured_outputs.structured_output_controller_update( + id="id", + schema_override="schemaOverride", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.structured_output_controller_update( + id, + schema_override=schema_override, + model=model, + name=name, + description=description, + assistant_ids=assistant_ids, + workflow_ids=workflow_ids, + schema=schema, + request_options=request_options, + ) + return _response.data diff --git a/src/vapi/test_suites/raw_client.py b/src/vapi/structured_outputs/raw_client.py similarity index 50% rename from src/vapi/test_suites/raw_client.py rename to src/vapi/structured_outputs/raw_client.py index 4bbb5f7..04614bc 100644 --- a/src/vapi/test_suites/raw_client.py +++ b/src/vapi/structured_outputs/raw_client.py @@ -12,27 +12,30 @@ from ..core.request_options import RequestOptions from ..core.serialization import convert_and_respect_annotation_metadata from ..core.unchecked_base_model import construct_type -from ..types.target_plan import TargetPlan -from ..types.test_suite import TestSuite -from ..types.test_suites_paginated_response import TestSuitesPaginatedResponse -from ..types.tester_plan import TesterPlan -from .types.test_suite_controller_find_all_paginated_request_sort_order import ( - TestSuiteControllerFindAllPaginatedRequestSortOrder, +from ..types.json_schema import JsonSchema +from ..types.structured_output import StructuredOutput +from ..types.structured_output_paginated_response import StructuredOutputPaginatedResponse +from .types.create_structured_output_dto_model import CreateStructuredOutputDtoModel +from .types.structured_output_controller_find_all_request_sort_order import ( + StructuredOutputControllerFindAllRequestSortOrder, ) +from .types.update_structured_output_dto_model import UpdateStructuredOutputDtoModel # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) -class RawTestSuitesClient: +class RawStructuredOutputsClient: def __init__(self, *, client_wrapper: SyncClientWrapper): self._client_wrapper = client_wrapper - def test_suite_controller_find_all_paginated( + def structured_output_controller_find_all( self, *, + id: typing.Optional[str] = None, + name: typing.Optional[str] = None, page: typing.Optional[float] = None, - sort_order: typing.Optional[TestSuiteControllerFindAllPaginatedRequestSortOrder] = None, + sort_order: typing.Optional[StructuredOutputControllerFindAllRequestSortOrder] = None, limit: typing.Optional[float] = None, created_at_gt: typing.Optional[dt.datetime] = None, created_at_lt: typing.Optional[dt.datetime] = None, @@ -43,14 +46,20 @@ def test_suite_controller_find_all_paginated( updated_at_ge: typing.Optional[dt.datetime] = None, updated_at_le: typing.Optional[dt.datetime] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[TestSuitesPaginatedResponse]: + ) -> HttpResponse[StructuredOutputPaginatedResponse]: """ Parameters ---------- + id : typing.Optional[str] + This will return structured outputs where the id matches the specified value. + + name : typing.Optional[str] + This will return structured outputs where the name matches the specified value. + page : typing.Optional[float] This is the page number to return. Defaults to 1. - sort_order : typing.Optional[TestSuiteControllerFindAllPaginatedRequestSortOrder] + sort_order : typing.Optional[StructuredOutputControllerFindAllRequestSortOrder] This is the sort order for pagination. Defaults to 'DESC'. limit : typing.Optional[float] @@ -85,13 +94,15 @@ def test_suite_controller_find_all_paginated( Returns ------- - HttpResponse[TestSuitesPaginatedResponse] + HttpResponse[StructuredOutputPaginatedResponse] """ _response = self._client_wrapper.httpx_client.request( - "test-suite", + "structured-output", method="GET", params={ + "id": id, + "name": name, "page": page, "sortOrder": sort_order, "limit": limit, @@ -109,9 +120,9 @@ def test_suite_controller_find_all_paginated( try: if 200 <= _response.status_code < 300: _data = typing.cast( - TestSuitesPaginatedResponse, + StructuredOutputPaginatedResponse, construct_type( - type_=TestSuitesPaginatedResponse, # type: ignore + type_=StructuredOutputPaginatedResponse, # type: ignore object_=_response.json(), ), ) @@ -121,52 +132,86 @@ def test_suite_controller_find_all_paginated( raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def test_suite_controller_create( + def structured_output_controller_create( self, *, - name: typing.Optional[str] = OMIT, - phone_number_id: typing.Optional[str] = OMIT, - tester_plan: typing.Optional[TesterPlan] = OMIT, - target_plan: typing.Optional[TargetPlan] = OMIT, + name: str, + schema: JsonSchema, + model: typing.Optional[CreateStructuredOutputDtoModel] = OMIT, + description: typing.Optional[str] = OMIT, + assistant_ids: typing.Optional[typing.Sequence[str]] = OMIT, + workflow_ids: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[TestSuite]: + ) -> HttpResponse[StructuredOutput]: """ Parameters ---------- - name : typing.Optional[str] - This is the name of the test suite. + name : str + This is the name of the structured output. + + schema : JsonSchema + This is the JSON Schema definition for the structured output. - phone_number_id : typing.Optional[str] - This is the phone number ID associated with this test suite. + This is required when creating a structured output. Defines the structure and validation rules for the data that will be extracted. Supports all JSON Schema features including: + - Objects and nested properties + - Arrays and array validation + - String, number, boolean, and null types + - Enums and const values + - Validation constraints (min/max, patterns, etc.) + - Composition with allOf, anyOf, oneOf - tester_plan : typing.Optional[TesterPlan] - Override the default tester plan by providing custom assistant configuration for the test agent. + model : typing.Optional[CreateStructuredOutputDtoModel] + This is the model that will be used to extract the structured output. - We recommend only using this if you are confident, as we have already set sensible defaults on the tester plan. + To provide your own custom system and user prompts for structured output extraction, populate the messages array with your system and user messages. You can specify liquid templating in your system and user messages. + Between the system or user messages, you must reference either 'transcript' or 'messages' with the '{{}}' syntax to access the conversation history. + Between the system or user messages, you must reference a variation of the structured output with the '{{}}' syntax to access the structured output definition. + i.e.: + {{structuredOutput}} + {{structuredOutput.name}} + {{structuredOutput.description}} + {{structuredOutput.schema}} - target_plan : typing.Optional[TargetPlan] - These are the configuration for the assistant / phone number that is being tested. + If model is not specified, GPT-4.1 will be used by default for extraction, utilizing default system and user prompts. + If messages or required fields are not specified, the default system and user prompts will be used. + + description : typing.Optional[str] + This is the description of what the structured output extracts. + + Use this to provide context about what data will be extracted and how it will be used. + + assistant_ids : typing.Optional[typing.Sequence[str]] + These are the assistant IDs that this structured output is linked to. + + When linked to assistants, this structured output will be available for extraction during those assistant's calls. + + workflow_ids : typing.Optional[typing.Sequence[str]] + These are the workflow IDs that this structured output is linked to. + + When linked to workflows, this structured output will be available for extraction during those workflow's execution. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - HttpResponse[TestSuite] + HttpResponse[StructuredOutput] """ _response = self._client_wrapper.httpx_client.request( - "test-suite", + "structured-output", method="POST", json={ - "name": name, - "phoneNumberId": phone_number_id, - "testerPlan": convert_and_respect_annotation_metadata( - object_=tester_plan, annotation=TesterPlan, direction="write" + "model": convert_and_respect_annotation_metadata( + object_=model, annotation=CreateStructuredOutputDtoModel, direction="write" ), - "targetPlan": convert_and_respect_annotation_metadata( - object_=target_plan, annotation=TargetPlan, direction="write" + "name": name, + "schema": convert_and_respect_annotation_metadata( + object_=schema, annotation=JsonSchema, direction="write" ), + "description": description, + "assistantIds": assistant_ids, + "workflowIds": workflow_ids, }, headers={ "content-type": "application/json", @@ -177,9 +222,9 @@ def test_suite_controller_create( try: if 200 <= _response.status_code < 300: _data = typing.cast( - TestSuite, + StructuredOutput, construct_type( - type_=TestSuite, # type: ignore + type_=StructuredOutput, # type: ignore object_=_response.json(), ), ) @@ -189,9 +234,9 @@ def test_suite_controller_create( raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def test_suite_controller_find_one( + def structured_output_controller_find_one( self, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> HttpResponse[TestSuite]: + ) -> HttpResponse[StructuredOutput]: """ Parameters ---------- @@ -202,20 +247,20 @@ def test_suite_controller_find_one( Returns ------- - HttpResponse[TestSuite] + HttpResponse[StructuredOutput] """ _response = self._client_wrapper.httpx_client.request( - f"test-suite/{jsonable_encoder(id)}", + f"structured-output/{jsonable_encoder(id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( - TestSuite, + StructuredOutput, construct_type( - type_=TestSuite, # type: ignore + type_=StructuredOutput, # type: ignore object_=_response.json(), ), ) @@ -225,9 +270,9 @@ def test_suite_controller_find_one( raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def test_suite_controller_remove( + def structured_output_controller_remove( self, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> HttpResponse[TestSuite]: + ) -> HttpResponse[StructuredOutput]: """ Parameters ---------- @@ -238,20 +283,20 @@ def test_suite_controller_remove( Returns ------- - HttpResponse[TestSuite] + HttpResponse[StructuredOutput] """ _response = self._client_wrapper.httpx_client.request( - f"test-suite/{jsonable_encoder(id)}", + f"structured-output/{jsonable_encoder(id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( - TestSuite, + StructuredOutput, construct_type( - type_=TestSuite, # type: ignore + type_=StructuredOutput, # type: ignore object_=_response.json(), ), ) @@ -261,54 +306,94 @@ def test_suite_controller_remove( raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - def test_suite_controller_update( + def structured_output_controller_update( self, id: str, *, + schema_override: str, + model: typing.Optional[UpdateStructuredOutputDtoModel] = OMIT, name: typing.Optional[str] = OMIT, - phone_number_id: typing.Optional[str] = OMIT, - tester_plan: typing.Optional[TesterPlan] = OMIT, - target_plan: typing.Optional[TargetPlan] = OMIT, + description: typing.Optional[str] = OMIT, + assistant_ids: typing.Optional[typing.Sequence[str]] = OMIT, + workflow_ids: typing.Optional[typing.Sequence[str]] = OMIT, + schema: typing.Optional[JsonSchema] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[TestSuite]: + ) -> HttpResponse[StructuredOutput]: """ Parameters ---------- id : str + schema_override : str + + model : typing.Optional[UpdateStructuredOutputDtoModel] + This is the model that will be used to extract the structured output. + + To provide your own custom system and user prompts for structured output extraction, populate the messages array with your system and user messages. You can specify liquid templating in your system and user messages. + Between the system or user messages, you must reference either 'transcript' or 'messages' with the '{{}}' syntax to access the conversation history. + Between the system or user messages, you must reference a variation of the structured output with the '{{}}' syntax to access the structured output definition. + i.e.: + {{structuredOutput}} + {{structuredOutput.name}} + {{structuredOutput.description}} + {{structuredOutput.schema}} + + If model is not specified, GPT-4.1 will be used by default for extraction, utilizing default system and user prompts. + If messages or required fields are not specified, the default system and user prompts will be used. + name : typing.Optional[str] - This is the name of the test suite. + This is the name of the structured output. + + description : typing.Optional[str] + This is the description of what the structured output extracts. + + Use this to provide context about what data will be extracted and how it will be used. - phone_number_id : typing.Optional[str] - This is the phone number ID associated with this test suite. + assistant_ids : typing.Optional[typing.Sequence[str]] + These are the assistant IDs that this structured output is linked to. - tester_plan : typing.Optional[TesterPlan] - Override the default tester plan by providing custom assistant configuration for the test agent. + When linked to assistants, this structured output will be available for extraction during those assistant's calls. - We recommend only using this if you are confident, as we have already set sensible defaults on the tester plan. + workflow_ids : typing.Optional[typing.Sequence[str]] + These are the workflow IDs that this structured output is linked to. - target_plan : typing.Optional[TargetPlan] - These are the configuration for the assistant / phone number that is being tested. + When linked to workflows, this structured output will be available for extraction during those workflow's execution. + + schema : typing.Optional[JsonSchema] + This is the JSON Schema definition for the structured output. + + Defines the structure and validation rules for the data that will be extracted. Supports all JSON Schema features including: + - Objects and nested properties + - Arrays and array validation + - String, number, boolean, and null types + - Enums and const values + - Validation constraints (min/max, patterns, etc.) + - Composition with allOf, anyOf, oneOf request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - HttpResponse[TestSuite] + HttpResponse[StructuredOutput] """ _response = self._client_wrapper.httpx_client.request( - f"test-suite/{jsonable_encoder(id)}", + f"structured-output/{jsonable_encoder(id)}", method="PATCH", + params={ + "schemaOverride": schema_override, + }, json={ - "name": name, - "phoneNumberId": phone_number_id, - "testerPlan": convert_and_respect_annotation_metadata( - object_=tester_plan, annotation=TesterPlan, direction="write" + "model": convert_and_respect_annotation_metadata( + object_=model, annotation=UpdateStructuredOutputDtoModel, direction="write" ), - "targetPlan": convert_and_respect_annotation_metadata( - object_=target_plan, annotation=TargetPlan, direction="write" + "name": name, + "description": description, + "assistantIds": assistant_ids, + "workflowIds": workflow_ids, + "schema": convert_and_respect_annotation_metadata( + object_=schema, annotation=JsonSchema, direction="write" ), }, headers={ @@ -320,9 +405,9 @@ def test_suite_controller_update( try: if 200 <= _response.status_code < 300: _data = typing.cast( - TestSuite, + StructuredOutput, construct_type( - type_=TestSuite, # type: ignore + type_=StructuredOutput, # type: ignore object_=_response.json(), ), ) @@ -333,15 +418,17 @@ def test_suite_controller_update( raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) -class AsyncRawTestSuitesClient: +class AsyncRawStructuredOutputsClient: def __init__(self, *, client_wrapper: AsyncClientWrapper): self._client_wrapper = client_wrapper - async def test_suite_controller_find_all_paginated( + async def structured_output_controller_find_all( self, *, + id: typing.Optional[str] = None, + name: typing.Optional[str] = None, page: typing.Optional[float] = None, - sort_order: typing.Optional[TestSuiteControllerFindAllPaginatedRequestSortOrder] = None, + sort_order: typing.Optional[StructuredOutputControllerFindAllRequestSortOrder] = None, limit: typing.Optional[float] = None, created_at_gt: typing.Optional[dt.datetime] = None, created_at_lt: typing.Optional[dt.datetime] = None, @@ -352,14 +439,20 @@ async def test_suite_controller_find_all_paginated( updated_at_ge: typing.Optional[dt.datetime] = None, updated_at_le: typing.Optional[dt.datetime] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[TestSuitesPaginatedResponse]: + ) -> AsyncHttpResponse[StructuredOutputPaginatedResponse]: """ Parameters ---------- + id : typing.Optional[str] + This will return structured outputs where the id matches the specified value. + + name : typing.Optional[str] + This will return structured outputs where the name matches the specified value. + page : typing.Optional[float] This is the page number to return. Defaults to 1. - sort_order : typing.Optional[TestSuiteControllerFindAllPaginatedRequestSortOrder] + sort_order : typing.Optional[StructuredOutputControllerFindAllRequestSortOrder] This is the sort order for pagination. Defaults to 'DESC'. limit : typing.Optional[float] @@ -394,13 +487,15 @@ async def test_suite_controller_find_all_paginated( Returns ------- - AsyncHttpResponse[TestSuitesPaginatedResponse] + AsyncHttpResponse[StructuredOutputPaginatedResponse] """ _response = await self._client_wrapper.httpx_client.request( - "test-suite", + "structured-output", method="GET", params={ + "id": id, + "name": name, "page": page, "sortOrder": sort_order, "limit": limit, @@ -418,9 +513,9 @@ async def test_suite_controller_find_all_paginated( try: if 200 <= _response.status_code < 300: _data = typing.cast( - TestSuitesPaginatedResponse, + StructuredOutputPaginatedResponse, construct_type( - type_=TestSuitesPaginatedResponse, # type: ignore + type_=StructuredOutputPaginatedResponse, # type: ignore object_=_response.json(), ), ) @@ -430,52 +525,86 @@ async def test_suite_controller_find_all_paginated( raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - async def test_suite_controller_create( + async def structured_output_controller_create( self, *, - name: typing.Optional[str] = OMIT, - phone_number_id: typing.Optional[str] = OMIT, - tester_plan: typing.Optional[TesterPlan] = OMIT, - target_plan: typing.Optional[TargetPlan] = OMIT, + name: str, + schema: JsonSchema, + model: typing.Optional[CreateStructuredOutputDtoModel] = OMIT, + description: typing.Optional[str] = OMIT, + assistant_ids: typing.Optional[typing.Sequence[str]] = OMIT, + workflow_ids: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[TestSuite]: + ) -> AsyncHttpResponse[StructuredOutput]: """ Parameters ---------- - name : typing.Optional[str] - This is the name of the test suite. + name : str + This is the name of the structured output. + + schema : JsonSchema + This is the JSON Schema definition for the structured output. - phone_number_id : typing.Optional[str] - This is the phone number ID associated with this test suite. + This is required when creating a structured output. Defines the structure and validation rules for the data that will be extracted. Supports all JSON Schema features including: + - Objects and nested properties + - Arrays and array validation + - String, number, boolean, and null types + - Enums and const values + - Validation constraints (min/max, patterns, etc.) + - Composition with allOf, anyOf, oneOf - tester_plan : typing.Optional[TesterPlan] - Override the default tester plan by providing custom assistant configuration for the test agent. + model : typing.Optional[CreateStructuredOutputDtoModel] + This is the model that will be used to extract the structured output. - We recommend only using this if you are confident, as we have already set sensible defaults on the tester plan. + To provide your own custom system and user prompts for structured output extraction, populate the messages array with your system and user messages. You can specify liquid templating in your system and user messages. + Between the system or user messages, you must reference either 'transcript' or 'messages' with the '{{}}' syntax to access the conversation history. + Between the system or user messages, you must reference a variation of the structured output with the '{{}}' syntax to access the structured output definition. + i.e.: + {{structuredOutput}} + {{structuredOutput.name}} + {{structuredOutput.description}} + {{structuredOutput.schema}} - target_plan : typing.Optional[TargetPlan] - These are the configuration for the assistant / phone number that is being tested. + If model is not specified, GPT-4.1 will be used by default for extraction, utilizing default system and user prompts. + If messages or required fields are not specified, the default system and user prompts will be used. + + description : typing.Optional[str] + This is the description of what the structured output extracts. + + Use this to provide context about what data will be extracted and how it will be used. + + assistant_ids : typing.Optional[typing.Sequence[str]] + These are the assistant IDs that this structured output is linked to. + + When linked to assistants, this structured output will be available for extraction during those assistant's calls. + + workflow_ids : typing.Optional[typing.Sequence[str]] + These are the workflow IDs that this structured output is linked to. + + When linked to workflows, this structured output will be available for extraction during those workflow's execution. request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - AsyncHttpResponse[TestSuite] + AsyncHttpResponse[StructuredOutput] """ _response = await self._client_wrapper.httpx_client.request( - "test-suite", + "structured-output", method="POST", json={ - "name": name, - "phoneNumberId": phone_number_id, - "testerPlan": convert_and_respect_annotation_metadata( - object_=tester_plan, annotation=TesterPlan, direction="write" + "model": convert_and_respect_annotation_metadata( + object_=model, annotation=CreateStructuredOutputDtoModel, direction="write" ), - "targetPlan": convert_and_respect_annotation_metadata( - object_=target_plan, annotation=TargetPlan, direction="write" + "name": name, + "schema": convert_and_respect_annotation_metadata( + object_=schema, annotation=JsonSchema, direction="write" ), + "description": description, + "assistantIds": assistant_ids, + "workflowIds": workflow_ids, }, headers={ "content-type": "application/json", @@ -486,9 +615,9 @@ async def test_suite_controller_create( try: if 200 <= _response.status_code < 300: _data = typing.cast( - TestSuite, + StructuredOutput, construct_type( - type_=TestSuite, # type: ignore + type_=StructuredOutput, # type: ignore object_=_response.json(), ), ) @@ -498,9 +627,9 @@ async def test_suite_controller_create( raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - async def test_suite_controller_find_one( + async def structured_output_controller_find_one( self, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncHttpResponse[TestSuite]: + ) -> AsyncHttpResponse[StructuredOutput]: """ Parameters ---------- @@ -511,20 +640,20 @@ async def test_suite_controller_find_one( Returns ------- - AsyncHttpResponse[TestSuite] + AsyncHttpResponse[StructuredOutput] """ _response = await self._client_wrapper.httpx_client.request( - f"test-suite/{jsonable_encoder(id)}", + f"structured-output/{jsonable_encoder(id)}", method="GET", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( - TestSuite, + StructuredOutput, construct_type( - type_=TestSuite, # type: ignore + type_=StructuredOutput, # type: ignore object_=_response.json(), ), ) @@ -534,9 +663,9 @@ async def test_suite_controller_find_one( raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - async def test_suite_controller_remove( + async def structured_output_controller_remove( self, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncHttpResponse[TestSuite]: + ) -> AsyncHttpResponse[StructuredOutput]: """ Parameters ---------- @@ -547,20 +676,20 @@ async def test_suite_controller_remove( Returns ------- - AsyncHttpResponse[TestSuite] + AsyncHttpResponse[StructuredOutput] """ _response = await self._client_wrapper.httpx_client.request( - f"test-suite/{jsonable_encoder(id)}", + f"structured-output/{jsonable_encoder(id)}", method="DELETE", request_options=request_options, ) try: if 200 <= _response.status_code < 300: _data = typing.cast( - TestSuite, + StructuredOutput, construct_type( - type_=TestSuite, # type: ignore + type_=StructuredOutput, # type: ignore object_=_response.json(), ), ) @@ -570,54 +699,94 @@ async def test_suite_controller_remove( raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - async def test_suite_controller_update( + async def structured_output_controller_update( self, id: str, *, + schema_override: str, + model: typing.Optional[UpdateStructuredOutputDtoModel] = OMIT, name: typing.Optional[str] = OMIT, - phone_number_id: typing.Optional[str] = OMIT, - tester_plan: typing.Optional[TesterPlan] = OMIT, - target_plan: typing.Optional[TargetPlan] = OMIT, + description: typing.Optional[str] = OMIT, + assistant_ids: typing.Optional[typing.Sequence[str]] = OMIT, + workflow_ids: typing.Optional[typing.Sequence[str]] = OMIT, + schema: typing.Optional[JsonSchema] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[TestSuite]: + ) -> AsyncHttpResponse[StructuredOutput]: """ Parameters ---------- id : str + schema_override : str + + model : typing.Optional[UpdateStructuredOutputDtoModel] + This is the model that will be used to extract the structured output. + + To provide your own custom system and user prompts for structured output extraction, populate the messages array with your system and user messages. You can specify liquid templating in your system and user messages. + Between the system or user messages, you must reference either 'transcript' or 'messages' with the '{{}}' syntax to access the conversation history. + Between the system or user messages, you must reference a variation of the structured output with the '{{}}' syntax to access the structured output definition. + i.e.: + {{structuredOutput}} + {{structuredOutput.name}} + {{structuredOutput.description}} + {{structuredOutput.schema}} + + If model is not specified, GPT-4.1 will be used by default for extraction, utilizing default system and user prompts. + If messages or required fields are not specified, the default system and user prompts will be used. + name : typing.Optional[str] - This is the name of the test suite. + This is the name of the structured output. + + description : typing.Optional[str] + This is the description of what the structured output extracts. + + Use this to provide context about what data will be extracted and how it will be used. - phone_number_id : typing.Optional[str] - This is the phone number ID associated with this test suite. + assistant_ids : typing.Optional[typing.Sequence[str]] + These are the assistant IDs that this structured output is linked to. - tester_plan : typing.Optional[TesterPlan] - Override the default tester plan by providing custom assistant configuration for the test agent. + When linked to assistants, this structured output will be available for extraction during those assistant's calls. - We recommend only using this if you are confident, as we have already set sensible defaults on the tester plan. + workflow_ids : typing.Optional[typing.Sequence[str]] + These are the workflow IDs that this structured output is linked to. - target_plan : typing.Optional[TargetPlan] - These are the configuration for the assistant / phone number that is being tested. + When linked to workflows, this structured output will be available for extraction during those workflow's execution. + + schema : typing.Optional[JsonSchema] + This is the JSON Schema definition for the structured output. + + Defines the structure and validation rules for the data that will be extracted. Supports all JSON Schema features including: + - Objects and nested properties + - Arrays and array validation + - String, number, boolean, and null types + - Enums and const values + - Validation constraints (min/max, patterns, etc.) + - Composition with allOf, anyOf, oneOf request_options : typing.Optional[RequestOptions] Request-specific configuration. Returns ------- - AsyncHttpResponse[TestSuite] + AsyncHttpResponse[StructuredOutput] """ _response = await self._client_wrapper.httpx_client.request( - f"test-suite/{jsonable_encoder(id)}", + f"structured-output/{jsonable_encoder(id)}", method="PATCH", + params={ + "schemaOverride": schema_override, + }, json={ - "name": name, - "phoneNumberId": phone_number_id, - "testerPlan": convert_and_respect_annotation_metadata( - object_=tester_plan, annotation=TesterPlan, direction="write" + "model": convert_and_respect_annotation_metadata( + object_=model, annotation=UpdateStructuredOutputDtoModel, direction="write" ), - "targetPlan": convert_and_respect_annotation_metadata( - object_=target_plan, annotation=TargetPlan, direction="write" + "name": name, + "description": description, + "assistantIds": assistant_ids, + "workflowIds": workflow_ids, + "schema": convert_and_respect_annotation_metadata( + object_=schema, annotation=JsonSchema, direction="write" ), }, headers={ @@ -629,9 +798,9 @@ async def test_suite_controller_update( try: if 200 <= _response.status_code < 300: _data = typing.cast( - TestSuite, + StructuredOutput, construct_type( - type_=TestSuite, # type: ignore + type_=StructuredOutput, # type: ignore object_=_response.json(), ), ) diff --git a/src/vapi/structured_outputs/types/__init__.py b/src/vapi/structured_outputs/types/__init__.py new file mode 100644 index 0000000..4e3c31e --- /dev/null +++ b/src/vapi/structured_outputs/types/__init__.py @@ -0,0 +1,44 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .create_structured_output_dto_model import CreateStructuredOutputDtoModel + from .structured_output_controller_find_all_request_sort_order import ( + StructuredOutputControllerFindAllRequestSortOrder, + ) + from .update_structured_output_dto_model import UpdateStructuredOutputDtoModel +_dynamic_imports: typing.Dict[str, str] = { + "CreateStructuredOutputDtoModel": ".create_structured_output_dto_model", + "StructuredOutputControllerFindAllRequestSortOrder": ".structured_output_controller_find_all_request_sort_order", + "UpdateStructuredOutputDtoModel": ".update_structured_output_dto_model", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = [ + "CreateStructuredOutputDtoModel", + "StructuredOutputControllerFindAllRequestSortOrder", + "UpdateStructuredOutputDtoModel", +] diff --git a/src/vapi/structured_outputs/types/create_structured_output_dto_model.py b/src/vapi/structured_outputs/types/create_structured_output_dto_model.py new file mode 100644 index 0000000..021acfa --- /dev/null +++ b/src/vapi/structured_outputs/types/create_structured_output_dto_model.py @@ -0,0 +1,12 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from ...types.workflow_anthropic_model import WorkflowAnthropicModel +from ...types.workflow_custom_model import WorkflowCustomModel +from ...types.workflow_google_model import WorkflowGoogleModel +from ...types.workflow_open_ai_model import WorkflowOpenAiModel + +CreateStructuredOutputDtoModel = typing.Union[ + WorkflowOpenAiModel, WorkflowAnthropicModel, WorkflowGoogleModel, WorkflowCustomModel +] diff --git a/src/vapi/structured_outputs/types/structured_output_controller_find_all_request_sort_order.py b/src/vapi/structured_outputs/types/structured_output_controller_find_all_request_sort_order.py new file mode 100644 index 0000000..b714b17 --- /dev/null +++ b/src/vapi/structured_outputs/types/structured_output_controller_find_all_request_sort_order.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +StructuredOutputControllerFindAllRequestSortOrder = typing.Union[typing.Literal["ASC", "DESC"], typing.Any] diff --git a/src/vapi/structured_outputs/types/update_structured_output_dto_model.py b/src/vapi/structured_outputs/types/update_structured_output_dto_model.py new file mode 100644 index 0000000..56d5621 --- /dev/null +++ b/src/vapi/structured_outputs/types/update_structured_output_dto_model.py @@ -0,0 +1,12 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from ...types.workflow_anthropic_model import WorkflowAnthropicModel +from ...types.workflow_custom_model import WorkflowCustomModel +from ...types.workflow_google_model import WorkflowGoogleModel +from ...types.workflow_open_ai_model import WorkflowOpenAiModel + +UpdateStructuredOutputDtoModel = typing.Union[ + WorkflowOpenAiModel, WorkflowAnthropicModel, WorkflowGoogleModel, WorkflowCustomModel +] diff --git a/src/vapi/test_suite_runs/__init__.py b/src/vapi/test_suite_runs/__init__.py deleted file mode 100644 index 248fa83..0000000 --- a/src/vapi/test_suite_runs/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - -from .types import TestSuiteRunControllerFindAllPaginatedRequestSortOrder - -__all__ = ["TestSuiteRunControllerFindAllPaginatedRequestSortOrder"] diff --git a/src/vapi/test_suite_runs/raw_client.py b/src/vapi/test_suite_runs/raw_client.py deleted file mode 100644 index 2333627..0000000 --- a/src/vapi/test_suite_runs/raw_client.py +++ /dev/null @@ -1,581 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing -from json.decoder import JSONDecodeError - -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.datetime_utils import serialize_datetime -from ..core.http_response import AsyncHttpResponse, HttpResponse -from ..core.jsonable_encoder import jsonable_encoder -from ..core.request_options import RequestOptions -from ..core.unchecked_base_model import construct_type -from ..types.test_suite_run import TestSuiteRun -from ..types.test_suite_runs_paginated_response import TestSuiteRunsPaginatedResponse -from .types.test_suite_run_controller_find_all_paginated_request_sort_order import ( - TestSuiteRunControllerFindAllPaginatedRequestSortOrder, -) - -# this is used as the default value for optional parameters -OMIT = typing.cast(typing.Any, ...) - - -class RawTestSuiteRunsClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._client_wrapper = client_wrapper - - def test_suite_run_controller_find_all_paginated( - self, - test_suite_id: str, - *, - page: typing.Optional[float] = None, - sort_order: typing.Optional[TestSuiteRunControllerFindAllPaginatedRequestSortOrder] = None, - limit: typing.Optional[float] = None, - created_at_gt: typing.Optional[dt.datetime] = None, - created_at_lt: typing.Optional[dt.datetime] = None, - created_at_ge: typing.Optional[dt.datetime] = None, - created_at_le: typing.Optional[dt.datetime] = None, - updated_at_gt: typing.Optional[dt.datetime] = None, - updated_at_lt: typing.Optional[dt.datetime] = None, - updated_at_ge: typing.Optional[dt.datetime] = None, - updated_at_le: typing.Optional[dt.datetime] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[TestSuiteRunsPaginatedResponse]: - """ - Parameters - ---------- - test_suite_id : str - - page : typing.Optional[float] - This is the page number to return. Defaults to 1. - - sort_order : typing.Optional[TestSuiteRunControllerFindAllPaginatedRequestSortOrder] - This is the sort order for pagination. Defaults to 'DESC'. - - limit : typing.Optional[float] - This is the maximum number of items to return. Defaults to 100. - - created_at_gt : typing.Optional[dt.datetime] - This will return items where the createdAt is greater than the specified value. - - created_at_lt : typing.Optional[dt.datetime] - This will return items where the createdAt is less than the specified value. - - created_at_ge : typing.Optional[dt.datetime] - This will return items where the createdAt is greater than or equal to the specified value. - - created_at_le : typing.Optional[dt.datetime] - This will return items where the createdAt is less than or equal to the specified value. - - updated_at_gt : typing.Optional[dt.datetime] - This will return items where the updatedAt is greater than the specified value. - - updated_at_lt : typing.Optional[dt.datetime] - This will return items where the updatedAt is less than the specified value. - - updated_at_ge : typing.Optional[dt.datetime] - This will return items where the updatedAt is greater than or equal to the specified value. - - updated_at_le : typing.Optional[dt.datetime] - This will return items where the updatedAt is less than or equal to the specified value. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[TestSuiteRunsPaginatedResponse] - - """ - _response = self._client_wrapper.httpx_client.request( - f"test-suite/{jsonable_encoder(test_suite_id)}/run", - method="GET", - params={ - "page": page, - "sortOrder": sort_order, - "limit": limit, - "createdAtGt": serialize_datetime(created_at_gt) if created_at_gt is not None else None, - "createdAtLt": serialize_datetime(created_at_lt) if created_at_lt is not None else None, - "createdAtGe": serialize_datetime(created_at_ge) if created_at_ge is not None else None, - "createdAtLe": serialize_datetime(created_at_le) if created_at_le is not None else None, - "updatedAtGt": serialize_datetime(updated_at_gt) if updated_at_gt is not None else None, - "updatedAtLt": serialize_datetime(updated_at_lt) if updated_at_lt is not None else None, - "updatedAtGe": serialize_datetime(updated_at_ge) if updated_at_ge is not None else None, - "updatedAtLe": serialize_datetime(updated_at_le) if updated_at_le is not None else None, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - TestSuiteRunsPaginatedResponse, - construct_type( - type_=TestSuiteRunsPaginatedResponse, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def test_suite_run_controller_create( - self, - test_suite_id: str, - *, - name: typing.Optional[str] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[TestSuiteRun]: - """ - Parameters - ---------- - test_suite_id : str - - name : typing.Optional[str] - This is the name of the test suite run. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[TestSuiteRun] - - """ - _response = self._client_wrapper.httpx_client.request( - f"test-suite/{jsonable_encoder(test_suite_id)}/run", - method="POST", - json={ - "name": name, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - TestSuiteRun, - construct_type( - type_=TestSuiteRun, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def test_suite_run_controller_find_one( - self, test_suite_id: str, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> HttpResponse[TestSuiteRun]: - """ - Parameters - ---------- - test_suite_id : str - - id : str - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[TestSuiteRun] - - """ - _response = self._client_wrapper.httpx_client.request( - f"test-suite/{jsonable_encoder(test_suite_id)}/run/{jsonable_encoder(id)}", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - TestSuiteRun, - construct_type( - type_=TestSuiteRun, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def test_suite_run_controller_remove( - self, test_suite_id: str, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> HttpResponse[TestSuiteRun]: - """ - Parameters - ---------- - test_suite_id : str - - id : str - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[TestSuiteRun] - - """ - _response = self._client_wrapper.httpx_client.request( - f"test-suite/{jsonable_encoder(test_suite_id)}/run/{jsonable_encoder(id)}", - method="DELETE", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - TestSuiteRun, - construct_type( - type_=TestSuiteRun, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def test_suite_run_controller_update( - self, - test_suite_id: str, - id: str, - *, - name: typing.Optional[str] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[TestSuiteRun]: - """ - Parameters - ---------- - test_suite_id : str - - id : str - - name : typing.Optional[str] - This is the name of the test suite run. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[TestSuiteRun] - - """ - _response = self._client_wrapper.httpx_client.request( - f"test-suite/{jsonable_encoder(test_suite_id)}/run/{jsonable_encoder(id)}", - method="PATCH", - json={ - "name": name, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - TestSuiteRun, - construct_type( - type_=TestSuiteRun, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - -class AsyncRawTestSuiteRunsClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._client_wrapper = client_wrapper - - async def test_suite_run_controller_find_all_paginated( - self, - test_suite_id: str, - *, - page: typing.Optional[float] = None, - sort_order: typing.Optional[TestSuiteRunControllerFindAllPaginatedRequestSortOrder] = None, - limit: typing.Optional[float] = None, - created_at_gt: typing.Optional[dt.datetime] = None, - created_at_lt: typing.Optional[dt.datetime] = None, - created_at_ge: typing.Optional[dt.datetime] = None, - created_at_le: typing.Optional[dt.datetime] = None, - updated_at_gt: typing.Optional[dt.datetime] = None, - updated_at_lt: typing.Optional[dt.datetime] = None, - updated_at_ge: typing.Optional[dt.datetime] = None, - updated_at_le: typing.Optional[dt.datetime] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[TestSuiteRunsPaginatedResponse]: - """ - Parameters - ---------- - test_suite_id : str - - page : typing.Optional[float] - This is the page number to return. Defaults to 1. - - sort_order : typing.Optional[TestSuiteRunControllerFindAllPaginatedRequestSortOrder] - This is the sort order for pagination. Defaults to 'DESC'. - - limit : typing.Optional[float] - This is the maximum number of items to return. Defaults to 100. - - created_at_gt : typing.Optional[dt.datetime] - This will return items where the createdAt is greater than the specified value. - - created_at_lt : typing.Optional[dt.datetime] - This will return items where the createdAt is less than the specified value. - - created_at_ge : typing.Optional[dt.datetime] - This will return items where the createdAt is greater than or equal to the specified value. - - created_at_le : typing.Optional[dt.datetime] - This will return items where the createdAt is less than or equal to the specified value. - - updated_at_gt : typing.Optional[dt.datetime] - This will return items where the updatedAt is greater than the specified value. - - updated_at_lt : typing.Optional[dt.datetime] - This will return items where the updatedAt is less than the specified value. - - updated_at_ge : typing.Optional[dt.datetime] - This will return items where the updatedAt is greater than or equal to the specified value. - - updated_at_le : typing.Optional[dt.datetime] - This will return items where the updatedAt is less than or equal to the specified value. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[TestSuiteRunsPaginatedResponse] - - """ - _response = await self._client_wrapper.httpx_client.request( - f"test-suite/{jsonable_encoder(test_suite_id)}/run", - method="GET", - params={ - "page": page, - "sortOrder": sort_order, - "limit": limit, - "createdAtGt": serialize_datetime(created_at_gt) if created_at_gt is not None else None, - "createdAtLt": serialize_datetime(created_at_lt) if created_at_lt is not None else None, - "createdAtGe": serialize_datetime(created_at_ge) if created_at_ge is not None else None, - "createdAtLe": serialize_datetime(created_at_le) if created_at_le is not None else None, - "updatedAtGt": serialize_datetime(updated_at_gt) if updated_at_gt is not None else None, - "updatedAtLt": serialize_datetime(updated_at_lt) if updated_at_lt is not None else None, - "updatedAtGe": serialize_datetime(updated_at_ge) if updated_at_ge is not None else None, - "updatedAtLe": serialize_datetime(updated_at_le) if updated_at_le is not None else None, - }, - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - TestSuiteRunsPaginatedResponse, - construct_type( - type_=TestSuiteRunsPaginatedResponse, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def test_suite_run_controller_create( - self, - test_suite_id: str, - *, - name: typing.Optional[str] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[TestSuiteRun]: - """ - Parameters - ---------- - test_suite_id : str - - name : typing.Optional[str] - This is the name of the test suite run. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[TestSuiteRun] - - """ - _response = await self._client_wrapper.httpx_client.request( - f"test-suite/{jsonable_encoder(test_suite_id)}/run", - method="POST", - json={ - "name": name, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - TestSuiteRun, - construct_type( - type_=TestSuiteRun, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def test_suite_run_controller_find_one( - self, test_suite_id: str, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncHttpResponse[TestSuiteRun]: - """ - Parameters - ---------- - test_suite_id : str - - id : str - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[TestSuiteRun] - - """ - _response = await self._client_wrapper.httpx_client.request( - f"test-suite/{jsonable_encoder(test_suite_id)}/run/{jsonable_encoder(id)}", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - TestSuiteRun, - construct_type( - type_=TestSuiteRun, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def test_suite_run_controller_remove( - self, test_suite_id: str, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncHttpResponse[TestSuiteRun]: - """ - Parameters - ---------- - test_suite_id : str - - id : str - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[TestSuiteRun] - - """ - _response = await self._client_wrapper.httpx_client.request( - f"test-suite/{jsonable_encoder(test_suite_id)}/run/{jsonable_encoder(id)}", - method="DELETE", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - TestSuiteRun, - construct_type( - type_=TestSuiteRun, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def test_suite_run_controller_update( - self, - test_suite_id: str, - id: str, - *, - name: typing.Optional[str] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[TestSuiteRun]: - """ - Parameters - ---------- - test_suite_id : str - - id : str - - name : typing.Optional[str] - This is the name of the test suite run. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[TestSuiteRun] - - """ - _response = await self._client_wrapper.httpx_client.request( - f"test-suite/{jsonable_encoder(test_suite_id)}/run/{jsonable_encoder(id)}", - method="PATCH", - json={ - "name": name, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - TestSuiteRun, - construct_type( - type_=TestSuiteRun, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) diff --git a/src/vapi/test_suite_runs/types/__init__.py b/src/vapi/test_suite_runs/types/__init__.py deleted file mode 100644 index 348fa20..0000000 --- a/src/vapi/test_suite_runs/types/__init__.py +++ /dev/null @@ -1,9 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - -from .test_suite_run_controller_find_all_paginated_request_sort_order import ( - TestSuiteRunControllerFindAllPaginatedRequestSortOrder, -) - -__all__ = ["TestSuiteRunControllerFindAllPaginatedRequestSortOrder"] diff --git a/src/vapi/test_suite_runs/types/test_suite_run_controller_find_all_paginated_request_sort_order.py b/src/vapi/test_suite_runs/types/test_suite_run_controller_find_all_paginated_request_sort_order.py deleted file mode 100644 index 54d4321..0000000 --- a/src/vapi/test_suite_runs/types/test_suite_run_controller_find_all_paginated_request_sort_order.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -TestSuiteRunControllerFindAllPaginatedRequestSortOrder = typing.Union[typing.Literal["ASC", "DESC"], typing.Any] diff --git a/src/vapi/test_suite_tests/__init__.py b/src/vapi/test_suite_tests/__init__.py deleted file mode 100644 index 939075f..0000000 --- a/src/vapi/test_suite_tests/__init__.py +++ /dev/null @@ -1,23 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - -from .types import ( - TestSuiteTestControllerCreateRequest, - TestSuiteTestControllerCreateResponse, - TestSuiteTestControllerFindAllPaginatedRequestSortOrder, - TestSuiteTestControllerFindOneResponse, - TestSuiteTestControllerRemoveResponse, - TestSuiteTestControllerUpdateRequest, - TestSuiteTestControllerUpdateResponse, -) - -__all__ = [ - "TestSuiteTestControllerCreateRequest", - "TestSuiteTestControllerCreateResponse", - "TestSuiteTestControllerFindAllPaginatedRequestSortOrder", - "TestSuiteTestControllerFindOneResponse", - "TestSuiteTestControllerRemoveResponse", - "TestSuiteTestControllerUpdateRequest", - "TestSuiteTestControllerUpdateResponse", -] diff --git a/src/vapi/test_suite_tests/client.py b/src/vapi/test_suite_tests/client.py deleted file mode 100644 index 36b8521..0000000 --- a/src/vapi/test_suite_tests/client.py +++ /dev/null @@ -1,593 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.request_options import RequestOptions -from ..types.test_suite_tests_paginated_response import TestSuiteTestsPaginatedResponse -from .raw_client import AsyncRawTestSuiteTestsClient, RawTestSuiteTestsClient -from .types.test_suite_test_controller_create_request import TestSuiteTestControllerCreateRequest -from .types.test_suite_test_controller_create_response import TestSuiteTestControllerCreateResponse -from .types.test_suite_test_controller_find_all_paginated_request_sort_order import ( - TestSuiteTestControllerFindAllPaginatedRequestSortOrder, -) -from .types.test_suite_test_controller_find_one_response import TestSuiteTestControllerFindOneResponse -from .types.test_suite_test_controller_remove_response import TestSuiteTestControllerRemoveResponse -from .types.test_suite_test_controller_update_request import TestSuiteTestControllerUpdateRequest -from .types.test_suite_test_controller_update_response import TestSuiteTestControllerUpdateResponse - -# this is used as the default value for optional parameters -OMIT = typing.cast(typing.Any, ...) - - -class TestSuiteTestsClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._raw_client = RawTestSuiteTestsClient(client_wrapper=client_wrapper) - - @property - def with_raw_response(self) -> RawTestSuiteTestsClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - RawTestSuiteTestsClient - """ - return self._raw_client - - def test_suite_test_controller_find_all_paginated( - self, - test_suite_id: str, - *, - page: typing.Optional[float] = None, - sort_order: typing.Optional[TestSuiteTestControllerFindAllPaginatedRequestSortOrder] = None, - limit: typing.Optional[float] = None, - created_at_gt: typing.Optional[dt.datetime] = None, - created_at_lt: typing.Optional[dt.datetime] = None, - created_at_ge: typing.Optional[dt.datetime] = None, - created_at_le: typing.Optional[dt.datetime] = None, - updated_at_gt: typing.Optional[dt.datetime] = None, - updated_at_lt: typing.Optional[dt.datetime] = None, - updated_at_ge: typing.Optional[dt.datetime] = None, - updated_at_le: typing.Optional[dt.datetime] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> TestSuiteTestsPaginatedResponse: - """ - Parameters - ---------- - test_suite_id : str - - page : typing.Optional[float] - This is the page number to return. Defaults to 1. - - sort_order : typing.Optional[TestSuiteTestControllerFindAllPaginatedRequestSortOrder] - This is the sort order for pagination. Defaults to 'DESC'. - - limit : typing.Optional[float] - This is the maximum number of items to return. Defaults to 100. - - created_at_gt : typing.Optional[dt.datetime] - This will return items where the createdAt is greater than the specified value. - - created_at_lt : typing.Optional[dt.datetime] - This will return items where the createdAt is less than the specified value. - - created_at_ge : typing.Optional[dt.datetime] - This will return items where the createdAt is greater than or equal to the specified value. - - created_at_le : typing.Optional[dt.datetime] - This will return items where the createdAt is less than or equal to the specified value. - - updated_at_gt : typing.Optional[dt.datetime] - This will return items where the updatedAt is greater than the specified value. - - updated_at_lt : typing.Optional[dt.datetime] - This will return items where the updatedAt is less than the specified value. - - updated_at_ge : typing.Optional[dt.datetime] - This will return items where the updatedAt is greater than or equal to the specified value. - - updated_at_le : typing.Optional[dt.datetime] - This will return items where the updatedAt is less than or equal to the specified value. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - TestSuiteTestsPaginatedResponse - - - Examples - -------- - from vapi import Vapi - - client = Vapi( - token="YOUR_TOKEN", - ) - client.test_suite_tests.test_suite_test_controller_find_all_paginated( - test_suite_id="testSuiteId", - ) - """ - _response = self._raw_client.test_suite_test_controller_find_all_paginated( - test_suite_id, - page=page, - sort_order=sort_order, - limit=limit, - created_at_gt=created_at_gt, - created_at_lt=created_at_lt, - created_at_ge=created_at_ge, - created_at_le=created_at_le, - updated_at_gt=updated_at_gt, - updated_at_lt=updated_at_lt, - updated_at_ge=updated_at_ge, - updated_at_le=updated_at_le, - request_options=request_options, - ) - return _response.data - - def test_suite_test_controller_create( - self, - test_suite_id: str, - *, - request: TestSuiteTestControllerCreateRequest, - request_options: typing.Optional[RequestOptions] = None, - ) -> TestSuiteTestControllerCreateResponse: - """ - Parameters - ---------- - test_suite_id : str - - request : TestSuiteTestControllerCreateRequest - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - TestSuiteTestControllerCreateResponse - - - Examples - -------- - from vapi import CreateTestSuiteTestVoiceDto, TestSuiteTestScorerAi, Vapi - - client = Vapi( - token="YOUR_TOKEN", - ) - client.test_suite_tests.test_suite_test_controller_create( - test_suite_id="testSuiteId", - request=CreateTestSuiteTestVoiceDto( - scorers=[ - TestSuiteTestScorerAi( - rubric="rubric", - ) - ], - script="script", - ), - ) - """ - _response = self._raw_client.test_suite_test_controller_create( - test_suite_id, request=request, request_options=request_options - ) - return _response.data - - def test_suite_test_controller_find_one( - self, test_suite_id: str, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> TestSuiteTestControllerFindOneResponse: - """ - Parameters - ---------- - test_suite_id : str - - id : str - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - TestSuiteTestControllerFindOneResponse - - - Examples - -------- - from vapi import Vapi - - client = Vapi( - token="YOUR_TOKEN", - ) - client.test_suite_tests.test_suite_test_controller_find_one( - test_suite_id="testSuiteId", - id="id", - ) - """ - _response = self._raw_client.test_suite_test_controller_find_one( - test_suite_id, id, request_options=request_options - ) - return _response.data - - def test_suite_test_controller_remove( - self, test_suite_id: str, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> TestSuiteTestControllerRemoveResponse: - """ - Parameters - ---------- - test_suite_id : str - - id : str - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - TestSuiteTestControllerRemoveResponse - - - Examples - -------- - from vapi import Vapi - - client = Vapi( - token="YOUR_TOKEN", - ) - client.test_suite_tests.test_suite_test_controller_remove( - test_suite_id="testSuiteId", - id="id", - ) - """ - _response = self._raw_client.test_suite_test_controller_remove( - test_suite_id, id, request_options=request_options - ) - return _response.data - - def test_suite_test_controller_update( - self, - test_suite_id: str, - id: str, - *, - request: TestSuiteTestControllerUpdateRequest, - request_options: typing.Optional[RequestOptions] = None, - ) -> TestSuiteTestControllerUpdateResponse: - """ - Parameters - ---------- - test_suite_id : str - - id : str - - request : TestSuiteTestControllerUpdateRequest - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - TestSuiteTestControllerUpdateResponse - - - Examples - -------- - from vapi import UpdateTestSuiteTestVoiceDto, Vapi - - client = Vapi( - token="YOUR_TOKEN", - ) - client.test_suite_tests.test_suite_test_controller_update( - test_suite_id="testSuiteId", - id="id", - request=UpdateTestSuiteTestVoiceDto(), - ) - """ - _response = self._raw_client.test_suite_test_controller_update( - test_suite_id, id, request=request, request_options=request_options - ) - return _response.data - - -class AsyncTestSuiteTestsClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._raw_client = AsyncRawTestSuiteTestsClient(client_wrapper=client_wrapper) - - @property - def with_raw_response(self) -> AsyncRawTestSuiteTestsClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - AsyncRawTestSuiteTestsClient - """ - return self._raw_client - - async def test_suite_test_controller_find_all_paginated( - self, - test_suite_id: str, - *, - page: typing.Optional[float] = None, - sort_order: typing.Optional[TestSuiteTestControllerFindAllPaginatedRequestSortOrder] = None, - limit: typing.Optional[float] = None, - created_at_gt: typing.Optional[dt.datetime] = None, - created_at_lt: typing.Optional[dt.datetime] = None, - created_at_ge: typing.Optional[dt.datetime] = None, - created_at_le: typing.Optional[dt.datetime] = None, - updated_at_gt: typing.Optional[dt.datetime] = None, - updated_at_lt: typing.Optional[dt.datetime] = None, - updated_at_ge: typing.Optional[dt.datetime] = None, - updated_at_le: typing.Optional[dt.datetime] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> TestSuiteTestsPaginatedResponse: - """ - Parameters - ---------- - test_suite_id : str - - page : typing.Optional[float] - This is the page number to return. Defaults to 1. - - sort_order : typing.Optional[TestSuiteTestControllerFindAllPaginatedRequestSortOrder] - This is the sort order for pagination. Defaults to 'DESC'. - - limit : typing.Optional[float] - This is the maximum number of items to return. Defaults to 100. - - created_at_gt : typing.Optional[dt.datetime] - This will return items where the createdAt is greater than the specified value. - - created_at_lt : typing.Optional[dt.datetime] - This will return items where the createdAt is less than the specified value. - - created_at_ge : typing.Optional[dt.datetime] - This will return items where the createdAt is greater than or equal to the specified value. - - created_at_le : typing.Optional[dt.datetime] - This will return items where the createdAt is less than or equal to the specified value. - - updated_at_gt : typing.Optional[dt.datetime] - This will return items where the updatedAt is greater than the specified value. - - updated_at_lt : typing.Optional[dt.datetime] - This will return items where the updatedAt is less than the specified value. - - updated_at_ge : typing.Optional[dt.datetime] - This will return items where the updatedAt is greater than or equal to the specified value. - - updated_at_le : typing.Optional[dt.datetime] - This will return items where the updatedAt is less than or equal to the specified value. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - TestSuiteTestsPaginatedResponse - - - Examples - -------- - import asyncio - - from vapi import AsyncVapi - - client = AsyncVapi( - token="YOUR_TOKEN", - ) - - - async def main() -> None: - await client.test_suite_tests.test_suite_test_controller_find_all_paginated( - test_suite_id="testSuiteId", - ) - - - asyncio.run(main()) - """ - _response = await self._raw_client.test_suite_test_controller_find_all_paginated( - test_suite_id, - page=page, - sort_order=sort_order, - limit=limit, - created_at_gt=created_at_gt, - created_at_lt=created_at_lt, - created_at_ge=created_at_ge, - created_at_le=created_at_le, - updated_at_gt=updated_at_gt, - updated_at_lt=updated_at_lt, - updated_at_ge=updated_at_ge, - updated_at_le=updated_at_le, - request_options=request_options, - ) - return _response.data - - async def test_suite_test_controller_create( - self, - test_suite_id: str, - *, - request: TestSuiteTestControllerCreateRequest, - request_options: typing.Optional[RequestOptions] = None, - ) -> TestSuiteTestControllerCreateResponse: - """ - Parameters - ---------- - test_suite_id : str - - request : TestSuiteTestControllerCreateRequest - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - TestSuiteTestControllerCreateResponse - - - Examples - -------- - import asyncio - - from vapi import AsyncVapi, CreateTestSuiteTestVoiceDto, TestSuiteTestScorerAi - - client = AsyncVapi( - token="YOUR_TOKEN", - ) - - - async def main() -> None: - await client.test_suite_tests.test_suite_test_controller_create( - test_suite_id="testSuiteId", - request=CreateTestSuiteTestVoiceDto( - scorers=[ - TestSuiteTestScorerAi( - rubric="rubric", - ) - ], - script="script", - ), - ) - - - asyncio.run(main()) - """ - _response = await self._raw_client.test_suite_test_controller_create( - test_suite_id, request=request, request_options=request_options - ) - return _response.data - - async def test_suite_test_controller_find_one( - self, test_suite_id: str, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> TestSuiteTestControllerFindOneResponse: - """ - Parameters - ---------- - test_suite_id : str - - id : str - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - TestSuiteTestControllerFindOneResponse - - - Examples - -------- - import asyncio - - from vapi import AsyncVapi - - client = AsyncVapi( - token="YOUR_TOKEN", - ) - - - async def main() -> None: - await client.test_suite_tests.test_suite_test_controller_find_one( - test_suite_id="testSuiteId", - id="id", - ) - - - asyncio.run(main()) - """ - _response = await self._raw_client.test_suite_test_controller_find_one( - test_suite_id, id, request_options=request_options - ) - return _response.data - - async def test_suite_test_controller_remove( - self, test_suite_id: str, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> TestSuiteTestControllerRemoveResponse: - """ - Parameters - ---------- - test_suite_id : str - - id : str - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - TestSuiteTestControllerRemoveResponse - - - Examples - -------- - import asyncio - - from vapi import AsyncVapi - - client = AsyncVapi( - token="YOUR_TOKEN", - ) - - - async def main() -> None: - await client.test_suite_tests.test_suite_test_controller_remove( - test_suite_id="testSuiteId", - id="id", - ) - - - asyncio.run(main()) - """ - _response = await self._raw_client.test_suite_test_controller_remove( - test_suite_id, id, request_options=request_options - ) - return _response.data - - async def test_suite_test_controller_update( - self, - test_suite_id: str, - id: str, - *, - request: TestSuiteTestControllerUpdateRequest, - request_options: typing.Optional[RequestOptions] = None, - ) -> TestSuiteTestControllerUpdateResponse: - """ - Parameters - ---------- - test_suite_id : str - - id : str - - request : TestSuiteTestControllerUpdateRequest - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - TestSuiteTestControllerUpdateResponse - - - Examples - -------- - import asyncio - - from vapi import AsyncVapi, UpdateTestSuiteTestVoiceDto - - client = AsyncVapi( - token="YOUR_TOKEN", - ) - - - async def main() -> None: - await client.test_suite_tests.test_suite_test_controller_update( - test_suite_id="testSuiteId", - id="id", - request=UpdateTestSuiteTestVoiceDto(), - ) - - - asyncio.run(main()) - """ - _response = await self._raw_client.test_suite_test_controller_update( - test_suite_id, id, request=request, request_options=request_options - ) - return _response.data diff --git a/src/vapi/test_suite_tests/types/__init__.py b/src/vapi/test_suite_tests/types/__init__.py deleted file mode 100644 index 0ba704a..0000000 --- a/src/vapi/test_suite_tests/types/__init__.py +++ /dev/null @@ -1,23 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - -from .test_suite_test_controller_create_request import TestSuiteTestControllerCreateRequest -from .test_suite_test_controller_create_response import TestSuiteTestControllerCreateResponse -from .test_suite_test_controller_find_all_paginated_request_sort_order import ( - TestSuiteTestControllerFindAllPaginatedRequestSortOrder, -) -from .test_suite_test_controller_find_one_response import TestSuiteTestControllerFindOneResponse -from .test_suite_test_controller_remove_response import TestSuiteTestControllerRemoveResponse -from .test_suite_test_controller_update_request import TestSuiteTestControllerUpdateRequest -from .test_suite_test_controller_update_response import TestSuiteTestControllerUpdateResponse - -__all__ = [ - "TestSuiteTestControllerCreateRequest", - "TestSuiteTestControllerCreateResponse", - "TestSuiteTestControllerFindAllPaginatedRequestSortOrder", - "TestSuiteTestControllerFindOneResponse", - "TestSuiteTestControllerRemoveResponse", - "TestSuiteTestControllerUpdateRequest", - "TestSuiteTestControllerUpdateResponse", -] diff --git a/src/vapi/test_suite_tests/types/test_suite_test_controller_create_request.py b/src/vapi/test_suite_tests/types/test_suite_test_controller_create_request.py deleted file mode 100644 index d329f06..0000000 --- a/src/vapi/test_suite_tests/types/test_suite_test_controller_create_request.py +++ /dev/null @@ -1,8 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from ...types.create_test_suite_test_chat_dto import CreateTestSuiteTestChatDto -from ...types.create_test_suite_test_voice_dto import CreateTestSuiteTestVoiceDto - -TestSuiteTestControllerCreateRequest = typing.Union[CreateTestSuiteTestVoiceDto, CreateTestSuiteTestChatDto] diff --git a/src/vapi/test_suite_tests/types/test_suite_test_controller_create_response.py b/src/vapi/test_suite_tests/types/test_suite_test_controller_create_response.py deleted file mode 100644 index 5adcb6d..0000000 --- a/src/vapi/test_suite_tests/types/test_suite_test_controller_create_response.py +++ /dev/null @@ -1,8 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from ...types.test_suite_test_chat import TestSuiteTestChat -from ...types.test_suite_test_voice import TestSuiteTestVoice - -TestSuiteTestControllerCreateResponse = typing.Union[TestSuiteTestVoice, TestSuiteTestChat] diff --git a/src/vapi/test_suite_tests/types/test_suite_test_controller_find_all_paginated_request_sort_order.py b/src/vapi/test_suite_tests/types/test_suite_test_controller_find_all_paginated_request_sort_order.py deleted file mode 100644 index 44336b7..0000000 --- a/src/vapi/test_suite_tests/types/test_suite_test_controller_find_all_paginated_request_sort_order.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -TestSuiteTestControllerFindAllPaginatedRequestSortOrder = typing.Union[typing.Literal["ASC", "DESC"], typing.Any] diff --git a/src/vapi/test_suite_tests/types/test_suite_test_controller_find_one_response.py b/src/vapi/test_suite_tests/types/test_suite_test_controller_find_one_response.py deleted file mode 100644 index 8f50178..0000000 --- a/src/vapi/test_suite_tests/types/test_suite_test_controller_find_one_response.py +++ /dev/null @@ -1,8 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from ...types.test_suite_test_chat import TestSuiteTestChat -from ...types.test_suite_test_voice import TestSuiteTestVoice - -TestSuiteTestControllerFindOneResponse = typing.Union[TestSuiteTestVoice, TestSuiteTestChat] diff --git a/src/vapi/test_suite_tests/types/test_suite_test_controller_remove_response.py b/src/vapi/test_suite_tests/types/test_suite_test_controller_remove_response.py deleted file mode 100644 index e61aa36..0000000 --- a/src/vapi/test_suite_tests/types/test_suite_test_controller_remove_response.py +++ /dev/null @@ -1,8 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from ...types.test_suite_test_chat import TestSuiteTestChat -from ...types.test_suite_test_voice import TestSuiteTestVoice - -TestSuiteTestControllerRemoveResponse = typing.Union[TestSuiteTestVoice, TestSuiteTestChat] diff --git a/src/vapi/test_suite_tests/types/test_suite_test_controller_update_request.py b/src/vapi/test_suite_tests/types/test_suite_test_controller_update_request.py deleted file mode 100644 index 2c4120e..0000000 --- a/src/vapi/test_suite_tests/types/test_suite_test_controller_update_request.py +++ /dev/null @@ -1,8 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from ...types.update_test_suite_test_chat_dto import UpdateTestSuiteTestChatDto -from ...types.update_test_suite_test_voice_dto import UpdateTestSuiteTestVoiceDto - -TestSuiteTestControllerUpdateRequest = typing.Union[UpdateTestSuiteTestVoiceDto, UpdateTestSuiteTestChatDto] diff --git a/src/vapi/test_suite_tests/types/test_suite_test_controller_update_response.py b/src/vapi/test_suite_tests/types/test_suite_test_controller_update_response.py deleted file mode 100644 index 60f6da7..0000000 --- a/src/vapi/test_suite_tests/types/test_suite_test_controller_update_response.py +++ /dev/null @@ -1,8 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from ...types.test_suite_test_chat import TestSuiteTestChat -from ...types.test_suite_test_voice import TestSuiteTestVoice - -TestSuiteTestControllerUpdateResponse = typing.Union[TestSuiteTestVoice, TestSuiteTestChat] diff --git a/src/vapi/test_suites/__init__.py b/src/vapi/test_suites/__init__.py deleted file mode 100644 index d111737..0000000 --- a/src/vapi/test_suites/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - -from .types import TestSuiteControllerFindAllPaginatedRequestSortOrder - -__all__ = ["TestSuiteControllerFindAllPaginatedRequestSortOrder"] diff --git a/src/vapi/test_suites/client.py b/src/vapi/test_suites/client.py deleted file mode 100644 index 6255b01..0000000 --- a/src/vapi/test_suites/client.py +++ /dev/null @@ -1,600 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.request_options import RequestOptions -from ..types.target_plan import TargetPlan -from ..types.test_suite import TestSuite -from ..types.test_suites_paginated_response import TestSuitesPaginatedResponse -from ..types.tester_plan import TesterPlan -from .raw_client import AsyncRawTestSuitesClient, RawTestSuitesClient -from .types.test_suite_controller_find_all_paginated_request_sort_order import ( - TestSuiteControllerFindAllPaginatedRequestSortOrder, -) - -# this is used as the default value for optional parameters -OMIT = typing.cast(typing.Any, ...) - - -class TestSuitesClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._raw_client = RawTestSuitesClient(client_wrapper=client_wrapper) - - @property - def with_raw_response(self) -> RawTestSuitesClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - RawTestSuitesClient - """ - return self._raw_client - - def test_suite_controller_find_all_paginated( - self, - *, - page: typing.Optional[float] = None, - sort_order: typing.Optional[TestSuiteControllerFindAllPaginatedRequestSortOrder] = None, - limit: typing.Optional[float] = None, - created_at_gt: typing.Optional[dt.datetime] = None, - created_at_lt: typing.Optional[dt.datetime] = None, - created_at_ge: typing.Optional[dt.datetime] = None, - created_at_le: typing.Optional[dt.datetime] = None, - updated_at_gt: typing.Optional[dt.datetime] = None, - updated_at_lt: typing.Optional[dt.datetime] = None, - updated_at_ge: typing.Optional[dt.datetime] = None, - updated_at_le: typing.Optional[dt.datetime] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> TestSuitesPaginatedResponse: - """ - Parameters - ---------- - page : typing.Optional[float] - This is the page number to return. Defaults to 1. - - sort_order : typing.Optional[TestSuiteControllerFindAllPaginatedRequestSortOrder] - This is the sort order for pagination. Defaults to 'DESC'. - - limit : typing.Optional[float] - This is the maximum number of items to return. Defaults to 100. - - created_at_gt : typing.Optional[dt.datetime] - This will return items where the createdAt is greater than the specified value. - - created_at_lt : typing.Optional[dt.datetime] - This will return items where the createdAt is less than the specified value. - - created_at_ge : typing.Optional[dt.datetime] - This will return items where the createdAt is greater than or equal to the specified value. - - created_at_le : typing.Optional[dt.datetime] - This will return items where the createdAt is less than or equal to the specified value. - - updated_at_gt : typing.Optional[dt.datetime] - This will return items where the updatedAt is greater than the specified value. - - updated_at_lt : typing.Optional[dt.datetime] - This will return items where the updatedAt is less than the specified value. - - updated_at_ge : typing.Optional[dt.datetime] - This will return items where the updatedAt is greater than or equal to the specified value. - - updated_at_le : typing.Optional[dt.datetime] - This will return items where the updatedAt is less than or equal to the specified value. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - TestSuitesPaginatedResponse - - - Examples - -------- - from vapi import Vapi - - client = Vapi( - token="YOUR_TOKEN", - ) - client.test_suites.test_suite_controller_find_all_paginated() - """ - _response = self._raw_client.test_suite_controller_find_all_paginated( - page=page, - sort_order=sort_order, - limit=limit, - created_at_gt=created_at_gt, - created_at_lt=created_at_lt, - created_at_ge=created_at_ge, - created_at_le=created_at_le, - updated_at_gt=updated_at_gt, - updated_at_lt=updated_at_lt, - updated_at_ge=updated_at_ge, - updated_at_le=updated_at_le, - request_options=request_options, - ) - return _response.data - - def test_suite_controller_create( - self, - *, - name: typing.Optional[str] = OMIT, - phone_number_id: typing.Optional[str] = OMIT, - tester_plan: typing.Optional[TesterPlan] = OMIT, - target_plan: typing.Optional[TargetPlan] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> TestSuite: - """ - Parameters - ---------- - name : typing.Optional[str] - This is the name of the test suite. - - phone_number_id : typing.Optional[str] - This is the phone number ID associated with this test suite. - - tester_plan : typing.Optional[TesterPlan] - Override the default tester plan by providing custom assistant configuration for the test agent. - - We recommend only using this if you are confident, as we have already set sensible defaults on the tester plan. - - target_plan : typing.Optional[TargetPlan] - These are the configuration for the assistant / phone number that is being tested. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - TestSuite - - - Examples - -------- - from vapi import Vapi - - client = Vapi( - token="YOUR_TOKEN", - ) - client.test_suites.test_suite_controller_create() - """ - _response = self._raw_client.test_suite_controller_create( - name=name, - phone_number_id=phone_number_id, - tester_plan=tester_plan, - target_plan=target_plan, - request_options=request_options, - ) - return _response.data - - def test_suite_controller_find_one( - self, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> TestSuite: - """ - Parameters - ---------- - id : str - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - TestSuite - - - Examples - -------- - from vapi import Vapi - - client = Vapi( - token="YOUR_TOKEN", - ) - client.test_suites.test_suite_controller_find_one( - id="id", - ) - """ - _response = self._raw_client.test_suite_controller_find_one(id, request_options=request_options) - return _response.data - - def test_suite_controller_remove( - self, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> TestSuite: - """ - Parameters - ---------- - id : str - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - TestSuite - - - Examples - -------- - from vapi import Vapi - - client = Vapi( - token="YOUR_TOKEN", - ) - client.test_suites.test_suite_controller_remove( - id="id", - ) - """ - _response = self._raw_client.test_suite_controller_remove(id, request_options=request_options) - return _response.data - - def test_suite_controller_update( - self, - id: str, - *, - name: typing.Optional[str] = OMIT, - phone_number_id: typing.Optional[str] = OMIT, - tester_plan: typing.Optional[TesterPlan] = OMIT, - target_plan: typing.Optional[TargetPlan] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> TestSuite: - """ - Parameters - ---------- - id : str - - name : typing.Optional[str] - This is the name of the test suite. - - phone_number_id : typing.Optional[str] - This is the phone number ID associated with this test suite. - - tester_plan : typing.Optional[TesterPlan] - Override the default tester plan by providing custom assistant configuration for the test agent. - - We recommend only using this if you are confident, as we have already set sensible defaults on the tester plan. - - target_plan : typing.Optional[TargetPlan] - These are the configuration for the assistant / phone number that is being tested. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - TestSuite - - - Examples - -------- - from vapi import Vapi - - client = Vapi( - token="YOUR_TOKEN", - ) - client.test_suites.test_suite_controller_update( - id="id", - ) - """ - _response = self._raw_client.test_suite_controller_update( - id, - name=name, - phone_number_id=phone_number_id, - tester_plan=tester_plan, - target_plan=target_plan, - request_options=request_options, - ) - return _response.data - - -class AsyncTestSuitesClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._raw_client = AsyncRawTestSuitesClient(client_wrapper=client_wrapper) - - @property - def with_raw_response(self) -> AsyncRawTestSuitesClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - AsyncRawTestSuitesClient - """ - return self._raw_client - - async def test_suite_controller_find_all_paginated( - self, - *, - page: typing.Optional[float] = None, - sort_order: typing.Optional[TestSuiteControllerFindAllPaginatedRequestSortOrder] = None, - limit: typing.Optional[float] = None, - created_at_gt: typing.Optional[dt.datetime] = None, - created_at_lt: typing.Optional[dt.datetime] = None, - created_at_ge: typing.Optional[dt.datetime] = None, - created_at_le: typing.Optional[dt.datetime] = None, - updated_at_gt: typing.Optional[dt.datetime] = None, - updated_at_lt: typing.Optional[dt.datetime] = None, - updated_at_ge: typing.Optional[dt.datetime] = None, - updated_at_le: typing.Optional[dt.datetime] = None, - request_options: typing.Optional[RequestOptions] = None, - ) -> TestSuitesPaginatedResponse: - """ - Parameters - ---------- - page : typing.Optional[float] - This is the page number to return. Defaults to 1. - - sort_order : typing.Optional[TestSuiteControllerFindAllPaginatedRequestSortOrder] - This is the sort order for pagination. Defaults to 'DESC'. - - limit : typing.Optional[float] - This is the maximum number of items to return. Defaults to 100. - - created_at_gt : typing.Optional[dt.datetime] - This will return items where the createdAt is greater than the specified value. - - created_at_lt : typing.Optional[dt.datetime] - This will return items where the createdAt is less than the specified value. - - created_at_ge : typing.Optional[dt.datetime] - This will return items where the createdAt is greater than or equal to the specified value. - - created_at_le : typing.Optional[dt.datetime] - This will return items where the createdAt is less than or equal to the specified value. - - updated_at_gt : typing.Optional[dt.datetime] - This will return items where the updatedAt is greater than the specified value. - - updated_at_lt : typing.Optional[dt.datetime] - This will return items where the updatedAt is less than the specified value. - - updated_at_ge : typing.Optional[dt.datetime] - This will return items where the updatedAt is greater than or equal to the specified value. - - updated_at_le : typing.Optional[dt.datetime] - This will return items where the updatedAt is less than or equal to the specified value. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - TestSuitesPaginatedResponse - - - Examples - -------- - import asyncio - - from vapi import AsyncVapi - - client = AsyncVapi( - token="YOUR_TOKEN", - ) - - - async def main() -> None: - await client.test_suites.test_suite_controller_find_all_paginated() - - - asyncio.run(main()) - """ - _response = await self._raw_client.test_suite_controller_find_all_paginated( - page=page, - sort_order=sort_order, - limit=limit, - created_at_gt=created_at_gt, - created_at_lt=created_at_lt, - created_at_ge=created_at_ge, - created_at_le=created_at_le, - updated_at_gt=updated_at_gt, - updated_at_lt=updated_at_lt, - updated_at_ge=updated_at_ge, - updated_at_le=updated_at_le, - request_options=request_options, - ) - return _response.data - - async def test_suite_controller_create( - self, - *, - name: typing.Optional[str] = OMIT, - phone_number_id: typing.Optional[str] = OMIT, - tester_plan: typing.Optional[TesterPlan] = OMIT, - target_plan: typing.Optional[TargetPlan] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> TestSuite: - """ - Parameters - ---------- - name : typing.Optional[str] - This is the name of the test suite. - - phone_number_id : typing.Optional[str] - This is the phone number ID associated with this test suite. - - tester_plan : typing.Optional[TesterPlan] - Override the default tester plan by providing custom assistant configuration for the test agent. - - We recommend only using this if you are confident, as we have already set sensible defaults on the tester plan. - - target_plan : typing.Optional[TargetPlan] - These are the configuration for the assistant / phone number that is being tested. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - TestSuite - - - Examples - -------- - import asyncio - - from vapi import AsyncVapi - - client = AsyncVapi( - token="YOUR_TOKEN", - ) - - - async def main() -> None: - await client.test_suites.test_suite_controller_create() - - - asyncio.run(main()) - """ - _response = await self._raw_client.test_suite_controller_create( - name=name, - phone_number_id=phone_number_id, - tester_plan=tester_plan, - target_plan=target_plan, - request_options=request_options, - ) - return _response.data - - async def test_suite_controller_find_one( - self, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> TestSuite: - """ - Parameters - ---------- - id : str - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - TestSuite - - - Examples - -------- - import asyncio - - from vapi import AsyncVapi - - client = AsyncVapi( - token="YOUR_TOKEN", - ) - - - async def main() -> None: - await client.test_suites.test_suite_controller_find_one( - id="id", - ) - - - asyncio.run(main()) - """ - _response = await self._raw_client.test_suite_controller_find_one(id, request_options=request_options) - return _response.data - - async def test_suite_controller_remove( - self, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> TestSuite: - """ - Parameters - ---------- - id : str - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - TestSuite - - - Examples - -------- - import asyncio - - from vapi import AsyncVapi - - client = AsyncVapi( - token="YOUR_TOKEN", - ) - - - async def main() -> None: - await client.test_suites.test_suite_controller_remove( - id="id", - ) - - - asyncio.run(main()) - """ - _response = await self._raw_client.test_suite_controller_remove(id, request_options=request_options) - return _response.data - - async def test_suite_controller_update( - self, - id: str, - *, - name: typing.Optional[str] = OMIT, - phone_number_id: typing.Optional[str] = OMIT, - tester_plan: typing.Optional[TesterPlan] = OMIT, - target_plan: typing.Optional[TargetPlan] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> TestSuite: - """ - Parameters - ---------- - id : str - - name : typing.Optional[str] - This is the name of the test suite. - - phone_number_id : typing.Optional[str] - This is the phone number ID associated with this test suite. - - tester_plan : typing.Optional[TesterPlan] - Override the default tester plan by providing custom assistant configuration for the test agent. - - We recommend only using this if you are confident, as we have already set sensible defaults on the tester plan. - - target_plan : typing.Optional[TargetPlan] - These are the configuration for the assistant / phone number that is being tested. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - TestSuite - - - Examples - -------- - import asyncio - - from vapi import AsyncVapi - - client = AsyncVapi( - token="YOUR_TOKEN", - ) - - - async def main() -> None: - await client.test_suites.test_suite_controller_update( - id="id", - ) - - - asyncio.run(main()) - """ - _response = await self._raw_client.test_suite_controller_update( - id, - name=name, - phone_number_id=phone_number_id, - tester_plan=tester_plan, - target_plan=target_plan, - request_options=request_options, - ) - return _response.data diff --git a/src/vapi/test_suites/types/__init__.py b/src/vapi/test_suites/types/__init__.py deleted file mode 100644 index 6ba35b3..0000000 --- a/src/vapi/test_suites/types/__init__.py +++ /dev/null @@ -1,9 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - -from .test_suite_controller_find_all_paginated_request_sort_order import ( - TestSuiteControllerFindAllPaginatedRequestSortOrder, -) - -__all__ = ["TestSuiteControllerFindAllPaginatedRequestSortOrder"] diff --git a/src/vapi/test_suites/types/test_suite_controller_find_all_paginated_request_sort_order.py b/src/vapi/test_suites/types/test_suite_controller_find_all_paginated_request_sort_order.py deleted file mode 100644 index f7a4016..0000000 --- a/src/vapi/test_suites/types/test_suite_controller_find_all_paginated_request_sort_order.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -TestSuiteControllerFindAllPaginatedRequestSortOrder = typing.Union[typing.Literal["ASC", "DESC"], typing.Any] diff --git a/src/vapi/tools/__init__.py b/src/vapi/tools/__init__.py index 0c3bb16..faed186 100644 --- a/src/vapi/tools/__init__.py +++ b/src/vapi/tools/__init__.py @@ -2,15 +2,48 @@ # isort: skip_file -from .types import ( - ToolsCreateRequest, - ToolsCreateResponse, - ToolsDeleteResponse, - ToolsGetResponse, - ToolsListResponseItem, - ToolsUpdateRequest, - ToolsUpdateResponse, -) +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import ( + ToolsCreateRequest, + ToolsCreateResponse, + ToolsDeleteResponse, + ToolsGetResponse, + ToolsListResponseItem, + ToolsUpdateRequest, + ToolsUpdateResponse, + ) +_dynamic_imports: typing.Dict[str, str] = { + "ToolsCreateRequest": ".types", + "ToolsCreateResponse": ".types", + "ToolsDeleteResponse": ".types", + "ToolsGetResponse": ".types", + "ToolsListResponseItem": ".types", + "ToolsUpdateRequest": ".types", + "ToolsUpdateResponse": ".types", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + __all__ = [ "ToolsCreateRequest", diff --git a/src/vapi/tools/types/__init__.py b/src/vapi/tools/types/__init__.py index b63f039..43d38ad 100644 --- a/src/vapi/tools/types/__init__.py +++ b/src/vapi/tools/types/__init__.py @@ -2,13 +2,46 @@ # isort: skip_file -from .tools_create_request import ToolsCreateRequest -from .tools_create_response import ToolsCreateResponse -from .tools_delete_response import ToolsDeleteResponse -from .tools_get_response import ToolsGetResponse -from .tools_list_response_item import ToolsListResponseItem -from .tools_update_request import ToolsUpdateRequest -from .tools_update_response import ToolsUpdateResponse +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .tools_create_request import ToolsCreateRequest + from .tools_create_response import ToolsCreateResponse + from .tools_delete_response import ToolsDeleteResponse + from .tools_get_response import ToolsGetResponse + from .tools_list_response_item import ToolsListResponseItem + from .tools_update_request import ToolsUpdateRequest + from .tools_update_response import ToolsUpdateResponse +_dynamic_imports: typing.Dict[str, str] = { + "ToolsCreateRequest": ".tools_create_request", + "ToolsCreateResponse": ".tools_create_response", + "ToolsDeleteResponse": ".tools_delete_response", + "ToolsGetResponse": ".tools_get_response", + "ToolsListResponseItem": ".tools_list_response_item", + "ToolsUpdateRequest": ".tools_update_request", + "ToolsUpdateResponse": ".tools_update_response", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + __all__ = [ "ToolsCreateRequest", diff --git a/src/vapi/tools/types/tools_create_request.py b/src/vapi/tools/types/tools_create_request.py index 3d1e506..f656342 100644 --- a/src/vapi/tools/types/tools_create_request.py +++ b/src/vapi/tools/types/tools_create_request.py @@ -8,7 +8,6 @@ from ...types.create_dtmf_tool_dto import CreateDtmfToolDto from ...types.create_end_call_tool_dto import CreateEndCallToolDto from ...types.create_function_tool_dto import CreateFunctionToolDto -from ...types.create_ghl_tool_dto import CreateGhlToolDto from ...types.create_go_high_level_calendar_availability_tool_dto import CreateGoHighLevelCalendarAvailabilityToolDto from ...types.create_go_high_level_calendar_event_create_tool_dto import CreateGoHighLevelCalendarEventCreateToolDto from ...types.create_go_high_level_contact_create_tool_dto import CreateGoHighLevelContactCreateToolDto @@ -16,9 +15,8 @@ from ...types.create_google_calendar_check_availability_tool_dto import CreateGoogleCalendarCheckAvailabilityToolDto from ...types.create_google_calendar_create_event_tool_dto import CreateGoogleCalendarCreateEventToolDto from ...types.create_google_sheets_row_append_tool_dto import CreateGoogleSheetsRowAppendToolDto -from ...types.create_make_tool_dto import CreateMakeToolDto +from ...types.create_handoff_tool_dto import CreateHandoffToolDto from ...types.create_mcp_tool_dto import CreateMcpToolDto -from ...types.create_output_tool_dto import CreateOutputToolDto from ...types.create_query_tool_dto import CreateQueryToolDto from ...types.create_slack_send_message_tool_dto import CreateSlackSendMessageToolDto from ...types.create_sms_tool_dto import CreateSmsToolDto @@ -30,10 +28,8 @@ CreateDtmfToolDto, CreateEndCallToolDto, CreateFunctionToolDto, - CreateGhlToolDto, - CreateMakeToolDto, CreateTransferCallToolDto, - CreateOutputToolDto, + CreateHandoffToolDto, CreateBashToolDto, CreateComputerToolDto, CreateTextEditorToolDto, diff --git a/src/vapi/tools/types/tools_create_response.py b/src/vapi/tools/types/tools_create_response.py index e4972bb..760ee0d 100644 --- a/src/vapi/tools/types/tools_create_response.py +++ b/src/vapi/tools/types/tools_create_response.py @@ -8,7 +8,6 @@ from ...types.dtmf_tool import DtmfTool from ...types.end_call_tool import EndCallTool from ...types.function_tool import FunctionTool -from ...types.ghl_tool import GhlTool from ...types.go_high_level_calendar_availability_tool import GoHighLevelCalendarAvailabilityTool from ...types.go_high_level_calendar_event_create_tool import GoHighLevelCalendarEventCreateTool from ...types.go_high_level_contact_create_tool import GoHighLevelContactCreateTool @@ -16,9 +15,8 @@ from ...types.google_calendar_check_availability_tool import GoogleCalendarCheckAvailabilityTool from ...types.google_calendar_create_event_tool import GoogleCalendarCreateEventTool from ...types.google_sheets_row_append_tool import GoogleSheetsRowAppendTool -from ...types.make_tool import MakeTool +from ...types.handoff_tool import HandoffTool from ...types.mcp_tool import McpTool -from ...types.output_tool import OutputTool from ...types.query_tool import QueryTool from ...types.slack_send_message_tool import SlackSendMessageTool from ...types.sms_tool import SmsTool @@ -30,10 +28,8 @@ DtmfTool, EndCallTool, FunctionTool, - GhlTool, - MakeTool, TransferCallTool, - OutputTool, + HandoffTool, BashTool, ComputerTool, TextEditorTool, diff --git a/src/vapi/tools/types/tools_delete_response.py b/src/vapi/tools/types/tools_delete_response.py index 6284e98..d0b5575 100644 --- a/src/vapi/tools/types/tools_delete_response.py +++ b/src/vapi/tools/types/tools_delete_response.py @@ -8,7 +8,6 @@ from ...types.dtmf_tool import DtmfTool from ...types.end_call_tool import EndCallTool from ...types.function_tool import FunctionTool -from ...types.ghl_tool import GhlTool from ...types.go_high_level_calendar_availability_tool import GoHighLevelCalendarAvailabilityTool from ...types.go_high_level_calendar_event_create_tool import GoHighLevelCalendarEventCreateTool from ...types.go_high_level_contact_create_tool import GoHighLevelContactCreateTool @@ -16,9 +15,8 @@ from ...types.google_calendar_check_availability_tool import GoogleCalendarCheckAvailabilityTool from ...types.google_calendar_create_event_tool import GoogleCalendarCreateEventTool from ...types.google_sheets_row_append_tool import GoogleSheetsRowAppendTool -from ...types.make_tool import MakeTool +from ...types.handoff_tool import HandoffTool from ...types.mcp_tool import McpTool -from ...types.output_tool import OutputTool from ...types.query_tool import QueryTool from ...types.slack_send_message_tool import SlackSendMessageTool from ...types.sms_tool import SmsTool @@ -30,10 +28,8 @@ DtmfTool, EndCallTool, FunctionTool, - GhlTool, - MakeTool, TransferCallTool, - OutputTool, + HandoffTool, BashTool, ComputerTool, TextEditorTool, diff --git a/src/vapi/tools/types/tools_get_response.py b/src/vapi/tools/types/tools_get_response.py index 8792f32..eddf495 100644 --- a/src/vapi/tools/types/tools_get_response.py +++ b/src/vapi/tools/types/tools_get_response.py @@ -8,7 +8,6 @@ from ...types.dtmf_tool import DtmfTool from ...types.end_call_tool import EndCallTool from ...types.function_tool import FunctionTool -from ...types.ghl_tool import GhlTool from ...types.go_high_level_calendar_availability_tool import GoHighLevelCalendarAvailabilityTool from ...types.go_high_level_calendar_event_create_tool import GoHighLevelCalendarEventCreateTool from ...types.go_high_level_contact_create_tool import GoHighLevelContactCreateTool @@ -16,9 +15,8 @@ from ...types.google_calendar_check_availability_tool import GoogleCalendarCheckAvailabilityTool from ...types.google_calendar_create_event_tool import GoogleCalendarCreateEventTool from ...types.google_sheets_row_append_tool import GoogleSheetsRowAppendTool -from ...types.make_tool import MakeTool +from ...types.handoff_tool import HandoffTool from ...types.mcp_tool import McpTool -from ...types.output_tool import OutputTool from ...types.query_tool import QueryTool from ...types.slack_send_message_tool import SlackSendMessageTool from ...types.sms_tool import SmsTool @@ -30,10 +28,8 @@ DtmfTool, EndCallTool, FunctionTool, - GhlTool, - MakeTool, TransferCallTool, - OutputTool, + HandoffTool, BashTool, ComputerTool, TextEditorTool, diff --git a/src/vapi/tools/types/tools_list_response_item.py b/src/vapi/tools/types/tools_list_response_item.py index 3cecf87..36a90d2 100644 --- a/src/vapi/tools/types/tools_list_response_item.py +++ b/src/vapi/tools/types/tools_list_response_item.py @@ -8,7 +8,6 @@ from ...types.dtmf_tool import DtmfTool from ...types.end_call_tool import EndCallTool from ...types.function_tool import FunctionTool -from ...types.ghl_tool import GhlTool from ...types.go_high_level_calendar_availability_tool import GoHighLevelCalendarAvailabilityTool from ...types.go_high_level_calendar_event_create_tool import GoHighLevelCalendarEventCreateTool from ...types.go_high_level_contact_create_tool import GoHighLevelContactCreateTool @@ -16,9 +15,8 @@ from ...types.google_calendar_check_availability_tool import GoogleCalendarCheckAvailabilityTool from ...types.google_calendar_create_event_tool import GoogleCalendarCreateEventTool from ...types.google_sheets_row_append_tool import GoogleSheetsRowAppendTool -from ...types.make_tool import MakeTool +from ...types.handoff_tool import HandoffTool from ...types.mcp_tool import McpTool -from ...types.output_tool import OutputTool from ...types.query_tool import QueryTool from ...types.slack_send_message_tool import SlackSendMessageTool from ...types.sms_tool import SmsTool @@ -30,10 +28,8 @@ DtmfTool, EndCallTool, FunctionTool, - GhlTool, - MakeTool, TransferCallTool, - OutputTool, + HandoffTool, BashTool, ComputerTool, TextEditorTool, diff --git a/src/vapi/tools/types/tools_update_request.py b/src/vapi/tools/types/tools_update_request.py index a3e8b05..6cf0d02 100644 --- a/src/vapi/tools/types/tools_update_request.py +++ b/src/vapi/tools/types/tools_update_request.py @@ -8,7 +8,6 @@ from ...types.update_dtmf_tool_dto import UpdateDtmfToolDto from ...types.update_end_call_tool_dto import UpdateEndCallToolDto from ...types.update_function_tool_dto import UpdateFunctionToolDto -from ...types.update_ghl_tool_dto import UpdateGhlToolDto from ...types.update_go_high_level_calendar_availability_tool_dto import UpdateGoHighLevelCalendarAvailabilityToolDto from ...types.update_go_high_level_calendar_event_create_tool_dto import UpdateGoHighLevelCalendarEventCreateToolDto from ...types.update_go_high_level_contact_create_tool_dto import UpdateGoHighLevelContactCreateToolDto @@ -16,9 +15,8 @@ from ...types.update_google_calendar_check_availability_tool_dto import UpdateGoogleCalendarCheckAvailabilityToolDto from ...types.update_google_calendar_create_event_tool_dto import UpdateGoogleCalendarCreateEventToolDto from ...types.update_google_sheets_row_append_tool_dto import UpdateGoogleSheetsRowAppendToolDto -from ...types.update_make_tool_dto import UpdateMakeToolDto +from ...types.update_handoff_tool_dto import UpdateHandoffToolDto from ...types.update_mcp_tool_dto import UpdateMcpToolDto -from ...types.update_output_tool_dto import UpdateOutputToolDto from ...types.update_query_tool_dto import UpdateQueryToolDto from ...types.update_slack_send_message_tool_dto import UpdateSlackSendMessageToolDto from ...types.update_sms_tool_dto import UpdateSmsToolDto @@ -30,10 +28,8 @@ UpdateDtmfToolDto, UpdateEndCallToolDto, UpdateFunctionToolDto, - UpdateGhlToolDto, - UpdateMakeToolDto, UpdateTransferCallToolDto, - UpdateOutputToolDto, + UpdateHandoffToolDto, UpdateBashToolDto, UpdateComputerToolDto, UpdateTextEditorToolDto, diff --git a/src/vapi/tools/types/tools_update_response.py b/src/vapi/tools/types/tools_update_response.py index 79348b4..f1421bd 100644 --- a/src/vapi/tools/types/tools_update_response.py +++ b/src/vapi/tools/types/tools_update_response.py @@ -8,7 +8,6 @@ from ...types.dtmf_tool import DtmfTool from ...types.end_call_tool import EndCallTool from ...types.function_tool import FunctionTool -from ...types.ghl_tool import GhlTool from ...types.go_high_level_calendar_availability_tool import GoHighLevelCalendarAvailabilityTool from ...types.go_high_level_calendar_event_create_tool import GoHighLevelCalendarEventCreateTool from ...types.go_high_level_contact_create_tool import GoHighLevelContactCreateTool @@ -16,9 +15,8 @@ from ...types.google_calendar_check_availability_tool import GoogleCalendarCheckAvailabilityTool from ...types.google_calendar_create_event_tool import GoogleCalendarCreateEventTool from ...types.google_sheets_row_append_tool import GoogleSheetsRowAppendTool -from ...types.make_tool import MakeTool +from ...types.handoff_tool import HandoffTool from ...types.mcp_tool import McpTool -from ...types.output_tool import OutputTool from ...types.query_tool import QueryTool from ...types.slack_send_message_tool import SlackSendMessageTool from ...types.sms_tool import SmsTool @@ -30,10 +28,8 @@ DtmfTool, EndCallTool, FunctionTool, - GhlTool, - MakeTool, TransferCallTool, - OutputTool, + HandoffTool, BashTool, ComputerTool, TextEditorTool, diff --git a/src/vapi/types/__init__.py b/src/vapi/types/__init__.py index ae87c6f..4aba1d4 100644 --- a/src/vapi/types/__init__.py +++ b/src/vapi/types/__init__.py @@ -1 +1,3815 @@ -# This file was auto-generated by Fern from our API Definition. \ No newline at end of file +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .add_voice_to_provider_dto import AddVoiceToProviderDto + from .ai_edge_condition import AiEdgeCondition + from .analysis import Analysis + from .analysis_cost import AnalysisCost + from .analysis_cost_analysis_type import AnalysisCostAnalysisType + from .analysis_cost_breakdown import AnalysisCostBreakdown + from .analysis_plan import AnalysisPlan + from .analytics_operation import AnalyticsOperation + from .analytics_operation_column import AnalyticsOperationColumn + from .analytics_operation_operation import AnalyticsOperationOperation + from .analytics_query import AnalyticsQuery + from .analytics_query_group_by_item import AnalyticsQueryGroupByItem + from .analytics_query_result import AnalyticsQueryResult + from .analytics_query_table import AnalyticsQueryTable + from .anthropic_credential import AnthropicCredential + from .anthropic_model import AnthropicModel + from .anthropic_model_model import AnthropicModelModel + from .anthropic_model_tools_item import AnthropicModelToolsItem + from .anthropic_thinking_config import AnthropicThinkingConfig + from .anyscale_credential import AnyscaleCredential + from .anyscale_model import AnyscaleModel + from .anyscale_model_tools_item import AnyscaleModelToolsItem + from .api_request_tool import ApiRequestTool + from .api_request_tool_messages_item import ApiRequestToolMessagesItem + from .api_request_tool_method import ApiRequestToolMethod + from .artifact import Artifact + from .artifact_messages_item import ArtifactMessagesItem + from .artifact_plan import ArtifactPlan + from .artifact_plan_recording_format import ArtifactPlanRecordingFormat + from .assembly_ai_credential import AssemblyAiCredential + from .assembly_ai_transcriber import AssemblyAiTranscriber + from .assistant import Assistant + from .assistant_background_sound import AssistantBackgroundSound + from .assistant_background_sound_zero import AssistantBackgroundSoundZero + from .assistant_client_messages_item import AssistantClientMessagesItem + from .assistant_credentials_item import AssistantCredentialsItem + from .assistant_custom_endpointing_rule import AssistantCustomEndpointingRule + from .assistant_first_message_mode import AssistantFirstMessageMode + from .assistant_hook_assistant_speech_interrupted import AssistantHookAssistantSpeechInterrupted + from .assistant_hook_call_ending import AssistantHookCallEnding + from .assistant_hook_customer_speech_interrupted import AssistantHookCustomerSpeechInterrupted + from .assistant_hooks_item import AssistantHooksItem + from .assistant_message import AssistantMessage + from .assistant_model import AssistantModel + from .assistant_overrides import AssistantOverrides + from .assistant_overrides_background_sound import AssistantOverridesBackgroundSound + from .assistant_overrides_background_sound_zero import AssistantOverridesBackgroundSoundZero + from .assistant_overrides_client_messages_item import AssistantOverridesClientMessagesItem + from .assistant_overrides_credentials_item import AssistantOverridesCredentialsItem + from .assistant_overrides_first_message_mode import AssistantOverridesFirstMessageMode + from .assistant_overrides_hooks_item import AssistantOverridesHooksItem + from .assistant_overrides_model import AssistantOverridesModel + from .assistant_overrides_server_messages_item import AssistantOverridesServerMessagesItem + from .assistant_overrides_transcriber import AssistantOverridesTranscriber + from .assistant_overrides_voice import AssistantOverridesVoice + from .assistant_overrides_voicemail_detection import AssistantOverridesVoicemailDetection + from .assistant_paginated_response import AssistantPaginatedResponse + from .assistant_server_messages_item import AssistantServerMessagesItem + from .assistant_transcriber import AssistantTranscriber + from .assistant_user_editable import AssistantUserEditable + from .assistant_version_paginated_response import AssistantVersionPaginatedResponse + from .assistant_voice import AssistantVoice + from .assistant_voicemail_detection import AssistantVoicemailDetection + from .auto_reload_plan import AutoReloadPlan + from .azure_blob_storage_bucket_plan import AzureBlobStorageBucketPlan + from .azure_credential import AzureCredential + from .azure_credential_region import AzureCredentialRegion + from .azure_credential_service import AzureCredentialService + from .azure_open_ai_credential import AzureOpenAiCredential + from .azure_open_ai_credential_models_item import AzureOpenAiCredentialModelsItem + from .azure_open_ai_credential_region import AzureOpenAiCredentialRegion + from .azure_speech_transcriber import AzureSpeechTranscriber + from .azure_speech_transcriber_language import AzureSpeechTranscriberLanguage + from .azure_speech_transcriber_segmentation_strategy import AzureSpeechTranscriberSegmentationStrategy + from .azure_voice import AzureVoice + from .azure_voice_id import AzureVoiceId + from .azure_voice_id_enum import AzureVoiceIdEnum + from .background_speech_denoising_plan import BackgroundSpeechDenoisingPlan + from .backoff_plan import BackoffPlan + from .bash_tool import BashTool + from .bash_tool_messages_item import BashToolMessagesItem + from .bash_tool_with_tool_call import BashToolWithToolCall + from .bash_tool_with_tool_call_messages_item import BashToolWithToolCallMessagesItem + from .bearer_authentication_plan import BearerAuthenticationPlan + from .bot_message import BotMessage + from .both_custom_endpointing_rule import BothCustomEndpointingRule + from .bucket_plan import BucketPlan + from .byo_phone_number import ByoPhoneNumber + from .byo_phone_number_fallback_destination import ByoPhoneNumberFallbackDestination + from .byo_phone_number_hooks_item import ByoPhoneNumberHooksItem + from .byo_phone_number_status import ByoPhoneNumberStatus + from .byo_sip_trunk_credential import ByoSipTrunkCredential + from .call import Call + from .call_batch_error import CallBatchError + from .call_batch_response import CallBatchResponse + from .call_costs_item import CallCostsItem + from .call_destination import CallDestination + from .call_ended_reason import CallEndedReason + from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted + from .call_hook_assistant_speech_interrupted_do_item import CallHookAssistantSpeechInterruptedDoItem + from .call_hook_call_ending import CallHookCallEnding + from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted + from .call_hook_customer_speech_interrupted_do_item import CallHookCustomerSpeechInterruptedDoItem + from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout + from .call_hook_customer_speech_timeout_do_item import CallHookCustomerSpeechTimeoutDoItem + from .call_hook_filter import CallHookFilter + from .call_messages_item import CallMessagesItem + from .call_paginated_response import CallPaginatedResponse + from .call_phone_call_provider import CallPhoneCallProvider + from .call_phone_call_transport import CallPhoneCallTransport + from .call_status import CallStatus + from .call_type import CallType + from .campaign import Campaign + from .campaign_ended_reason import CampaignEndedReason + from .campaign_paginated_response import CampaignPaginatedResponse + from .campaign_status import CampaignStatus + from .cartesia_credential import CartesiaCredential + from .cartesia_experimental_controls import CartesiaExperimentalControls + from .cartesia_experimental_controls_emotion import CartesiaExperimentalControlsEmotion + from .cartesia_experimental_controls_speed import CartesiaExperimentalControlsSpeed + from .cartesia_speed_control import CartesiaSpeedControl + from .cartesia_transcriber import CartesiaTranscriber + from .cartesia_transcriber_language import CartesiaTranscriberLanguage + from .cartesia_voice import CartesiaVoice + from .cartesia_voice_language import CartesiaVoiceLanguage + from .cartesia_voice_model import CartesiaVoiceModel + from .cerebras_credential import CerebrasCredential + from .cerebras_model import CerebrasModel + from .cerebras_model_model import CerebrasModelModel + from .cerebras_model_tools_item import CerebrasModelToolsItem + from .chat import Chat + from .chat_assistant_overrides import ChatAssistantOverrides + from .chat_cost import ChatCost + from .chat_costs_item import ChatCostsItem + from .chat_input import ChatInput + from .chat_input_item import ChatInputItem + from .chat_messages_item import ChatMessagesItem + from .chat_output_item import ChatOutputItem + from .chat_paginated_response import ChatPaginatedResponse + from .chunk_plan import ChunkPlan + from .client_inbound_message import ClientInboundMessage + from .client_inbound_message_add_message import ClientInboundMessageAddMessage + from .client_inbound_message_control import ClientInboundMessageControl + from .client_inbound_message_control_control import ClientInboundMessageControlControl + from .client_inbound_message_end_call import ClientInboundMessageEndCall + from .client_inbound_message_message import ClientInboundMessageMessage + from .client_inbound_message_say import ClientInboundMessageSay + from .client_inbound_message_transfer import ClientInboundMessageTransfer + from .client_inbound_message_transfer_destination import ClientInboundMessageTransferDestination + from .client_message import ClientMessage + from .client_message_chat_created import ClientMessageChatCreated + from .client_message_chat_created_phone_number import ClientMessageChatCreatedPhoneNumber + from .client_message_chat_deleted import ClientMessageChatDeleted + from .client_message_chat_deleted_phone_number import ClientMessageChatDeletedPhoneNumber + from .client_message_conversation_update import ClientMessageConversationUpdate + from .client_message_conversation_update_messages_item import ClientMessageConversationUpdateMessagesItem + from .client_message_conversation_update_phone_number import ClientMessageConversationUpdatePhoneNumber + from .client_message_hang import ClientMessageHang + from .client_message_hang_phone_number import ClientMessageHangPhoneNumber + from .client_message_language_change_detected import ClientMessageLanguageChangeDetected + from .client_message_language_change_detected_phone_number import ClientMessageLanguageChangeDetectedPhoneNumber + from .client_message_message import ClientMessageMessage + from .client_message_metadata import ClientMessageMetadata + from .client_message_metadata_phone_number import ClientMessageMetadataPhoneNumber + from .client_message_model_output import ClientMessageModelOutput + from .client_message_model_output_phone_number import ClientMessageModelOutputPhoneNumber + from .client_message_session_created import ClientMessageSessionCreated + from .client_message_session_created_phone_number import ClientMessageSessionCreatedPhoneNumber + from .client_message_session_deleted import ClientMessageSessionDeleted + from .client_message_session_deleted_phone_number import ClientMessageSessionDeletedPhoneNumber + from .client_message_session_updated import ClientMessageSessionUpdated + from .client_message_session_updated_phone_number import ClientMessageSessionUpdatedPhoneNumber + from .client_message_speech_update import ClientMessageSpeechUpdate + from .client_message_speech_update_phone_number import ClientMessageSpeechUpdatePhoneNumber + from .client_message_speech_update_role import ClientMessageSpeechUpdateRole + from .client_message_speech_update_status import ClientMessageSpeechUpdateStatus + from .client_message_tool_calls import ClientMessageToolCalls + from .client_message_tool_calls_phone_number import ClientMessageToolCallsPhoneNumber + from .client_message_tool_calls_result import ClientMessageToolCallsResult + from .client_message_tool_calls_result_phone_number import ClientMessageToolCallsResultPhoneNumber + from .client_message_tool_calls_tool_with_tool_call_list_item import ClientMessageToolCallsToolWithToolCallListItem + from .client_message_transcript import ClientMessageTranscript + from .client_message_transcript_phone_number import ClientMessageTranscriptPhoneNumber + from .client_message_transcript_role import ClientMessageTranscriptRole + from .client_message_transcript_transcript_type import ClientMessageTranscriptTranscriptType + from .client_message_transcript_type import ClientMessageTranscriptType + from .client_message_transfer_update import ClientMessageTransferUpdate + from .client_message_transfer_update_destination import ClientMessageTransferUpdateDestination + from .client_message_transfer_update_phone_number import ClientMessageTransferUpdatePhoneNumber + from .client_message_user_interrupted import ClientMessageUserInterrupted + from .client_message_user_interrupted_phone_number import ClientMessageUserInterruptedPhoneNumber + from .client_message_voice_input import ClientMessageVoiceInput + from .client_message_voice_input_phone_number import ClientMessageVoiceInputPhoneNumber + from .client_message_workflow_node_started import ClientMessageWorkflowNodeStarted + from .client_message_workflow_node_started_phone_number import ClientMessageWorkflowNodeStartedPhoneNumber + from .clone_voice_dto import CloneVoiceDto + from .cloudflare_credential import CloudflareCredential + from .cloudflare_r_2_bucket_plan import CloudflareR2BucketPlan + from .compliance_plan import CompliancePlan + from .computer_tool import ComputerTool + from .computer_tool_messages_item import ComputerToolMessagesItem + from .computer_tool_with_tool_call import ComputerToolWithToolCall + from .computer_tool_with_tool_call_messages_item import ComputerToolWithToolCallMessagesItem + from .condition import Condition + from .condition_operator import ConditionOperator + from .context_engineering_plan_all import ContextEngineeringPlanAll + from .context_engineering_plan_last_n_messages import ContextEngineeringPlanLastNMessages + from .context_engineering_plan_none import ContextEngineeringPlanNone + from .conversation_node import ConversationNode + from .conversation_node_model import ConversationNodeModel + from .conversation_node_tools_item import ConversationNodeToolsItem + from .conversation_node_transcriber import ConversationNodeTranscriber + from .conversation_node_voice import ConversationNodeVoice + from .cost_breakdown import CostBreakdown + from .create_anthropic_credential_dto import CreateAnthropicCredentialDto + from .create_anyscale_credential_dto import CreateAnyscaleCredentialDto + from .create_api_request_tool_dto import CreateApiRequestToolDto + from .create_api_request_tool_dto_messages_item import CreateApiRequestToolDtoMessagesItem + from .create_api_request_tool_dto_method import CreateApiRequestToolDtoMethod + from .create_assembly_ai_credential_dto import CreateAssemblyAiCredentialDto + from .create_assistant_dto import CreateAssistantDto + from .create_assistant_dto_background_sound import CreateAssistantDtoBackgroundSound + from .create_assistant_dto_background_sound_zero import CreateAssistantDtoBackgroundSoundZero + from .create_assistant_dto_client_messages_item import CreateAssistantDtoClientMessagesItem + from .create_assistant_dto_credentials_item import CreateAssistantDtoCredentialsItem + from .create_assistant_dto_first_message_mode import CreateAssistantDtoFirstMessageMode + from .create_assistant_dto_hooks_item import CreateAssistantDtoHooksItem + from .create_assistant_dto_model import CreateAssistantDtoModel + from .create_assistant_dto_server_messages_item import CreateAssistantDtoServerMessagesItem + from .create_assistant_dto_transcriber import CreateAssistantDtoTranscriber + from .create_assistant_dto_voice import CreateAssistantDtoVoice + from .create_assistant_dto_voicemail_detection import CreateAssistantDtoVoicemailDetection + from .create_azure_credential_dto import CreateAzureCredentialDto + from .create_azure_credential_dto_region import CreateAzureCredentialDtoRegion + from .create_azure_credential_dto_service import CreateAzureCredentialDtoService + from .create_azure_open_ai_credential_dto import CreateAzureOpenAiCredentialDto + from .create_azure_open_ai_credential_dto_models_item import CreateAzureOpenAiCredentialDtoModelsItem + from .create_azure_open_ai_credential_dto_region import CreateAzureOpenAiCredentialDtoRegion + from .create_bash_tool_dto import CreateBashToolDto + from .create_bash_tool_dto_messages_item import CreateBashToolDtoMessagesItem + from .create_byo_phone_number_dto import CreateByoPhoneNumberDto + from .create_byo_phone_number_dto_fallback_destination import CreateByoPhoneNumberDtoFallbackDestination + from .create_byo_phone_number_dto_hooks_item import CreateByoPhoneNumberDtoHooksItem + from .create_byo_sip_trunk_credential_dto import CreateByoSipTrunkCredentialDto + from .create_cartesia_credential_dto import CreateCartesiaCredentialDto + from .create_cerebras_credential_dto import CreateCerebrasCredentialDto + from .create_chat_stream_response import CreateChatStreamResponse + from .create_cloudflare_credential_dto import CreateCloudflareCredentialDto + from .create_computer_tool_dto import CreateComputerToolDto + from .create_computer_tool_dto_messages_item import CreateComputerToolDtoMessagesItem + from .create_custom_credential_dto import CreateCustomCredentialDto + from .create_custom_credential_dto_authentication_plan import CreateCustomCredentialDtoAuthenticationPlan + from .create_custom_knowledge_base_dto import CreateCustomKnowledgeBaseDto + from .create_custom_llm_credential_dto import CreateCustomLlmCredentialDto + from .create_customer_dto import CreateCustomerDto + from .create_deep_infra_credential_dto import CreateDeepInfraCredentialDto + from .create_deep_seek_credential_dto import CreateDeepSeekCredentialDto + from .create_deepgram_credential_dto import CreateDeepgramCredentialDto + from .create_dtmf_tool_dto import CreateDtmfToolDto + from .create_dtmf_tool_dto_messages_item import CreateDtmfToolDtoMessagesItem + from .create_eleven_labs_credential_dto import CreateElevenLabsCredentialDto + from .create_end_call_tool_dto import CreateEndCallToolDto + from .create_end_call_tool_dto_messages_item import CreateEndCallToolDtoMessagesItem + from .create_function_tool_dto import CreateFunctionToolDto + from .create_function_tool_dto_messages_item import CreateFunctionToolDtoMessagesItem + from .create_gcp_credential_dto import CreateGcpCredentialDto + from .create_ghl_tool_dto import CreateGhlToolDto + from .create_ghl_tool_dto_messages_item import CreateGhlToolDtoMessagesItem + from .create_gladia_credential_dto import CreateGladiaCredentialDto + from .create_go_high_level_calendar_availability_tool_dto import CreateGoHighLevelCalendarAvailabilityToolDto + from .create_go_high_level_calendar_availability_tool_dto_messages_item import ( + CreateGoHighLevelCalendarAvailabilityToolDtoMessagesItem, + ) + from .create_go_high_level_calendar_event_create_tool_dto import CreateGoHighLevelCalendarEventCreateToolDto + from .create_go_high_level_calendar_event_create_tool_dto_messages_item import ( + CreateGoHighLevelCalendarEventCreateToolDtoMessagesItem, + ) + from .create_go_high_level_contact_create_tool_dto import CreateGoHighLevelContactCreateToolDto + from .create_go_high_level_contact_create_tool_dto_messages_item import ( + CreateGoHighLevelContactCreateToolDtoMessagesItem, + ) + from .create_go_high_level_contact_get_tool_dto import CreateGoHighLevelContactGetToolDto + from .create_go_high_level_contact_get_tool_dto_messages_item import CreateGoHighLevelContactGetToolDtoMessagesItem + from .create_go_high_level_credential_dto import CreateGoHighLevelCredentialDto + from .create_go_high_level_mcp_credential_dto import CreateGoHighLevelMcpCredentialDto + from .create_google_calendar_check_availability_tool_dto import CreateGoogleCalendarCheckAvailabilityToolDto + from .create_google_calendar_check_availability_tool_dto_messages_item import ( + CreateGoogleCalendarCheckAvailabilityToolDtoMessagesItem, + ) + from .create_google_calendar_create_event_tool_dto import CreateGoogleCalendarCreateEventToolDto + from .create_google_calendar_create_event_tool_dto_messages_item import ( + CreateGoogleCalendarCreateEventToolDtoMessagesItem, + ) + from .create_google_calendar_o_auth_2_authorization_credential_dto import ( + CreateGoogleCalendarOAuth2AuthorizationCredentialDto, + ) + from .create_google_calendar_o_auth_2_client_credential_dto import CreateGoogleCalendarOAuth2ClientCredentialDto + from .create_google_credential_dto import CreateGoogleCredentialDto + from .create_google_sheets_o_auth_2_authorization_credential_dto import ( + CreateGoogleSheetsOAuth2AuthorizationCredentialDto, + ) + from .create_google_sheets_row_append_tool_dto import CreateGoogleSheetsRowAppendToolDto + from .create_google_sheets_row_append_tool_dto_messages_item import CreateGoogleSheetsRowAppendToolDtoMessagesItem + from .create_groq_credential_dto import CreateGroqCredentialDto + from .create_handoff_tool_dto import CreateHandoffToolDto + from .create_handoff_tool_dto_destinations_item import CreateHandoffToolDtoDestinationsItem + from .create_handoff_tool_dto_messages_item import CreateHandoffToolDtoMessagesItem + from .create_hume_credential_dto import CreateHumeCredentialDto + from .create_inflection_ai_credential_dto import CreateInflectionAiCredentialDto + from .create_inworld_credential_dto import CreateInworldCredentialDto + from .create_langfuse_credential_dto import CreateLangfuseCredentialDto + from .create_lmnt_credential_dto import CreateLmntCredentialDto + from .create_make_credential_dto import CreateMakeCredentialDto + from .create_make_tool_dto import CreateMakeToolDto + from .create_make_tool_dto_messages_item import CreateMakeToolDtoMessagesItem + from .create_mcp_tool_dto import CreateMcpToolDto + from .create_mcp_tool_dto_messages_item import CreateMcpToolDtoMessagesItem + from .create_minimax_credential_dto import CreateMinimaxCredentialDto + from .create_mistral_credential_dto import CreateMistralCredentialDto + from .create_neuphonic_credential_dto import CreateNeuphonicCredentialDto + from .create_open_ai_credential_dto import CreateOpenAiCredentialDto + from .create_open_router_credential_dto import CreateOpenRouterCredentialDto + from .create_org_dto import CreateOrgDto + from .create_org_dto_channel import CreateOrgDtoChannel + from .create_outbound_call_dto import CreateOutboundCallDto + from .create_output_tool_dto import CreateOutputToolDto + from .create_output_tool_dto_messages_item import CreateOutputToolDtoMessagesItem + from .create_perplexity_ai_credential_dto import CreatePerplexityAiCredentialDto + from .create_play_ht_credential_dto import CreatePlayHtCredentialDto + from .create_query_tool_dto import CreateQueryToolDto + from .create_query_tool_dto_messages_item import CreateQueryToolDtoMessagesItem + from .create_rime_ai_credential_dto import CreateRimeAiCredentialDto + from .create_runpod_credential_dto import CreateRunpodCredentialDto + from .create_s_3_credential_dto import CreateS3CredentialDto + from .create_sesame_voice_dto import CreateSesameVoiceDto + from .create_slack_o_auth_2_authorization_credential_dto import CreateSlackOAuth2AuthorizationCredentialDto + from .create_slack_send_message_tool_dto import CreateSlackSendMessageToolDto + from .create_slack_send_message_tool_dto_messages_item import CreateSlackSendMessageToolDtoMessagesItem + from .create_smallest_ai_credential_dto import CreateSmallestAiCredentialDto + from .create_sms_tool_dto import CreateSmsToolDto + from .create_sms_tool_dto_messages_item import CreateSmsToolDtoMessagesItem + from .create_speechmatics_credential_dto import CreateSpeechmaticsCredentialDto + from .create_squad_dto import CreateSquadDto + from .create_supabase_credential_dto import CreateSupabaseCredentialDto + from .create_tavus_credential_dto import CreateTavusCredentialDto + from .create_telnyx_phone_number_dto import CreateTelnyxPhoneNumberDto + from .create_telnyx_phone_number_dto_fallback_destination import CreateTelnyxPhoneNumberDtoFallbackDestination + from .create_telnyx_phone_number_dto_hooks_item import CreateTelnyxPhoneNumberDtoHooksItem + from .create_test_suite_dto import CreateTestSuiteDto + from .create_test_suite_run_dto import CreateTestSuiteRunDto + from .create_test_suite_test_chat_dto import CreateTestSuiteTestChatDto + from .create_test_suite_test_voice_dto import CreateTestSuiteTestVoiceDto + from .create_text_editor_tool_dto import CreateTextEditorToolDto + from .create_text_editor_tool_dto_messages_item import CreateTextEditorToolDtoMessagesItem + from .create_together_ai_credential_dto import CreateTogetherAiCredentialDto + from .create_token_dto import CreateTokenDto + from .create_token_dto_tag import CreateTokenDtoTag + from .create_tool_template_dto import CreateToolTemplateDto + from .create_tool_template_dto_details import CreateToolTemplateDtoDetails + from .create_tool_template_dto_provider import CreateToolTemplateDtoProvider + from .create_tool_template_dto_provider_details import CreateToolTemplateDtoProviderDetails + from .create_tool_template_dto_visibility import CreateToolTemplateDtoVisibility + from .create_transfer_call_tool_dto import CreateTransferCallToolDto + from .create_transfer_call_tool_dto_destinations_item import CreateTransferCallToolDtoDestinationsItem + from .create_transfer_call_tool_dto_messages_item import CreateTransferCallToolDtoMessagesItem + from .create_trieve_credential_dto import CreateTrieveCredentialDto + from .create_trieve_knowledge_base_dto import CreateTrieveKnowledgeBaseDto + from .create_twilio_credential_dto import CreateTwilioCredentialDto + from .create_twilio_phone_number_dto import CreateTwilioPhoneNumberDto + from .create_twilio_phone_number_dto_fallback_destination import CreateTwilioPhoneNumberDtoFallbackDestination + from .create_twilio_phone_number_dto_hooks_item import CreateTwilioPhoneNumberDtoHooksItem + from .create_vapi_phone_number_dto import CreateVapiPhoneNumberDto + from .create_vapi_phone_number_dto_fallback_destination import CreateVapiPhoneNumberDtoFallbackDestination + from .create_vapi_phone_number_dto_hooks_item import CreateVapiPhoneNumberDtoHooksItem + from .create_voicemail_tool_dto import CreateVoicemailToolDto + from .create_voicemail_tool_dto_messages_item import CreateVoicemailToolDtoMessagesItem + from .create_vonage_credential_dto import CreateVonageCredentialDto + from .create_vonage_phone_number_dto import CreateVonagePhoneNumberDto + from .create_vonage_phone_number_dto_fallback_destination import CreateVonagePhoneNumberDtoFallbackDestination + from .create_vonage_phone_number_dto_hooks_item import CreateVonagePhoneNumberDtoHooksItem + from .create_web_call_dto import CreateWebCallDto + from .create_web_chat_dto import CreateWebChatDto + from .create_web_chat_dto_input import CreateWebChatDtoInput + from .create_web_chat_dto_input_item import CreateWebChatDtoInputItem + from .create_web_customer_dto import CreateWebCustomerDto + from .create_webhook_credential_dto import CreateWebhookCredentialDto + from .create_webhook_credential_dto_authentication_plan import CreateWebhookCredentialDtoAuthenticationPlan + from .create_workflow_dto import CreateWorkflowDto + from .create_workflow_dto_background_sound import CreateWorkflowDtoBackgroundSound + from .create_workflow_dto_background_sound_zero import CreateWorkflowDtoBackgroundSoundZero + from .create_workflow_dto_credentials_item import CreateWorkflowDtoCredentialsItem + from .create_workflow_dto_hooks_item import CreateWorkflowDtoHooksItem + from .create_workflow_dto_model import CreateWorkflowDtoModel + from .create_workflow_dto_nodes_item import CreateWorkflowDtoNodesItem + from .create_workflow_dto_transcriber import CreateWorkflowDtoTranscriber + from .create_workflow_dto_voice import CreateWorkflowDtoVoice + from .create_x_ai_credential_dto import CreateXAiCredentialDto + from .credential_action_request import CredentialActionRequest + from .credential_end_user import CredentialEndUser + from .credential_session_dto import CredentialSessionDto + from .credential_session_dto_provider import CredentialSessionDtoProvider + from .credential_session_error import CredentialSessionError + from .credential_session_response import CredentialSessionResponse + from .credential_webhook_dto import CredentialWebhookDto + from .credential_webhook_dto_auth_mode import CredentialWebhookDtoAuthMode + from .credential_webhook_dto_operation import CredentialWebhookDtoOperation + from .credential_webhook_dto_type import CredentialWebhookDtoType + from .custom_credential import CustomCredential + from .custom_credential_authentication_plan import CustomCredentialAuthenticationPlan + from .custom_endpointing_model_smart_endpointing_plan import CustomEndpointingModelSmartEndpointingPlan + from .custom_endpointing_model_smart_endpointing_plan_provider import ( + CustomEndpointingModelSmartEndpointingPlanProvider, + ) + from .custom_knowledge_base import CustomKnowledgeBase + from .custom_llm_credential import CustomLlmCredential + from .custom_llm_model import CustomLlmModel + from .custom_llm_model_metadata_send_mode import CustomLlmModelMetadataSendMode + from .custom_llm_model_tools_item import CustomLlmModelToolsItem + from .custom_message import CustomMessage + from .custom_transcriber import CustomTranscriber + from .custom_voice import CustomVoice + from .customer_custom_endpointing_rule import CustomerCustomEndpointingRule + from .customer_speech_timeout_options import CustomerSpeechTimeoutOptions + from .deep_infra_credential import DeepInfraCredential + from .deep_infra_model import DeepInfraModel + from .deep_infra_model_tools_item import DeepInfraModelToolsItem + from .deep_seek_credential import DeepSeekCredential + from .deep_seek_model import DeepSeekModel + from .deep_seek_model_model import DeepSeekModelModel + from .deep_seek_model_tools_item import DeepSeekModelToolsItem + from .deepgram_credential import DeepgramCredential + from .deepgram_transcriber import DeepgramTranscriber + from .deepgram_transcriber_language import DeepgramTranscriberLanguage + from .deepgram_transcriber_model import DeepgramTranscriberModel + from .deepgram_voice import DeepgramVoice + from .deepgram_voice_id import DeepgramVoiceId + from .deepgram_voice_model import DeepgramVoiceModel + from .developer_message import DeveloperMessage + from .dtmf_tool import DtmfTool + from .dtmf_tool_messages_item import DtmfToolMessagesItem + from .edge import Edge + from .eleven_labs_credential import ElevenLabsCredential + from .eleven_labs_pronunciation_dictionary import ElevenLabsPronunciationDictionary + from .eleven_labs_pronunciation_dictionary_locator import ElevenLabsPronunciationDictionaryLocator + from .eleven_labs_pronunciation_dictionary_permission_on_resource import ( + ElevenLabsPronunciationDictionaryPermissionOnResource, + ) + from .eleven_labs_transcriber import ElevenLabsTranscriber + from .eleven_labs_transcriber_language import ElevenLabsTranscriberLanguage + from .eleven_labs_voice import ElevenLabsVoice + from .eleven_labs_voice_id import ElevenLabsVoiceId + from .eleven_labs_voice_id_enum import ElevenLabsVoiceIdEnum + from .eleven_labs_voice_model import ElevenLabsVoiceModel + from .end_call_tool import EndCallTool + from .end_call_tool_messages_item import EndCallToolMessagesItem + from .exact_replacement import ExactReplacement + from .failed_edge_condition import FailedEdgeCondition + from .fallback_assembly_ai_transcriber import FallbackAssemblyAiTranscriber + from .fallback_azure_speech_transcriber import FallbackAzureSpeechTranscriber + from .fallback_azure_speech_transcriber_language import FallbackAzureSpeechTranscriberLanguage + from .fallback_azure_speech_transcriber_segmentation_strategy import ( + FallbackAzureSpeechTranscriberSegmentationStrategy, + ) + from .fallback_azure_voice import FallbackAzureVoice + from .fallback_azure_voice_id import FallbackAzureVoiceId + from .fallback_azure_voice_voice_id import FallbackAzureVoiceVoiceId + from .fallback_cartesia_transcriber import FallbackCartesiaTranscriber + from .fallback_cartesia_transcriber_language import FallbackCartesiaTranscriberLanguage + from .fallback_cartesia_voice import FallbackCartesiaVoice + from .fallback_cartesia_voice_language import FallbackCartesiaVoiceLanguage + from .fallback_cartesia_voice_model import FallbackCartesiaVoiceModel + from .fallback_custom_transcriber import FallbackCustomTranscriber + from .fallback_custom_voice import FallbackCustomVoice + from .fallback_deepgram_transcriber import FallbackDeepgramTranscriber + from .fallback_deepgram_transcriber_language import FallbackDeepgramTranscriberLanguage + from .fallback_deepgram_transcriber_model import FallbackDeepgramTranscriberModel + from .fallback_deepgram_voice import FallbackDeepgramVoice + from .fallback_deepgram_voice_id import FallbackDeepgramVoiceId + from .fallback_deepgram_voice_model import FallbackDeepgramVoiceModel + from .fallback_eleven_labs_transcriber import FallbackElevenLabsTranscriber + from .fallback_eleven_labs_transcriber_language import FallbackElevenLabsTranscriberLanguage + from .fallback_eleven_labs_voice import FallbackElevenLabsVoice + from .fallback_eleven_labs_voice_id import FallbackElevenLabsVoiceId + from .fallback_eleven_labs_voice_id_enum import FallbackElevenLabsVoiceIdEnum + from .fallback_eleven_labs_voice_model import FallbackElevenLabsVoiceModel + from .fallback_gladia_transcriber import FallbackGladiaTranscriber + from .fallback_gladia_transcriber_language import FallbackGladiaTranscriberLanguage + from .fallback_gladia_transcriber_language_behaviour import FallbackGladiaTranscriberLanguageBehaviour + from .fallback_gladia_transcriber_languages import FallbackGladiaTranscriberLanguages + from .fallback_gladia_transcriber_model import FallbackGladiaTranscriberModel + from .fallback_google_transcriber import FallbackGoogleTranscriber + from .fallback_google_transcriber_language import FallbackGoogleTranscriberLanguage + from .fallback_google_transcriber_model import FallbackGoogleTranscriberModel + from .fallback_hume_voice import FallbackHumeVoice + from .fallback_inworld_voice import FallbackInworldVoice + from .fallback_inworld_voice_language_code import FallbackInworldVoiceLanguageCode + from .fallback_inworld_voice_voice_id import FallbackInworldVoiceVoiceId + from .fallback_lmnt_voice import FallbackLmntVoice + from .fallback_lmnt_voice_id import FallbackLmntVoiceId + from .fallback_lmnt_voice_id_enum import FallbackLmntVoiceIdEnum + from .fallback_lmnt_voice_language import FallbackLmntVoiceLanguage + from .fallback_minimax_voice import FallbackMinimaxVoice + from .fallback_minimax_voice_model import FallbackMinimaxVoiceModel + from .fallback_minimax_voice_region import FallbackMinimaxVoiceRegion + from .fallback_neets_voice import FallbackNeetsVoice + from .fallback_neuphonic_voice import FallbackNeuphonicVoice + from .fallback_neuphonic_voice_model import FallbackNeuphonicVoiceModel + from .fallback_open_ai_transcriber import FallbackOpenAiTranscriber + from .fallback_open_ai_transcriber_language import FallbackOpenAiTranscriberLanguage + from .fallback_open_ai_transcriber_model import FallbackOpenAiTranscriberModel + from .fallback_open_ai_voice import FallbackOpenAiVoice + from .fallback_open_ai_voice_id import FallbackOpenAiVoiceId + from .fallback_open_ai_voice_id_enum import FallbackOpenAiVoiceIdEnum + from .fallback_open_ai_voice_model import FallbackOpenAiVoiceModel + from .fallback_plan import FallbackPlan + from .fallback_plan_voices_item import FallbackPlanVoicesItem + from .fallback_play_ht_voice import FallbackPlayHtVoice + from .fallback_play_ht_voice_emotion import FallbackPlayHtVoiceEmotion + from .fallback_play_ht_voice_id import FallbackPlayHtVoiceId + from .fallback_play_ht_voice_id_enum import FallbackPlayHtVoiceIdEnum + from .fallback_play_ht_voice_language import FallbackPlayHtVoiceLanguage + from .fallback_play_ht_voice_model import FallbackPlayHtVoiceModel + from .fallback_rime_ai_voice import FallbackRimeAiVoice + from .fallback_rime_ai_voice_id import FallbackRimeAiVoiceId + from .fallback_rime_ai_voice_id_enum import FallbackRimeAiVoiceIdEnum + from .fallback_rime_ai_voice_model import FallbackRimeAiVoiceModel + from .fallback_sesame_voice import FallbackSesameVoice + from .fallback_smallest_ai_voice import FallbackSmallestAiVoice + from .fallback_smallest_ai_voice_id import FallbackSmallestAiVoiceId + from .fallback_smallest_ai_voice_id_enum import FallbackSmallestAiVoiceIdEnum + from .fallback_speechmatics_transcriber import FallbackSpeechmaticsTranscriber + from .fallback_speechmatics_transcriber_language import FallbackSpeechmaticsTranscriberLanguage + from .fallback_talkscriber_transcriber import FallbackTalkscriberTranscriber + from .fallback_talkscriber_transcriber_language import FallbackTalkscriberTranscriberLanguage + from .fallback_tavus_voice import FallbackTavusVoice + from .fallback_tavus_voice_voice_id import FallbackTavusVoiceVoiceId + from .fallback_transcriber_plan import FallbackTranscriberPlan + from .fallback_transcriber_plan_transcribers_item import FallbackTranscriberPlanTranscribersItem + from .fallback_vapi_voice import FallbackVapiVoice + from .fallback_vapi_voice_voice_id import FallbackVapiVoiceVoiceId + from .file import File + from .file_status import FileStatus + from .format_plan import FormatPlan + from .format_plan_formatters_enabled_item import FormatPlanFormattersEnabledItem + from .format_plan_replacements_item import FormatPlanReplacementsItem + from .fourier_denoising_plan import FourierDenoisingPlan + from .function_call import FunctionCall + from .function_call_assistant_hook_action import FunctionCallAssistantHookAction + from .function_call_hook_action import FunctionCallHookAction + from .function_call_hook_action_messages_item import FunctionCallHookActionMessagesItem + from .function_tool import FunctionTool + from .function_tool_messages_item import FunctionToolMessagesItem + from .function_tool_provider_details import FunctionToolProviderDetails + from .function_tool_with_tool_call import FunctionToolWithToolCall + from .function_tool_with_tool_call_messages_item import FunctionToolWithToolCallMessagesItem + from .gcp_credential import GcpCredential + from .gcp_key import GcpKey + from .gemini_multimodal_live_prebuilt_voice_config import GeminiMultimodalLivePrebuiltVoiceConfig + from .gemini_multimodal_live_prebuilt_voice_config_voice_name import ( + GeminiMultimodalLivePrebuiltVoiceConfigVoiceName, + ) + from .gemini_multimodal_live_speech_config import GeminiMultimodalLiveSpeechConfig + from .gemini_multimodal_live_voice_config import GeminiMultimodalLiveVoiceConfig + from .get_chat_paginated_dto import GetChatPaginatedDto + from .get_chat_paginated_dto_sort_order import GetChatPaginatedDtoSortOrder + from .get_session_paginated_dto import GetSessionPaginatedDto + from .get_session_paginated_dto_sort_order import GetSessionPaginatedDtoSortOrder + from .ghl_tool import GhlTool + from .ghl_tool_messages_item import GhlToolMessagesItem + from .ghl_tool_metadata import GhlToolMetadata + from .ghl_tool_provider_details import GhlToolProviderDetails + from .ghl_tool_with_tool_call import GhlToolWithToolCall + from .ghl_tool_with_tool_call_messages_item import GhlToolWithToolCallMessagesItem + from .gladia_credential import GladiaCredential + from .gladia_custom_vocabulary_config_dto import GladiaCustomVocabularyConfigDto + from .gladia_custom_vocabulary_config_dto_vocabulary_item import GladiaCustomVocabularyConfigDtoVocabularyItem + from .gladia_transcriber import GladiaTranscriber + from .gladia_transcriber_language import GladiaTranscriberLanguage + from .gladia_transcriber_language_behaviour import GladiaTranscriberLanguageBehaviour + from .gladia_transcriber_languages import GladiaTranscriberLanguages + from .gladia_transcriber_model import GladiaTranscriberModel + from .gladia_vocabulary_item_dto import GladiaVocabularyItemDto + from .global_node_plan import GlobalNodePlan + from .go_high_level_calendar_availability_tool import GoHighLevelCalendarAvailabilityTool + from .go_high_level_calendar_availability_tool_messages_item import GoHighLevelCalendarAvailabilityToolMessagesItem + from .go_high_level_calendar_availability_tool_provider_details import ( + GoHighLevelCalendarAvailabilityToolProviderDetails, + ) + from .go_high_level_calendar_availability_tool_with_tool_call import GoHighLevelCalendarAvailabilityToolWithToolCall + from .go_high_level_calendar_availability_tool_with_tool_call_messages_item import ( + GoHighLevelCalendarAvailabilityToolWithToolCallMessagesItem, + ) + from .go_high_level_calendar_event_create_tool import GoHighLevelCalendarEventCreateTool + from .go_high_level_calendar_event_create_tool_messages_item import GoHighLevelCalendarEventCreateToolMessagesItem + from .go_high_level_calendar_event_create_tool_provider_details import ( + GoHighLevelCalendarEventCreateToolProviderDetails, + ) + from .go_high_level_calendar_event_create_tool_with_tool_call import GoHighLevelCalendarEventCreateToolWithToolCall + from .go_high_level_calendar_event_create_tool_with_tool_call_messages_item import ( + GoHighLevelCalendarEventCreateToolWithToolCallMessagesItem, + ) + from .go_high_level_contact_create_tool import GoHighLevelContactCreateTool + from .go_high_level_contact_create_tool_messages_item import GoHighLevelContactCreateToolMessagesItem + from .go_high_level_contact_create_tool_provider_details import GoHighLevelContactCreateToolProviderDetails + from .go_high_level_contact_create_tool_with_tool_call import GoHighLevelContactCreateToolWithToolCall + from .go_high_level_contact_create_tool_with_tool_call_messages_item import ( + GoHighLevelContactCreateToolWithToolCallMessagesItem, + ) + from .go_high_level_contact_get_tool import GoHighLevelContactGetTool + from .go_high_level_contact_get_tool_messages_item import GoHighLevelContactGetToolMessagesItem + from .go_high_level_contact_get_tool_provider_details import GoHighLevelContactGetToolProviderDetails + from .go_high_level_contact_get_tool_with_tool_call import GoHighLevelContactGetToolWithToolCall + from .go_high_level_contact_get_tool_with_tool_call_messages_item import ( + GoHighLevelContactGetToolWithToolCallMessagesItem, + ) + from .go_high_level_credential import GoHighLevelCredential + from .go_high_level_mcp_credential import GoHighLevelMcpCredential + from .google_calendar_check_availability_tool import GoogleCalendarCheckAvailabilityTool + from .google_calendar_check_availability_tool_messages_item import GoogleCalendarCheckAvailabilityToolMessagesItem + from .google_calendar_create_event_tool import GoogleCalendarCreateEventTool + from .google_calendar_create_event_tool_messages_item import GoogleCalendarCreateEventToolMessagesItem + from .google_calendar_create_event_tool_provider_details import GoogleCalendarCreateEventToolProviderDetails + from .google_calendar_create_event_tool_with_tool_call import GoogleCalendarCreateEventToolWithToolCall + from .google_calendar_create_event_tool_with_tool_call_messages_item import ( + GoogleCalendarCreateEventToolWithToolCallMessagesItem, + ) + from .google_calendar_o_auth_2_authorization_credential import GoogleCalendarOAuth2AuthorizationCredential + from .google_calendar_o_auth_2_client_credential import GoogleCalendarOAuth2ClientCredential + from .google_credential import GoogleCredential + from .google_model import GoogleModel + from .google_model_model import GoogleModelModel + from .google_model_tools_item import GoogleModelToolsItem + from .google_realtime_config import GoogleRealtimeConfig + from .google_sheets_o_auth_2_authorization_credential import GoogleSheetsOAuth2AuthorizationCredential + from .google_sheets_row_append_tool import GoogleSheetsRowAppendTool + from .google_sheets_row_append_tool_messages_item import GoogleSheetsRowAppendToolMessagesItem + from .google_sheets_row_append_tool_provider_details import GoogleSheetsRowAppendToolProviderDetails + from .google_sheets_row_append_tool_with_tool_call import GoogleSheetsRowAppendToolWithToolCall + from .google_sheets_row_append_tool_with_tool_call_messages_item import ( + GoogleSheetsRowAppendToolWithToolCallMessagesItem, + ) + from .google_transcriber import GoogleTranscriber + from .google_transcriber_language import GoogleTranscriberLanguage + from .google_transcriber_model import GoogleTranscriberModel + from .google_voicemail_detection_plan import GoogleVoicemailDetectionPlan + from .google_voicemail_detection_plan_type import GoogleVoicemailDetectionPlanType + from .groq_credential import GroqCredential + from .groq_model import GroqModel + from .groq_model_model import GroqModelModel + from .groq_model_tools_item import GroqModelToolsItem + from .group_condition import GroupCondition + from .group_condition_conditions_item import GroupConditionConditionsItem + from .group_condition_operator import GroupConditionOperator + from .handoff_destination_assistant import HandoffDestinationAssistant + from .handoff_destination_assistant_context_engineering_plan import ( + HandoffDestinationAssistantContextEngineeringPlan, + ) + from .handoff_destination_dynamic import HandoffDestinationDynamic + from .handoff_tool import HandoffTool + from .handoff_tool_destinations_item import HandoffToolDestinationsItem + from .handoff_tool_messages_item import HandoffToolMessagesItem + from .hangup_node import HangupNode + from .hmac_authentication_plan import HmacAuthenticationPlan + from .hmac_authentication_plan_algorithm import HmacAuthenticationPlanAlgorithm + from .hmac_authentication_plan_signature_encoding import HmacAuthenticationPlanSignatureEncoding + from .hume_credential import HumeCredential + from .hume_voice import HumeVoice + from .import_twilio_phone_number_dto import ImportTwilioPhoneNumberDto + from .import_twilio_phone_number_dto_fallback_destination import ImportTwilioPhoneNumberDtoFallbackDestination + from .import_twilio_phone_number_dto_hooks_item import ImportTwilioPhoneNumberDtoHooksItem + from .import_vonage_phone_number_dto import ImportVonagePhoneNumberDto + from .import_vonage_phone_number_dto_fallback_destination import ImportVonagePhoneNumberDtoFallbackDestination + from .import_vonage_phone_number_dto_hooks_item import ImportVonagePhoneNumberDtoHooksItem + from .inflection_ai_credential import InflectionAiCredential + from .inflection_ai_model import InflectionAiModel + from .inflection_ai_model_tools_item import InflectionAiModelToolsItem + from .invite_user_dto import InviteUserDto + from .invite_user_dto_role import InviteUserDtoRole + from .invoice_plan import InvoicePlan + from .inworld_credential import InworldCredential + from .inworld_voice import InworldVoice + from .inworld_voice_language_code import InworldVoiceLanguageCode + from .inworld_voice_voice_id import InworldVoiceVoiceId + from .json_schema import JsonSchema + from .json_schema_format import JsonSchemaFormat + from .json_schema_type import JsonSchemaType + from .jwt_response import JwtResponse + from .keypad_input_plan import KeypadInputPlan + from .keypad_input_plan_delimiters import KeypadInputPlanDelimiters + from .knowledge_base import KnowledgeBase + from .knowledge_base_cost import KnowledgeBaseCost + from .knowledge_base_model import KnowledgeBaseModel + from .knowledge_base_response_document import KnowledgeBaseResponseDocument + from .langfuse_credential import LangfuseCredential + from .langfuse_observability_plan import LangfuseObservabilityPlan + from .liquid_condition import LiquidCondition + from .livekit_smart_endpointing_plan import LivekitSmartEndpointingPlan + from .livekit_smart_endpointing_plan_provider import LivekitSmartEndpointingPlanProvider + from .lmnt_credential import LmntCredential + from .lmnt_voice import LmntVoice + from .lmnt_voice_id import LmntVoiceId + from .lmnt_voice_id_enum import LmntVoiceIdEnum + from .lmnt_voice_language import LmntVoiceLanguage + from .logic_edge_condition import LogicEdgeCondition + from .make_credential import MakeCredential + from .make_tool import MakeTool + from .make_tool_messages_item import MakeToolMessagesItem + from .make_tool_metadata import MakeToolMetadata + from .make_tool_provider_details import MakeToolProviderDetails + from .make_tool_with_tool_call import MakeToolWithToolCall + from .make_tool_with_tool_call_messages_item import MakeToolWithToolCallMessagesItem + from .mcp_tool import McpTool + from .mcp_tool_messages_item import McpToolMessagesItem + from .mcp_tool_metadata import McpToolMetadata + from .mcp_tool_metadata_protocol import McpToolMetadataProtocol + from .message_target import MessageTarget + from .message_target_role import MessageTargetRole + from .minimax_voice import MinimaxVoice + from .minimax_voice_model import MinimaxVoiceModel + from .minimax_voice_region import MinimaxVoiceRegion + from .mistral_credential import MistralCredential + from .model_cost import ModelCost + from .monitor import Monitor + from .monitor_plan import MonitorPlan + from .mono import Mono + from .neets_voice import NeetsVoice + from .neuphonic_credential import NeuphonicCredential + from .neuphonic_voice import NeuphonicVoice + from .neuphonic_voice_model import NeuphonicVoiceModel + from .node_artifact import NodeArtifact + from .node_artifact_messages_item import NodeArtifactMessagesItem + from .o_auth_2_authentication_plan import OAuth2AuthenticationPlan + from .oauth_2_authentication_session import Oauth2AuthenticationSession + from .open_ai_credential import OpenAiCredential + from .open_ai_function import OpenAiFunction + from .open_ai_function_parameters import OpenAiFunctionParameters + from .open_ai_message import OpenAiMessage + from .open_ai_message_role import OpenAiMessageRole + from .open_ai_model import OpenAiModel + from .open_ai_model_fallback_models_item import OpenAiModelFallbackModelsItem + from .open_ai_model_model import OpenAiModelModel + from .open_ai_model_tool_strict_compatibility_mode import OpenAiModelToolStrictCompatibilityMode + from .open_ai_model_tools_item import OpenAiModelToolsItem + from .open_ai_transcriber import OpenAiTranscriber + from .open_ai_transcriber_language import OpenAiTranscriberLanguage + from .open_ai_transcriber_model import OpenAiTranscriberModel + from .open_ai_voice import OpenAiVoice + from .open_ai_voice_id import OpenAiVoiceId + from .open_ai_voice_id_enum import OpenAiVoiceIdEnum + from .open_ai_voice_model import OpenAiVoiceModel + from .open_ai_voicemail_detection_plan import OpenAiVoicemailDetectionPlan + from .open_ai_voicemail_detection_plan_type import OpenAiVoicemailDetectionPlanType + from .open_ai_web_chat_request import OpenAiWebChatRequest + from .open_ai_web_chat_request_input import OpenAiWebChatRequestInput + from .open_ai_web_chat_request_input_item import OpenAiWebChatRequestInputItem + from .open_router_credential import OpenRouterCredential + from .open_router_model import OpenRouterModel + from .open_router_model_tools_item import OpenRouterModelToolsItem + from .org import Org + from .org_channel import OrgChannel + from .output_tool import OutputTool + from .output_tool_messages_item import OutputToolMessagesItem + from .pagination_meta import PaginationMeta + from .performance_metrics import PerformanceMetrics + from .perplexity_ai_credential import PerplexityAiCredential + from .perplexity_ai_model import PerplexityAiModel + from .perplexity_ai_model_tools_item import PerplexityAiModelToolsItem + from .phone_number_call_ending_hook_filter import PhoneNumberCallEndingHookFilter + from .phone_number_call_ending_hook_filter_one_of_item import PhoneNumberCallEndingHookFilterOneOfItem + from .phone_number_hook_call_ending import PhoneNumberHookCallEnding + from .phone_number_hook_call_ending_do import PhoneNumberHookCallEndingDo + from .phone_number_hook_call_ringing import PhoneNumberHookCallRinging + from .phone_number_hook_call_ringing_do_item import PhoneNumberHookCallRingingDoItem + from .phone_number_paginated_response import PhoneNumberPaginatedResponse + from .phone_number_paginated_response_results_item import PhoneNumberPaginatedResponseResultsItem + from .play_ht_credential import PlayHtCredential + from .play_ht_voice import PlayHtVoice + from .play_ht_voice_emotion import PlayHtVoiceEmotion + from .play_ht_voice_id import PlayHtVoiceId + from .play_ht_voice_id_enum import PlayHtVoiceIdEnum + from .play_ht_voice_language import PlayHtVoiceLanguage + from .play_ht_voice_model import PlayHtVoiceModel + from .prompt_injection_security_filter import PromptInjectionSecurityFilter + from .provider_resource import ProviderResource + from .provider_resource_paginated_response import ProviderResourcePaginatedResponse + from .punctuation_boundary import PunctuationBoundary + from .query_tool import QueryTool + from .query_tool_messages_item import QueryToolMessagesItem + from .rce_security_filter import RceSecurityFilter + from .recording import Recording + from .regex_condition import RegexCondition + from .regex_option import RegexOption + from .regex_option_type import RegexOptionType + from .regex_replacement import RegexReplacement + from .regex_security_filter import RegexSecurityFilter + from .response_completed_event import ResponseCompletedEvent + from .response_error_event import ResponseErrorEvent + from .response_object import ResponseObject + from .response_object_status import ResponseObjectStatus + from .response_output_message import ResponseOutputMessage + from .response_output_message_status import ResponseOutputMessageStatus + from .response_output_text import ResponseOutputText + from .response_text_delta_event import ResponseTextDeltaEvent + from .response_text_done_event import ResponseTextDoneEvent + from .rime_ai_credential import RimeAiCredential + from .rime_ai_voice import RimeAiVoice + from .rime_ai_voice_id import RimeAiVoiceId + from .rime_ai_voice_id_enum import RimeAiVoiceIdEnum + from .rime_ai_voice_model import RimeAiVoiceModel + from .runpod_credential import RunpodCredential + from .s_3_credential import S3Credential + from .say_assistant_hook_action import SayAssistantHookAction + from .say_hook_action import SayHookAction + from .say_hook_action_prompt import SayHookActionPrompt + from .say_hook_action_prompt_item import SayHookActionPromptItem + from .say_phone_number_hook_action import SayPhoneNumberHookAction + from .sbc_configuration import SbcConfiguration + from .schedule_plan import SchedulePlan + from .security_filter_base import SecurityFilterBase + from .security_filter_plan import SecurityFilterPlan + from .security_filter_plan_mode import SecurityFilterPlanMode + from .server import Server + from .server_message import ServerMessage + from .server_message_assistant_request import ServerMessageAssistantRequest + from .server_message_assistant_request_phone_number import ServerMessageAssistantRequestPhoneNumber + from .server_message_call_endpointing_request import ServerMessageCallEndpointingRequest + from .server_message_call_endpointing_request_messages_item import ServerMessageCallEndpointingRequestMessagesItem + from .server_message_call_endpointing_request_phone_number import ServerMessageCallEndpointingRequestPhoneNumber + from .server_message_chat_created import ServerMessageChatCreated + from .server_message_chat_created_phone_number import ServerMessageChatCreatedPhoneNumber + from .server_message_chat_deleted import ServerMessageChatDeleted + from .server_message_chat_deleted_phone_number import ServerMessageChatDeletedPhoneNumber + from .server_message_conversation_update import ServerMessageConversationUpdate + from .server_message_conversation_update_messages_item import ServerMessageConversationUpdateMessagesItem + from .server_message_conversation_update_phone_number import ServerMessageConversationUpdatePhoneNumber + from .server_message_end_of_call_report import ServerMessageEndOfCallReport + from .server_message_end_of_call_report_costs_item import ServerMessageEndOfCallReportCostsItem + from .server_message_end_of_call_report_ended_reason import ServerMessageEndOfCallReportEndedReason + from .server_message_end_of_call_report_phone_number import ServerMessageEndOfCallReportPhoneNumber + from .server_message_hang import ServerMessageHang + from .server_message_hang_phone_number import ServerMessageHangPhoneNumber + from .server_message_knowledge_base_request import ServerMessageKnowledgeBaseRequest + from .server_message_knowledge_base_request_messages_item import ServerMessageKnowledgeBaseRequestMessagesItem + from .server_message_knowledge_base_request_phone_number import ServerMessageKnowledgeBaseRequestPhoneNumber + from .server_message_language_change_detected import ServerMessageLanguageChangeDetected + from .server_message_language_change_detected_phone_number import ServerMessageLanguageChangeDetectedPhoneNumber + from .server_message_message import ServerMessageMessage + from .server_message_model_output import ServerMessageModelOutput + from .server_message_model_output_phone_number import ServerMessageModelOutputPhoneNumber + from .server_message_phone_call_control import ServerMessagePhoneCallControl + from .server_message_phone_call_control_destination import ServerMessagePhoneCallControlDestination + from .server_message_phone_call_control_phone_number import ServerMessagePhoneCallControlPhoneNumber + from .server_message_phone_call_control_request import ServerMessagePhoneCallControlRequest + from .server_message_response import ServerMessageResponse + from .server_message_response_assistant_request import ServerMessageResponseAssistantRequest + from .server_message_response_assistant_request_destination import ServerMessageResponseAssistantRequestDestination + from .server_message_response_call_endpointing_request import ServerMessageResponseCallEndpointingRequest + from .server_message_response_handoff_destination_request import ServerMessageResponseHandoffDestinationRequest + from .server_message_response_knowledge_base_request import ServerMessageResponseKnowledgeBaseRequest + from .server_message_response_message_response import ServerMessageResponseMessageResponse + from .server_message_response_tool_calls import ServerMessageResponseToolCalls + from .server_message_response_transfer_destination_request import ServerMessageResponseTransferDestinationRequest + from .server_message_response_transfer_destination_request_destination import ( + ServerMessageResponseTransferDestinationRequestDestination, + ) + from .server_message_response_transfer_destination_request_message import ( + ServerMessageResponseTransferDestinationRequestMessage, + ) + from .server_message_response_voice_request import ServerMessageResponseVoiceRequest + from .server_message_session_created import ServerMessageSessionCreated + from .server_message_session_created_phone_number import ServerMessageSessionCreatedPhoneNumber + from .server_message_session_deleted import ServerMessageSessionDeleted + from .server_message_session_deleted_phone_number import ServerMessageSessionDeletedPhoneNumber + from .server_message_session_updated import ServerMessageSessionUpdated + from .server_message_session_updated_phone_number import ServerMessageSessionUpdatedPhoneNumber + from .server_message_speech_update import ServerMessageSpeechUpdate + from .server_message_speech_update_phone_number import ServerMessageSpeechUpdatePhoneNumber + from .server_message_speech_update_role import ServerMessageSpeechUpdateRole + from .server_message_speech_update_status import ServerMessageSpeechUpdateStatus + from .server_message_status_update import ServerMessageStatusUpdate + from .server_message_status_update_destination import ServerMessageStatusUpdateDestination + from .server_message_status_update_ended_reason import ServerMessageStatusUpdateEndedReason + from .server_message_status_update_messages_item import ServerMessageStatusUpdateMessagesItem + from .server_message_status_update_phone_number import ServerMessageStatusUpdatePhoneNumber + from .server_message_status_update_status import ServerMessageStatusUpdateStatus + from .server_message_tool_calls import ServerMessageToolCalls + from .server_message_tool_calls_phone_number import ServerMessageToolCallsPhoneNumber + from .server_message_tool_calls_tool_with_tool_call_list_item import ServerMessageToolCallsToolWithToolCallListItem + from .server_message_transcript import ServerMessageTranscript + from .server_message_transcript_phone_number import ServerMessageTranscriptPhoneNumber + from .server_message_transcript_role import ServerMessageTranscriptRole + from .server_message_transcript_transcript_type import ServerMessageTranscriptTranscriptType + from .server_message_transcript_type import ServerMessageTranscriptType + from .server_message_transfer_destination_request import ServerMessageTransferDestinationRequest + from .server_message_transfer_destination_request_phone_number import ( + ServerMessageTransferDestinationRequestPhoneNumber, + ) + from .server_message_transfer_update import ServerMessageTransferUpdate + from .server_message_transfer_update_destination import ServerMessageTransferUpdateDestination + from .server_message_transfer_update_phone_number import ServerMessageTransferUpdatePhoneNumber + from .server_message_user_interrupted import ServerMessageUserInterrupted + from .server_message_user_interrupted_phone_number import ServerMessageUserInterruptedPhoneNumber + from .server_message_voice_input import ServerMessageVoiceInput + from .server_message_voice_input_phone_number import ServerMessageVoiceInputPhoneNumber + from .server_message_voice_request import ServerMessageVoiceRequest + from .server_message_voice_request_phone_number import ServerMessageVoiceRequestPhoneNumber + from .sesame_voice import SesameVoice + from .session import Session + from .session_messages_item import SessionMessagesItem + from .session_paginated_response import SessionPaginatedResponse + from .session_status import SessionStatus + from .sip_authentication import SipAuthentication + from .sip_trunk_gateway import SipTrunkGateway + from .sip_trunk_gateway_outbound_protocol import SipTrunkGatewayOutboundProtocol + from .sip_trunk_outbound_authentication_plan import SipTrunkOutboundAuthenticationPlan + from .sip_trunk_outbound_sip_register_plan import SipTrunkOutboundSipRegisterPlan + from .slack_o_auth_2_authorization_credential import SlackOAuth2AuthorizationCredential + from .slack_send_message_tool import SlackSendMessageTool + from .slack_send_message_tool_messages_item import SlackSendMessageToolMessagesItem + from .smallest_ai_credential import SmallestAiCredential + from .smallest_ai_voice import SmallestAiVoice + from .smallest_ai_voice_id import SmallestAiVoiceId + from .smallest_ai_voice_id_enum import SmallestAiVoiceIdEnum + from .smart_denoising_plan import SmartDenoisingPlan + from .sms_tool import SmsTool + from .sms_tool_messages_item import SmsToolMessagesItem + from .speechmatics_credential import SpeechmaticsCredential + from .speechmatics_transcriber import SpeechmaticsTranscriber + from .speechmatics_transcriber_language import SpeechmaticsTranscriberLanguage + from .sql_injection_security_filter import SqlInjectionSecurityFilter + from .squad import Squad + from .squad_member_dto import SquadMemberDto + from .squad_member_dto_assistant_destinations_item import SquadMemberDtoAssistantDestinationsItem + from .ssrf_security_filter import SsrfSecurityFilter + from .start_speaking_plan import StartSpeakingPlan + from .start_speaking_plan_custom_endpointing_rules_item import StartSpeakingPlanCustomEndpointingRulesItem + from .start_speaking_plan_smart_endpointing_enabled import StartSpeakingPlanSmartEndpointingEnabled + from .start_speaking_plan_smart_endpointing_plan import StartSpeakingPlanSmartEndpointingPlan + from .stop_speaking_plan import StopSpeakingPlan + from .structured_data_multi_plan import StructuredDataMultiPlan + from .structured_data_plan import StructuredDataPlan + from .structured_output import StructuredOutput + from .structured_output_model import StructuredOutputModel + from .structured_output_paginated_response import StructuredOutputPaginatedResponse + from .subscription import Subscription + from .subscription_minutes_included_reset_frequency import SubscriptionMinutesIncludedResetFrequency + from .subscription_status import SubscriptionStatus + from .subscription_type import SubscriptionType + from .success_evaluation_plan import SuccessEvaluationPlan + from .success_evaluation_plan_rubric import SuccessEvaluationPlanRubric + from .summary_plan import SummaryPlan + from .supabase_bucket_plan import SupabaseBucketPlan + from .supabase_bucket_plan_region import SupabaseBucketPlanRegion + from .supabase_credential import SupabaseCredential + from .sync_voice_library_dto import SyncVoiceLibraryDto + from .sync_voice_library_dto_providers_item import SyncVoiceLibraryDtoProvidersItem + from .system_message import SystemMessage + from .talkscriber_transcriber import TalkscriberTranscriber + from .talkscriber_transcriber_language import TalkscriberTranscriberLanguage + from .target_plan import TargetPlan + from .tavus_conversation_properties import TavusConversationProperties + from .tavus_credential import TavusCredential + from .tavus_voice import TavusVoice + from .tavus_voice_voice_id import TavusVoiceVoiceId + from .telnyx_phone_number import TelnyxPhoneNumber + from .telnyx_phone_number_fallback_destination import TelnyxPhoneNumberFallbackDestination + from .telnyx_phone_number_hooks_item import TelnyxPhoneNumberHooksItem + from .telnyx_phone_number_status import TelnyxPhoneNumberStatus + from .template import Template + from .template_details import TemplateDetails + from .template_provider import TemplateProvider + from .template_provider_details import TemplateProviderDetails + from .template_visibility import TemplateVisibility + from .test_suite import TestSuite + from .test_suite_phone_number import TestSuitePhoneNumber + from .test_suite_run import TestSuiteRun + from .test_suite_run_scorer_ai import TestSuiteRunScorerAi + from .test_suite_run_scorer_ai_result import TestSuiteRunScorerAiResult + from .test_suite_run_status import TestSuiteRunStatus + from .test_suite_run_test_attempt import TestSuiteRunTestAttempt + from .test_suite_run_test_attempt_call import TestSuiteRunTestAttemptCall + from .test_suite_run_test_attempt_metadata import TestSuiteRunTestAttemptMetadata + from .test_suite_run_test_result import TestSuiteRunTestResult + from .test_suite_runs_paginated_response import TestSuiteRunsPaginatedResponse + from .test_suite_test_chat import TestSuiteTestChat + from .test_suite_test_scorer_ai import TestSuiteTestScorerAi + from .test_suite_test_voice import TestSuiteTestVoice + from .test_suite_tests_paginated_response import TestSuiteTestsPaginatedResponse + from .test_suite_tests_paginated_response_results_item import TestSuiteTestsPaginatedResponseResultsItem + from .test_suites_paginated_response import TestSuitesPaginatedResponse + from .tester_plan import TesterPlan + from .text_content import TextContent + from .text_content_language import TextContentLanguage + from .text_editor_tool import TextEditorTool + from .text_editor_tool_messages_item import TextEditorToolMessagesItem + from .text_editor_tool_with_tool_call import TextEditorToolWithToolCall + from .text_editor_tool_with_tool_call_messages_item import TextEditorToolWithToolCallMessagesItem + from .time_range import TimeRange + from .time_range_step import TimeRangeStep + from .together_ai_credential import TogetherAiCredential + from .together_ai_model import TogetherAiModel + from .together_ai_model_tools_item import TogetherAiModelToolsItem + from .token import Token + from .token_restrictions import TokenRestrictions + from .token_tag import TokenTag + from .tool_call import ToolCall + from .tool_call_function import ToolCallFunction + from .tool_call_hook_action import ToolCallHookAction + from .tool_call_hook_action_tool import ToolCallHookActionTool + from .tool_call_message import ToolCallMessage + from .tool_call_result import ToolCallResult + from .tool_call_result_message import ToolCallResultMessage + from .tool_message import ToolMessage + from .tool_message_complete import ToolMessageComplete + from .tool_message_complete_role import ToolMessageCompleteRole + from .tool_message_delayed import ToolMessageDelayed + from .tool_message_failed import ToolMessageFailed + from .tool_message_start import ToolMessageStart + from .tool_node import ToolNode + from .tool_node_tool import ToolNodeTool + from .tool_rejection_plan import ToolRejectionPlan + from .tool_rejection_plan_conditions_item import ToolRejectionPlanConditionsItem + from .tool_template_metadata import ToolTemplateMetadata + from .tool_template_setup import ToolTemplateSetup + from .transcriber_cost import TranscriberCost + from .transcript_plan import TranscriptPlan + from .transcription_endpointing_plan import TranscriptionEndpointingPlan + from .transfer_assistant import TransferAssistant + from .transfer_assistant_first_message_mode import TransferAssistantFirstMessageMode + from .transfer_assistant_hook_action import TransferAssistantHookAction + from .transfer_assistant_model import TransferAssistantModel + from .transfer_assistant_model_provider import TransferAssistantModelProvider + from .transfer_call_tool import TransferCallTool + from .transfer_call_tool_destinations_item import TransferCallToolDestinationsItem + from .transfer_call_tool_messages_item import TransferCallToolMessagesItem + from .transfer_cancel_tool_user_editable import TransferCancelToolUserEditable + from .transfer_cancel_tool_user_editable_messages_item import TransferCancelToolUserEditableMessagesItem + from .transfer_destination_assistant import TransferDestinationAssistant + from .transfer_destination_assistant_message import TransferDestinationAssistantMessage + from .transfer_destination_number import TransferDestinationNumber + from .transfer_destination_number_message import TransferDestinationNumberMessage + from .transfer_destination_sip import TransferDestinationSip + from .transfer_destination_sip_message import TransferDestinationSipMessage + from .transfer_fallback_plan import TransferFallbackPlan + from .transfer_fallback_plan_message import TransferFallbackPlanMessage + from .transfer_hook_action import TransferHookAction + from .transfer_hook_action_destination import TransferHookActionDestination + from .transfer_mode import TransferMode + from .transfer_phone_number_hook_action import TransferPhoneNumberHookAction + from .transfer_phone_number_hook_action_destination import TransferPhoneNumberHookActionDestination + from .transfer_plan import TransferPlan + from .transfer_plan_message import TransferPlanMessage + from .transfer_plan_mode import TransferPlanMode + from .transfer_successful_tool_user_editable import TransferSuccessfulToolUserEditable + from .transfer_successful_tool_user_editable_messages_item import TransferSuccessfulToolUserEditableMessagesItem + from .transport_configuration_twilio import TransportConfigurationTwilio + from .transport_configuration_twilio_recording_channels import TransportConfigurationTwilioRecordingChannels + from .transport_cost import TransportCost + from .transport_cost_provider import TransportCostProvider + from .trieve_credential import TrieveCredential + from .trieve_knowledge_base import TrieveKnowledgeBase + from .trieve_knowledge_base_chunk_plan import TrieveKnowledgeBaseChunkPlan + from .trieve_knowledge_base_create import TrieveKnowledgeBaseCreate + from .trieve_knowledge_base_import import TrieveKnowledgeBaseImport + from .trieve_knowledge_base_search_plan import TrieveKnowledgeBaseSearchPlan + from .trieve_knowledge_base_search_plan_search_type import TrieveKnowledgeBaseSearchPlanSearchType + from .turn_latency import TurnLatency + from .twilio_credential import TwilioCredential + from .twilio_phone_number import TwilioPhoneNumber + from .twilio_phone_number_fallback_destination import TwilioPhoneNumberFallbackDestination + from .twilio_phone_number_hooks_item import TwilioPhoneNumberHooksItem + from .twilio_phone_number_status import TwilioPhoneNumberStatus + from .twilio_voicemail_detection_plan import TwilioVoicemailDetectionPlan + from .twilio_voicemail_detection_plan_voicemail_detection_types_item import ( + TwilioVoicemailDetectionPlanVoicemailDetectionTypesItem, + ) + from .update_anthropic_credential_dto import UpdateAnthropicCredentialDto + from .update_anyscale_credential_dto import UpdateAnyscaleCredentialDto + from .update_api_request_tool_dto import UpdateApiRequestToolDto + from .update_api_request_tool_dto_messages_item import UpdateApiRequestToolDtoMessagesItem + from .update_api_request_tool_dto_method import UpdateApiRequestToolDtoMethod + from .update_assembly_ai_credential_dto import UpdateAssemblyAiCredentialDto + from .update_azure_credential_dto import UpdateAzureCredentialDto + from .update_azure_credential_dto_region import UpdateAzureCredentialDtoRegion + from .update_azure_credential_dto_service import UpdateAzureCredentialDtoService + from .update_azure_open_ai_credential_dto import UpdateAzureOpenAiCredentialDto + from .update_azure_open_ai_credential_dto_models_item import UpdateAzureOpenAiCredentialDtoModelsItem + from .update_azure_open_ai_credential_dto_region import UpdateAzureOpenAiCredentialDtoRegion + from .update_bash_tool_dto import UpdateBashToolDto + from .update_bash_tool_dto_messages_item import UpdateBashToolDtoMessagesItem + from .update_byo_phone_number_dto import UpdateByoPhoneNumberDto + from .update_byo_phone_number_dto_fallback_destination import UpdateByoPhoneNumberDtoFallbackDestination + from .update_byo_phone_number_dto_hooks_item import UpdateByoPhoneNumberDtoHooksItem + from .update_byo_sip_trunk_credential_dto import UpdateByoSipTrunkCredentialDto + from .update_cartesia_credential_dto import UpdateCartesiaCredentialDto + from .update_cerebras_credential_dto import UpdateCerebrasCredentialDto + from .update_cloudflare_credential_dto import UpdateCloudflareCredentialDto + from .update_computer_tool_dto import UpdateComputerToolDto + from .update_computer_tool_dto_messages_item import UpdateComputerToolDtoMessagesItem + from .update_custom_credential_dto import UpdateCustomCredentialDto + from .update_custom_credential_dto_authentication_plan import UpdateCustomCredentialDtoAuthenticationPlan + from .update_custom_knowledge_base_dto import UpdateCustomKnowledgeBaseDto + from .update_custom_llm_credential_dto import UpdateCustomLlmCredentialDto + from .update_deep_infra_credential_dto import UpdateDeepInfraCredentialDto + from .update_deep_seek_credential_dto import UpdateDeepSeekCredentialDto + from .update_deepgram_credential_dto import UpdateDeepgramCredentialDto + from .update_dtmf_tool_dto import UpdateDtmfToolDto + from .update_dtmf_tool_dto_messages_item import UpdateDtmfToolDtoMessagesItem + from .update_eleven_labs_credential_dto import UpdateElevenLabsCredentialDto + from .update_end_call_tool_dto import UpdateEndCallToolDto + from .update_end_call_tool_dto_messages_item import UpdateEndCallToolDtoMessagesItem + from .update_function_tool_dto import UpdateFunctionToolDto + from .update_function_tool_dto_messages_item import UpdateFunctionToolDtoMessagesItem + from .update_gcp_credential_dto import UpdateGcpCredentialDto + from .update_ghl_tool_dto import UpdateGhlToolDto + from .update_ghl_tool_dto_messages_item import UpdateGhlToolDtoMessagesItem + from .update_gladia_credential_dto import UpdateGladiaCredentialDto + from .update_go_high_level_calendar_availability_tool_dto import UpdateGoHighLevelCalendarAvailabilityToolDto + from .update_go_high_level_calendar_availability_tool_dto_messages_item import ( + UpdateGoHighLevelCalendarAvailabilityToolDtoMessagesItem, + ) + from .update_go_high_level_calendar_event_create_tool_dto import UpdateGoHighLevelCalendarEventCreateToolDto + from .update_go_high_level_calendar_event_create_tool_dto_messages_item import ( + UpdateGoHighLevelCalendarEventCreateToolDtoMessagesItem, + ) + from .update_go_high_level_contact_create_tool_dto import UpdateGoHighLevelContactCreateToolDto + from .update_go_high_level_contact_create_tool_dto_messages_item import ( + UpdateGoHighLevelContactCreateToolDtoMessagesItem, + ) + from .update_go_high_level_contact_get_tool_dto import UpdateGoHighLevelContactGetToolDto + from .update_go_high_level_contact_get_tool_dto_messages_item import UpdateGoHighLevelContactGetToolDtoMessagesItem + from .update_go_high_level_credential_dto import UpdateGoHighLevelCredentialDto + from .update_go_high_level_mcp_credential_dto import UpdateGoHighLevelMcpCredentialDto + from .update_google_calendar_check_availability_tool_dto import UpdateGoogleCalendarCheckAvailabilityToolDto + from .update_google_calendar_check_availability_tool_dto_messages_item import ( + UpdateGoogleCalendarCheckAvailabilityToolDtoMessagesItem, + ) + from .update_google_calendar_create_event_tool_dto import UpdateGoogleCalendarCreateEventToolDto + from .update_google_calendar_create_event_tool_dto_messages_item import ( + UpdateGoogleCalendarCreateEventToolDtoMessagesItem, + ) + from .update_google_calendar_o_auth_2_authorization_credential_dto import ( + UpdateGoogleCalendarOAuth2AuthorizationCredentialDto, + ) + from .update_google_calendar_o_auth_2_client_credential_dto import UpdateGoogleCalendarOAuth2ClientCredentialDto + from .update_google_credential_dto import UpdateGoogleCredentialDto + from .update_google_sheets_o_auth_2_authorization_credential_dto import ( + UpdateGoogleSheetsOAuth2AuthorizationCredentialDto, + ) + from .update_google_sheets_row_append_tool_dto import UpdateGoogleSheetsRowAppendToolDto + from .update_google_sheets_row_append_tool_dto_messages_item import UpdateGoogleSheetsRowAppendToolDtoMessagesItem + from .update_groq_credential_dto import UpdateGroqCredentialDto + from .update_handoff_tool_dto import UpdateHandoffToolDto + from .update_handoff_tool_dto_destinations_item import UpdateHandoffToolDtoDestinationsItem + from .update_handoff_tool_dto_messages_item import UpdateHandoffToolDtoMessagesItem + from .update_hume_credential_dto import UpdateHumeCredentialDto + from .update_inflection_ai_credential_dto import UpdateInflectionAiCredentialDto + from .update_inworld_credential_dto import UpdateInworldCredentialDto + from .update_langfuse_credential_dto import UpdateLangfuseCredentialDto + from .update_lmnt_credential_dto import UpdateLmntCredentialDto + from .update_make_credential_dto import UpdateMakeCredentialDto + from .update_make_tool_dto import UpdateMakeToolDto + from .update_make_tool_dto_messages_item import UpdateMakeToolDtoMessagesItem + from .update_mcp_tool_dto import UpdateMcpToolDto + from .update_mcp_tool_dto_messages_item import UpdateMcpToolDtoMessagesItem + from .update_mistral_credential_dto import UpdateMistralCredentialDto + from .update_neuphonic_credential_dto import UpdateNeuphonicCredentialDto + from .update_open_ai_credential_dto import UpdateOpenAiCredentialDto + from .update_open_router_credential_dto import UpdateOpenRouterCredentialDto + from .update_org_dto import UpdateOrgDto + from .update_org_dto_channel import UpdateOrgDtoChannel + from .update_output_tool_dto import UpdateOutputToolDto + from .update_output_tool_dto_messages_item import UpdateOutputToolDtoMessagesItem + from .update_perplexity_ai_credential_dto import UpdatePerplexityAiCredentialDto + from .update_play_ht_credential_dto import UpdatePlayHtCredentialDto + from .update_query_tool_dto import UpdateQueryToolDto + from .update_query_tool_dto_messages_item import UpdateQueryToolDtoMessagesItem + from .update_rime_ai_credential_dto import UpdateRimeAiCredentialDto + from .update_runpod_credential_dto import UpdateRunpodCredentialDto + from .update_s_3_credential_dto import UpdateS3CredentialDto + from .update_slack_o_auth_2_authorization_credential_dto import UpdateSlackOAuth2AuthorizationCredentialDto + from .update_slack_send_message_tool_dto import UpdateSlackSendMessageToolDto + from .update_slack_send_message_tool_dto_messages_item import UpdateSlackSendMessageToolDtoMessagesItem + from .update_smallest_ai_credential_dto import UpdateSmallestAiCredentialDto + from .update_sms_tool_dto import UpdateSmsToolDto + from .update_sms_tool_dto_messages_item import UpdateSmsToolDtoMessagesItem + from .update_speechmatics_credential_dto import UpdateSpeechmaticsCredentialDto + from .update_supabase_credential_dto import UpdateSupabaseCredentialDto + from .update_tavus_credential_dto import UpdateTavusCredentialDto + from .update_telnyx_phone_number_dto import UpdateTelnyxPhoneNumberDto + from .update_telnyx_phone_number_dto_fallback_destination import UpdateTelnyxPhoneNumberDtoFallbackDestination + from .update_telnyx_phone_number_dto_hooks_item import UpdateTelnyxPhoneNumberDtoHooksItem + from .update_test_suite_dto import UpdateTestSuiteDto + from .update_test_suite_run_dto import UpdateTestSuiteRunDto + from .update_test_suite_test_chat_dto import UpdateTestSuiteTestChatDto + from .update_test_suite_test_voice_dto import UpdateTestSuiteTestVoiceDto + from .update_text_editor_tool_dto import UpdateTextEditorToolDto + from .update_text_editor_tool_dto_messages_item import UpdateTextEditorToolDtoMessagesItem + from .update_together_ai_credential_dto import UpdateTogetherAiCredentialDto + from .update_token_dto import UpdateTokenDto + from .update_token_dto_tag import UpdateTokenDtoTag + from .update_tool_template_dto import UpdateToolTemplateDto + from .update_tool_template_dto_details import UpdateToolTemplateDtoDetails + from .update_tool_template_dto_provider import UpdateToolTemplateDtoProvider + from .update_tool_template_dto_provider_details import UpdateToolTemplateDtoProviderDetails + from .update_tool_template_dto_visibility import UpdateToolTemplateDtoVisibility + from .update_transfer_call_tool_dto import UpdateTransferCallToolDto + from .update_transfer_call_tool_dto_destinations_item import UpdateTransferCallToolDtoDestinationsItem + from .update_transfer_call_tool_dto_messages_item import UpdateTransferCallToolDtoMessagesItem + from .update_trieve_credential_dto import UpdateTrieveCredentialDto + from .update_trieve_knowledge_base_dto import UpdateTrieveKnowledgeBaseDto + from .update_twilio_credential_dto import UpdateTwilioCredentialDto + from .update_twilio_phone_number_dto import UpdateTwilioPhoneNumberDto + from .update_twilio_phone_number_dto_fallback_destination import UpdateTwilioPhoneNumberDtoFallbackDestination + from .update_twilio_phone_number_dto_hooks_item import UpdateTwilioPhoneNumberDtoHooksItem + from .update_user_role_dto import UpdateUserRoleDto + from .update_user_role_dto_role import UpdateUserRoleDtoRole + from .update_vapi_phone_number_dto import UpdateVapiPhoneNumberDto + from .update_vapi_phone_number_dto_fallback_destination import UpdateVapiPhoneNumberDtoFallbackDestination + from .update_vapi_phone_number_dto_hooks_item import UpdateVapiPhoneNumberDtoHooksItem + from .update_vonage_credential_dto import UpdateVonageCredentialDto + from .update_vonage_phone_number_dto import UpdateVonagePhoneNumberDto + from .update_vonage_phone_number_dto_fallback_destination import UpdateVonagePhoneNumberDtoFallbackDestination + from .update_vonage_phone_number_dto_hooks_item import UpdateVonagePhoneNumberDtoHooksItem + from .update_webhook_credential_dto import UpdateWebhookCredentialDto + from .update_webhook_credential_dto_authentication_plan import UpdateWebhookCredentialDtoAuthenticationPlan + from .update_workflow_dto import UpdateWorkflowDto + from .update_workflow_dto_background_sound import UpdateWorkflowDtoBackgroundSound + from .update_workflow_dto_background_sound_zero import UpdateWorkflowDtoBackgroundSoundZero + from .update_workflow_dto_credentials_item import UpdateWorkflowDtoCredentialsItem + from .update_workflow_dto_hooks_item import UpdateWorkflowDtoHooksItem + from .update_workflow_dto_model import UpdateWorkflowDtoModel + from .update_workflow_dto_nodes_item import UpdateWorkflowDtoNodesItem + from .update_workflow_dto_transcriber import UpdateWorkflowDtoTranscriber + from .update_workflow_dto_voice import UpdateWorkflowDtoVoice + from .update_x_ai_credential_dto import UpdateXAiCredentialDto + from .user import User + from .user_message import UserMessage + from .vapi_cost import VapiCost + from .vapi_cost_sub_type import VapiCostSubType + from .vapi_model import VapiModel + from .vapi_model_tools_item import VapiModelToolsItem + from .vapi_phone_number import VapiPhoneNumber + from .vapi_phone_number_fallback_destination import VapiPhoneNumberFallbackDestination + from .vapi_phone_number_hooks_item import VapiPhoneNumberHooksItem + from .vapi_phone_number_status import VapiPhoneNumberStatus + from .vapi_smart_endpointing_plan import VapiSmartEndpointingPlan + from .vapi_smart_endpointing_plan_provider import VapiSmartEndpointingPlanProvider + from .vapi_voice import VapiVoice + from .vapi_voice_voice_id import VapiVoiceVoiceId + from .vapi_voicemail_detection_plan import VapiVoicemailDetectionPlan + from .vapi_voicemail_detection_plan_type import VapiVoicemailDetectionPlanType + from .variable_extraction_alias import VariableExtractionAlias + from .variable_extraction_plan import VariableExtractionPlan + from .voice_cost import VoiceCost + from .voice_library import VoiceLibrary + from .voice_library_gender import VoiceLibraryGender + from .voice_library_voice_response import VoiceLibraryVoiceResponse + from .voicemail_detection_backoff_plan import VoicemailDetectionBackoffPlan + from .voicemail_detection_cost import VoicemailDetectionCost + from .voicemail_detection_cost_provider import VoicemailDetectionCostProvider + from .vonage_credential import VonageCredential + from .vonage_phone_number import VonagePhoneNumber + from .vonage_phone_number_fallback_destination import VonagePhoneNumberFallbackDestination + from .vonage_phone_number_hooks_item import VonagePhoneNumberHooksItem + from .vonage_phone_number_status import VonagePhoneNumberStatus + from .web_chat import WebChat + from .web_chat_output_item import WebChatOutputItem + from .webhook_credential import WebhookCredential + from .webhook_credential_authentication_plan import WebhookCredentialAuthenticationPlan + from .workflow import Workflow + from .workflow_anthropic_model import WorkflowAnthropicModel + from .workflow_anthropic_model_model import WorkflowAnthropicModelModel + from .workflow_background_sound import WorkflowBackgroundSound + from .workflow_background_sound_zero import WorkflowBackgroundSoundZero + from .workflow_credentials_item import WorkflowCredentialsItem + from .workflow_custom_model import WorkflowCustomModel + from .workflow_custom_model_metadata_send_mode import WorkflowCustomModelMetadataSendMode + from .workflow_google_model import WorkflowGoogleModel + from .workflow_google_model_model import WorkflowGoogleModelModel + from .workflow_hooks_item import WorkflowHooksItem + from .workflow_model import WorkflowModel + from .workflow_nodes_item import WorkflowNodesItem + from .workflow_open_ai_model import WorkflowOpenAiModel + from .workflow_open_ai_model_model import WorkflowOpenAiModelModel + from .workflow_overrides import WorkflowOverrides + from .workflow_transcriber import WorkflowTranscriber + from .workflow_user_editable import WorkflowUserEditable + from .workflow_user_editable_background_sound import WorkflowUserEditableBackgroundSound + from .workflow_user_editable_background_sound_zero import WorkflowUserEditableBackgroundSoundZero + from .workflow_user_editable_credentials_item import WorkflowUserEditableCredentialsItem + from .workflow_user_editable_hooks_item import WorkflowUserEditableHooksItem + from .workflow_user_editable_model import WorkflowUserEditableModel + from .workflow_user_editable_nodes_item import WorkflowUserEditableNodesItem + from .workflow_user_editable_transcriber import WorkflowUserEditableTranscriber + from .workflow_user_editable_voice import WorkflowUserEditableVoice + from .workflow_voice import WorkflowVoice + from .x_ai_credential import XAiCredential + from .xai_model import XaiModel + from .xai_model_model import XaiModelModel + from .xai_model_tools_item import XaiModelToolsItem + from .xss_security_filter import XssSecurityFilter +_dynamic_imports: typing.Dict[str, str] = { + "AddVoiceToProviderDto": ".add_voice_to_provider_dto", + "AiEdgeCondition": ".ai_edge_condition", + "Analysis": ".analysis", + "AnalysisCost": ".analysis_cost", + "AnalysisCostAnalysisType": ".analysis_cost_analysis_type", + "AnalysisCostBreakdown": ".analysis_cost_breakdown", + "AnalysisPlan": ".analysis_plan", + "AnalyticsOperation": ".analytics_operation", + "AnalyticsOperationColumn": ".analytics_operation_column", + "AnalyticsOperationOperation": ".analytics_operation_operation", + "AnalyticsQuery": ".analytics_query", + "AnalyticsQueryGroupByItem": ".analytics_query_group_by_item", + "AnalyticsQueryResult": ".analytics_query_result", + "AnalyticsQueryTable": ".analytics_query_table", + "AnthropicCredential": ".anthropic_credential", + "AnthropicModel": ".anthropic_model", + "AnthropicModelModel": ".anthropic_model_model", + "AnthropicModelToolsItem": ".anthropic_model_tools_item", + "AnthropicThinkingConfig": ".anthropic_thinking_config", + "AnyscaleCredential": ".anyscale_credential", + "AnyscaleModel": ".anyscale_model", + "AnyscaleModelToolsItem": ".anyscale_model_tools_item", + "ApiRequestTool": ".api_request_tool", + "ApiRequestToolMessagesItem": ".api_request_tool_messages_item", + "ApiRequestToolMethod": ".api_request_tool_method", + "Artifact": ".artifact", + "ArtifactMessagesItem": ".artifact_messages_item", + "ArtifactPlan": ".artifact_plan", + "ArtifactPlanRecordingFormat": ".artifact_plan_recording_format", + "AssemblyAiCredential": ".assembly_ai_credential", + "AssemblyAiTranscriber": ".assembly_ai_transcriber", + "Assistant": ".assistant", + "AssistantBackgroundSound": ".assistant_background_sound", + "AssistantBackgroundSoundZero": ".assistant_background_sound_zero", + "AssistantClientMessagesItem": ".assistant_client_messages_item", + "AssistantCredentialsItem": ".assistant_credentials_item", + "AssistantCustomEndpointingRule": ".assistant_custom_endpointing_rule", + "AssistantFirstMessageMode": ".assistant_first_message_mode", + "AssistantHookAssistantSpeechInterrupted": ".assistant_hook_assistant_speech_interrupted", + "AssistantHookCallEnding": ".assistant_hook_call_ending", + "AssistantHookCustomerSpeechInterrupted": ".assistant_hook_customer_speech_interrupted", + "AssistantHooksItem": ".assistant_hooks_item", + "AssistantMessage": ".assistant_message", + "AssistantModel": ".assistant_model", + "AssistantOverrides": ".assistant_overrides", + "AssistantOverridesBackgroundSound": ".assistant_overrides_background_sound", + "AssistantOverridesBackgroundSoundZero": ".assistant_overrides_background_sound_zero", + "AssistantOverridesClientMessagesItem": ".assistant_overrides_client_messages_item", + "AssistantOverridesCredentialsItem": ".assistant_overrides_credentials_item", + "AssistantOverridesFirstMessageMode": ".assistant_overrides_first_message_mode", + "AssistantOverridesHooksItem": ".assistant_overrides_hooks_item", + "AssistantOverridesModel": ".assistant_overrides_model", + "AssistantOverridesServerMessagesItem": ".assistant_overrides_server_messages_item", + "AssistantOverridesTranscriber": ".assistant_overrides_transcriber", + "AssistantOverridesVoice": ".assistant_overrides_voice", + "AssistantOverridesVoicemailDetection": ".assistant_overrides_voicemail_detection", + "AssistantPaginatedResponse": ".assistant_paginated_response", + "AssistantServerMessagesItem": ".assistant_server_messages_item", + "AssistantTranscriber": ".assistant_transcriber", + "AssistantUserEditable": ".assistant_user_editable", + "AssistantVersionPaginatedResponse": ".assistant_version_paginated_response", + "AssistantVoice": ".assistant_voice", + "AssistantVoicemailDetection": ".assistant_voicemail_detection", + "AutoReloadPlan": ".auto_reload_plan", + "AzureBlobStorageBucketPlan": ".azure_blob_storage_bucket_plan", + "AzureCredential": ".azure_credential", + "AzureCredentialRegion": ".azure_credential_region", + "AzureCredentialService": ".azure_credential_service", + "AzureOpenAiCredential": ".azure_open_ai_credential", + "AzureOpenAiCredentialModelsItem": ".azure_open_ai_credential_models_item", + "AzureOpenAiCredentialRegion": ".azure_open_ai_credential_region", + "AzureSpeechTranscriber": ".azure_speech_transcriber", + "AzureSpeechTranscriberLanguage": ".azure_speech_transcriber_language", + "AzureSpeechTranscriberSegmentationStrategy": ".azure_speech_transcriber_segmentation_strategy", + "AzureVoice": ".azure_voice", + "AzureVoiceId": ".azure_voice_id", + "AzureVoiceIdEnum": ".azure_voice_id_enum", + "BackgroundSpeechDenoisingPlan": ".background_speech_denoising_plan", + "BackoffPlan": ".backoff_plan", + "BashTool": ".bash_tool", + "BashToolMessagesItem": ".bash_tool_messages_item", + "BashToolWithToolCall": ".bash_tool_with_tool_call", + "BashToolWithToolCallMessagesItem": ".bash_tool_with_tool_call_messages_item", + "BearerAuthenticationPlan": ".bearer_authentication_plan", + "BotMessage": ".bot_message", + "BothCustomEndpointingRule": ".both_custom_endpointing_rule", + "BucketPlan": ".bucket_plan", + "ByoPhoneNumber": ".byo_phone_number", + "ByoPhoneNumberFallbackDestination": ".byo_phone_number_fallback_destination", + "ByoPhoneNumberHooksItem": ".byo_phone_number_hooks_item", + "ByoPhoneNumberStatus": ".byo_phone_number_status", + "ByoSipTrunkCredential": ".byo_sip_trunk_credential", + "Call": ".call", + "CallBatchError": ".call_batch_error", + "CallBatchResponse": ".call_batch_response", + "CallCostsItem": ".call_costs_item", + "CallDestination": ".call_destination", + "CallEndedReason": ".call_ended_reason", + "CallHookAssistantSpeechInterrupted": ".call_hook_assistant_speech_interrupted", + "CallHookAssistantSpeechInterruptedDoItem": ".call_hook_assistant_speech_interrupted_do_item", + "CallHookCallEnding": ".call_hook_call_ending", + "CallHookCustomerSpeechInterrupted": ".call_hook_customer_speech_interrupted", + "CallHookCustomerSpeechInterruptedDoItem": ".call_hook_customer_speech_interrupted_do_item", + "CallHookCustomerSpeechTimeout": ".call_hook_customer_speech_timeout", + "CallHookCustomerSpeechTimeoutDoItem": ".call_hook_customer_speech_timeout_do_item", + "CallHookFilter": ".call_hook_filter", + "CallMessagesItem": ".call_messages_item", + "CallPaginatedResponse": ".call_paginated_response", + "CallPhoneCallProvider": ".call_phone_call_provider", + "CallPhoneCallTransport": ".call_phone_call_transport", + "CallStatus": ".call_status", + "CallType": ".call_type", + "Campaign": ".campaign", + "CampaignEndedReason": ".campaign_ended_reason", + "CampaignPaginatedResponse": ".campaign_paginated_response", + "CampaignStatus": ".campaign_status", + "CartesiaCredential": ".cartesia_credential", + "CartesiaExperimentalControls": ".cartesia_experimental_controls", + "CartesiaExperimentalControlsEmotion": ".cartesia_experimental_controls_emotion", + "CartesiaExperimentalControlsSpeed": ".cartesia_experimental_controls_speed", + "CartesiaSpeedControl": ".cartesia_speed_control", + "CartesiaTranscriber": ".cartesia_transcriber", + "CartesiaTranscriberLanguage": ".cartesia_transcriber_language", + "CartesiaVoice": ".cartesia_voice", + "CartesiaVoiceLanguage": ".cartesia_voice_language", + "CartesiaVoiceModel": ".cartesia_voice_model", + "CerebrasCredential": ".cerebras_credential", + "CerebrasModel": ".cerebras_model", + "CerebrasModelModel": ".cerebras_model_model", + "CerebrasModelToolsItem": ".cerebras_model_tools_item", + "Chat": ".chat", + "ChatAssistantOverrides": ".chat_assistant_overrides", + "ChatCost": ".chat_cost", + "ChatCostsItem": ".chat_costs_item", + "ChatInput": ".chat_input", + "ChatInputItem": ".chat_input_item", + "ChatMessagesItem": ".chat_messages_item", + "ChatOutputItem": ".chat_output_item", + "ChatPaginatedResponse": ".chat_paginated_response", + "ChunkPlan": ".chunk_plan", + "ClientInboundMessage": ".client_inbound_message", + "ClientInboundMessageAddMessage": ".client_inbound_message_add_message", + "ClientInboundMessageControl": ".client_inbound_message_control", + "ClientInboundMessageControlControl": ".client_inbound_message_control_control", + "ClientInboundMessageEndCall": ".client_inbound_message_end_call", + "ClientInboundMessageMessage": ".client_inbound_message_message", + "ClientInboundMessageSay": ".client_inbound_message_say", + "ClientInboundMessageTransfer": ".client_inbound_message_transfer", + "ClientInboundMessageTransferDestination": ".client_inbound_message_transfer_destination", + "ClientMessage": ".client_message", + "ClientMessageChatCreated": ".client_message_chat_created", + "ClientMessageChatCreatedPhoneNumber": ".client_message_chat_created_phone_number", + "ClientMessageChatDeleted": ".client_message_chat_deleted", + "ClientMessageChatDeletedPhoneNumber": ".client_message_chat_deleted_phone_number", + "ClientMessageConversationUpdate": ".client_message_conversation_update", + "ClientMessageConversationUpdateMessagesItem": ".client_message_conversation_update_messages_item", + "ClientMessageConversationUpdatePhoneNumber": ".client_message_conversation_update_phone_number", + "ClientMessageHang": ".client_message_hang", + "ClientMessageHangPhoneNumber": ".client_message_hang_phone_number", + "ClientMessageLanguageChangeDetected": ".client_message_language_change_detected", + "ClientMessageLanguageChangeDetectedPhoneNumber": ".client_message_language_change_detected_phone_number", + "ClientMessageMessage": ".client_message_message", + "ClientMessageMetadata": ".client_message_metadata", + "ClientMessageMetadataPhoneNumber": ".client_message_metadata_phone_number", + "ClientMessageModelOutput": ".client_message_model_output", + "ClientMessageModelOutputPhoneNumber": ".client_message_model_output_phone_number", + "ClientMessageSessionCreated": ".client_message_session_created", + "ClientMessageSessionCreatedPhoneNumber": ".client_message_session_created_phone_number", + "ClientMessageSessionDeleted": ".client_message_session_deleted", + "ClientMessageSessionDeletedPhoneNumber": ".client_message_session_deleted_phone_number", + "ClientMessageSessionUpdated": ".client_message_session_updated", + "ClientMessageSessionUpdatedPhoneNumber": ".client_message_session_updated_phone_number", + "ClientMessageSpeechUpdate": ".client_message_speech_update", + "ClientMessageSpeechUpdatePhoneNumber": ".client_message_speech_update_phone_number", + "ClientMessageSpeechUpdateRole": ".client_message_speech_update_role", + "ClientMessageSpeechUpdateStatus": ".client_message_speech_update_status", + "ClientMessageToolCalls": ".client_message_tool_calls", + "ClientMessageToolCallsPhoneNumber": ".client_message_tool_calls_phone_number", + "ClientMessageToolCallsResult": ".client_message_tool_calls_result", + "ClientMessageToolCallsResultPhoneNumber": ".client_message_tool_calls_result_phone_number", + "ClientMessageToolCallsToolWithToolCallListItem": ".client_message_tool_calls_tool_with_tool_call_list_item", + "ClientMessageTranscript": ".client_message_transcript", + "ClientMessageTranscriptPhoneNumber": ".client_message_transcript_phone_number", + "ClientMessageTranscriptRole": ".client_message_transcript_role", + "ClientMessageTranscriptTranscriptType": ".client_message_transcript_transcript_type", + "ClientMessageTranscriptType": ".client_message_transcript_type", + "ClientMessageTransferUpdate": ".client_message_transfer_update", + "ClientMessageTransferUpdateDestination": ".client_message_transfer_update_destination", + "ClientMessageTransferUpdatePhoneNumber": ".client_message_transfer_update_phone_number", + "ClientMessageUserInterrupted": ".client_message_user_interrupted", + "ClientMessageUserInterruptedPhoneNumber": ".client_message_user_interrupted_phone_number", + "ClientMessageVoiceInput": ".client_message_voice_input", + "ClientMessageVoiceInputPhoneNumber": ".client_message_voice_input_phone_number", + "ClientMessageWorkflowNodeStarted": ".client_message_workflow_node_started", + "ClientMessageWorkflowNodeStartedPhoneNumber": ".client_message_workflow_node_started_phone_number", + "CloneVoiceDto": ".clone_voice_dto", + "CloudflareCredential": ".cloudflare_credential", + "CloudflareR2BucketPlan": ".cloudflare_r_2_bucket_plan", + "CompliancePlan": ".compliance_plan", + "ComputerTool": ".computer_tool", + "ComputerToolMessagesItem": ".computer_tool_messages_item", + "ComputerToolWithToolCall": ".computer_tool_with_tool_call", + "ComputerToolWithToolCallMessagesItem": ".computer_tool_with_tool_call_messages_item", + "Condition": ".condition", + "ConditionOperator": ".condition_operator", + "ContextEngineeringPlanAll": ".context_engineering_plan_all", + "ContextEngineeringPlanLastNMessages": ".context_engineering_plan_last_n_messages", + "ContextEngineeringPlanNone": ".context_engineering_plan_none", + "ConversationNode": ".conversation_node", + "ConversationNodeModel": ".conversation_node_model", + "ConversationNodeToolsItem": ".conversation_node_tools_item", + "ConversationNodeTranscriber": ".conversation_node_transcriber", + "ConversationNodeVoice": ".conversation_node_voice", + "CostBreakdown": ".cost_breakdown", + "CreateAnthropicCredentialDto": ".create_anthropic_credential_dto", + "CreateAnyscaleCredentialDto": ".create_anyscale_credential_dto", + "CreateApiRequestToolDto": ".create_api_request_tool_dto", + "CreateApiRequestToolDtoMessagesItem": ".create_api_request_tool_dto_messages_item", + "CreateApiRequestToolDtoMethod": ".create_api_request_tool_dto_method", + "CreateAssemblyAiCredentialDto": ".create_assembly_ai_credential_dto", + "CreateAssistantDto": ".create_assistant_dto", + "CreateAssistantDtoBackgroundSound": ".create_assistant_dto_background_sound", + "CreateAssistantDtoBackgroundSoundZero": ".create_assistant_dto_background_sound_zero", + "CreateAssistantDtoClientMessagesItem": ".create_assistant_dto_client_messages_item", + "CreateAssistantDtoCredentialsItem": ".create_assistant_dto_credentials_item", + "CreateAssistantDtoFirstMessageMode": ".create_assistant_dto_first_message_mode", + "CreateAssistantDtoHooksItem": ".create_assistant_dto_hooks_item", + "CreateAssistantDtoModel": ".create_assistant_dto_model", + "CreateAssistantDtoServerMessagesItem": ".create_assistant_dto_server_messages_item", + "CreateAssistantDtoTranscriber": ".create_assistant_dto_transcriber", + "CreateAssistantDtoVoice": ".create_assistant_dto_voice", + "CreateAssistantDtoVoicemailDetection": ".create_assistant_dto_voicemail_detection", + "CreateAzureCredentialDto": ".create_azure_credential_dto", + "CreateAzureCredentialDtoRegion": ".create_azure_credential_dto_region", + "CreateAzureCredentialDtoService": ".create_azure_credential_dto_service", + "CreateAzureOpenAiCredentialDto": ".create_azure_open_ai_credential_dto", + "CreateAzureOpenAiCredentialDtoModelsItem": ".create_azure_open_ai_credential_dto_models_item", + "CreateAzureOpenAiCredentialDtoRegion": ".create_azure_open_ai_credential_dto_region", + "CreateBashToolDto": ".create_bash_tool_dto", + "CreateBashToolDtoMessagesItem": ".create_bash_tool_dto_messages_item", + "CreateByoPhoneNumberDto": ".create_byo_phone_number_dto", + "CreateByoPhoneNumberDtoFallbackDestination": ".create_byo_phone_number_dto_fallback_destination", + "CreateByoPhoneNumberDtoHooksItem": ".create_byo_phone_number_dto_hooks_item", + "CreateByoSipTrunkCredentialDto": ".create_byo_sip_trunk_credential_dto", + "CreateCartesiaCredentialDto": ".create_cartesia_credential_dto", + "CreateCerebrasCredentialDto": ".create_cerebras_credential_dto", + "CreateChatStreamResponse": ".create_chat_stream_response", + "CreateCloudflareCredentialDto": ".create_cloudflare_credential_dto", + "CreateComputerToolDto": ".create_computer_tool_dto", + "CreateComputerToolDtoMessagesItem": ".create_computer_tool_dto_messages_item", + "CreateCustomCredentialDto": ".create_custom_credential_dto", + "CreateCustomCredentialDtoAuthenticationPlan": ".create_custom_credential_dto_authentication_plan", + "CreateCustomKnowledgeBaseDto": ".create_custom_knowledge_base_dto", + "CreateCustomLlmCredentialDto": ".create_custom_llm_credential_dto", + "CreateCustomerDto": ".create_customer_dto", + "CreateDeepInfraCredentialDto": ".create_deep_infra_credential_dto", + "CreateDeepSeekCredentialDto": ".create_deep_seek_credential_dto", + "CreateDeepgramCredentialDto": ".create_deepgram_credential_dto", + "CreateDtmfToolDto": ".create_dtmf_tool_dto", + "CreateDtmfToolDtoMessagesItem": ".create_dtmf_tool_dto_messages_item", + "CreateElevenLabsCredentialDto": ".create_eleven_labs_credential_dto", + "CreateEndCallToolDto": ".create_end_call_tool_dto", + "CreateEndCallToolDtoMessagesItem": ".create_end_call_tool_dto_messages_item", + "CreateFunctionToolDto": ".create_function_tool_dto", + "CreateFunctionToolDtoMessagesItem": ".create_function_tool_dto_messages_item", + "CreateGcpCredentialDto": ".create_gcp_credential_dto", + "CreateGhlToolDto": ".create_ghl_tool_dto", + "CreateGhlToolDtoMessagesItem": ".create_ghl_tool_dto_messages_item", + "CreateGladiaCredentialDto": ".create_gladia_credential_dto", + "CreateGoHighLevelCalendarAvailabilityToolDto": ".create_go_high_level_calendar_availability_tool_dto", + "CreateGoHighLevelCalendarAvailabilityToolDtoMessagesItem": ".create_go_high_level_calendar_availability_tool_dto_messages_item", + "CreateGoHighLevelCalendarEventCreateToolDto": ".create_go_high_level_calendar_event_create_tool_dto", + "CreateGoHighLevelCalendarEventCreateToolDtoMessagesItem": ".create_go_high_level_calendar_event_create_tool_dto_messages_item", + "CreateGoHighLevelContactCreateToolDto": ".create_go_high_level_contact_create_tool_dto", + "CreateGoHighLevelContactCreateToolDtoMessagesItem": ".create_go_high_level_contact_create_tool_dto_messages_item", + "CreateGoHighLevelContactGetToolDto": ".create_go_high_level_contact_get_tool_dto", + "CreateGoHighLevelContactGetToolDtoMessagesItem": ".create_go_high_level_contact_get_tool_dto_messages_item", + "CreateGoHighLevelCredentialDto": ".create_go_high_level_credential_dto", + "CreateGoHighLevelMcpCredentialDto": ".create_go_high_level_mcp_credential_dto", + "CreateGoogleCalendarCheckAvailabilityToolDto": ".create_google_calendar_check_availability_tool_dto", + "CreateGoogleCalendarCheckAvailabilityToolDtoMessagesItem": ".create_google_calendar_check_availability_tool_dto_messages_item", + "CreateGoogleCalendarCreateEventToolDto": ".create_google_calendar_create_event_tool_dto", + "CreateGoogleCalendarCreateEventToolDtoMessagesItem": ".create_google_calendar_create_event_tool_dto_messages_item", + "CreateGoogleCalendarOAuth2AuthorizationCredentialDto": ".create_google_calendar_o_auth_2_authorization_credential_dto", + "CreateGoogleCalendarOAuth2ClientCredentialDto": ".create_google_calendar_o_auth_2_client_credential_dto", + "CreateGoogleCredentialDto": ".create_google_credential_dto", + "CreateGoogleSheetsOAuth2AuthorizationCredentialDto": ".create_google_sheets_o_auth_2_authorization_credential_dto", + "CreateGoogleSheetsRowAppendToolDto": ".create_google_sheets_row_append_tool_dto", + "CreateGoogleSheetsRowAppendToolDtoMessagesItem": ".create_google_sheets_row_append_tool_dto_messages_item", + "CreateGroqCredentialDto": ".create_groq_credential_dto", + "CreateHandoffToolDto": ".create_handoff_tool_dto", + "CreateHandoffToolDtoDestinationsItem": ".create_handoff_tool_dto_destinations_item", + "CreateHandoffToolDtoMessagesItem": ".create_handoff_tool_dto_messages_item", + "CreateHumeCredentialDto": ".create_hume_credential_dto", + "CreateInflectionAiCredentialDto": ".create_inflection_ai_credential_dto", + "CreateInworldCredentialDto": ".create_inworld_credential_dto", + "CreateLangfuseCredentialDto": ".create_langfuse_credential_dto", + "CreateLmntCredentialDto": ".create_lmnt_credential_dto", + "CreateMakeCredentialDto": ".create_make_credential_dto", + "CreateMakeToolDto": ".create_make_tool_dto", + "CreateMakeToolDtoMessagesItem": ".create_make_tool_dto_messages_item", + "CreateMcpToolDto": ".create_mcp_tool_dto", + "CreateMcpToolDtoMessagesItem": ".create_mcp_tool_dto_messages_item", + "CreateMinimaxCredentialDto": ".create_minimax_credential_dto", + "CreateMistralCredentialDto": ".create_mistral_credential_dto", + "CreateNeuphonicCredentialDto": ".create_neuphonic_credential_dto", + "CreateOpenAiCredentialDto": ".create_open_ai_credential_dto", + "CreateOpenRouterCredentialDto": ".create_open_router_credential_dto", + "CreateOrgDto": ".create_org_dto", + "CreateOrgDtoChannel": ".create_org_dto_channel", + "CreateOutboundCallDto": ".create_outbound_call_dto", + "CreateOutputToolDto": ".create_output_tool_dto", + "CreateOutputToolDtoMessagesItem": ".create_output_tool_dto_messages_item", + "CreatePerplexityAiCredentialDto": ".create_perplexity_ai_credential_dto", + "CreatePlayHtCredentialDto": ".create_play_ht_credential_dto", + "CreateQueryToolDto": ".create_query_tool_dto", + "CreateQueryToolDtoMessagesItem": ".create_query_tool_dto_messages_item", + "CreateRimeAiCredentialDto": ".create_rime_ai_credential_dto", + "CreateRunpodCredentialDto": ".create_runpod_credential_dto", + "CreateS3CredentialDto": ".create_s_3_credential_dto", + "CreateSesameVoiceDto": ".create_sesame_voice_dto", + "CreateSlackOAuth2AuthorizationCredentialDto": ".create_slack_o_auth_2_authorization_credential_dto", + "CreateSlackSendMessageToolDto": ".create_slack_send_message_tool_dto", + "CreateSlackSendMessageToolDtoMessagesItem": ".create_slack_send_message_tool_dto_messages_item", + "CreateSmallestAiCredentialDto": ".create_smallest_ai_credential_dto", + "CreateSmsToolDto": ".create_sms_tool_dto", + "CreateSmsToolDtoMessagesItem": ".create_sms_tool_dto_messages_item", + "CreateSpeechmaticsCredentialDto": ".create_speechmatics_credential_dto", + "CreateSquadDto": ".create_squad_dto", + "CreateSupabaseCredentialDto": ".create_supabase_credential_dto", + "CreateTavusCredentialDto": ".create_tavus_credential_dto", + "CreateTelnyxPhoneNumberDto": ".create_telnyx_phone_number_dto", + "CreateTelnyxPhoneNumberDtoFallbackDestination": ".create_telnyx_phone_number_dto_fallback_destination", + "CreateTelnyxPhoneNumberDtoHooksItem": ".create_telnyx_phone_number_dto_hooks_item", + "CreateTestSuiteDto": ".create_test_suite_dto", + "CreateTestSuiteRunDto": ".create_test_suite_run_dto", + "CreateTestSuiteTestChatDto": ".create_test_suite_test_chat_dto", + "CreateTestSuiteTestVoiceDto": ".create_test_suite_test_voice_dto", + "CreateTextEditorToolDto": ".create_text_editor_tool_dto", + "CreateTextEditorToolDtoMessagesItem": ".create_text_editor_tool_dto_messages_item", + "CreateTogetherAiCredentialDto": ".create_together_ai_credential_dto", + "CreateTokenDto": ".create_token_dto", + "CreateTokenDtoTag": ".create_token_dto_tag", + "CreateToolTemplateDto": ".create_tool_template_dto", + "CreateToolTemplateDtoDetails": ".create_tool_template_dto_details", + "CreateToolTemplateDtoProvider": ".create_tool_template_dto_provider", + "CreateToolTemplateDtoProviderDetails": ".create_tool_template_dto_provider_details", + "CreateToolTemplateDtoVisibility": ".create_tool_template_dto_visibility", + "CreateTransferCallToolDto": ".create_transfer_call_tool_dto", + "CreateTransferCallToolDtoDestinationsItem": ".create_transfer_call_tool_dto_destinations_item", + "CreateTransferCallToolDtoMessagesItem": ".create_transfer_call_tool_dto_messages_item", + "CreateTrieveCredentialDto": ".create_trieve_credential_dto", + "CreateTrieveKnowledgeBaseDto": ".create_trieve_knowledge_base_dto", + "CreateTwilioCredentialDto": ".create_twilio_credential_dto", + "CreateTwilioPhoneNumberDto": ".create_twilio_phone_number_dto", + "CreateTwilioPhoneNumberDtoFallbackDestination": ".create_twilio_phone_number_dto_fallback_destination", + "CreateTwilioPhoneNumberDtoHooksItem": ".create_twilio_phone_number_dto_hooks_item", + "CreateVapiPhoneNumberDto": ".create_vapi_phone_number_dto", + "CreateVapiPhoneNumberDtoFallbackDestination": ".create_vapi_phone_number_dto_fallback_destination", + "CreateVapiPhoneNumberDtoHooksItem": ".create_vapi_phone_number_dto_hooks_item", + "CreateVoicemailToolDto": ".create_voicemail_tool_dto", + "CreateVoicemailToolDtoMessagesItem": ".create_voicemail_tool_dto_messages_item", + "CreateVonageCredentialDto": ".create_vonage_credential_dto", + "CreateVonagePhoneNumberDto": ".create_vonage_phone_number_dto", + "CreateVonagePhoneNumberDtoFallbackDestination": ".create_vonage_phone_number_dto_fallback_destination", + "CreateVonagePhoneNumberDtoHooksItem": ".create_vonage_phone_number_dto_hooks_item", + "CreateWebCallDto": ".create_web_call_dto", + "CreateWebChatDto": ".create_web_chat_dto", + "CreateWebChatDtoInput": ".create_web_chat_dto_input", + "CreateWebChatDtoInputItem": ".create_web_chat_dto_input_item", + "CreateWebCustomerDto": ".create_web_customer_dto", + "CreateWebhookCredentialDto": ".create_webhook_credential_dto", + "CreateWebhookCredentialDtoAuthenticationPlan": ".create_webhook_credential_dto_authentication_plan", + "CreateWorkflowDto": ".create_workflow_dto", + "CreateWorkflowDtoBackgroundSound": ".create_workflow_dto_background_sound", + "CreateWorkflowDtoBackgroundSoundZero": ".create_workflow_dto_background_sound_zero", + "CreateWorkflowDtoCredentialsItem": ".create_workflow_dto_credentials_item", + "CreateWorkflowDtoHooksItem": ".create_workflow_dto_hooks_item", + "CreateWorkflowDtoModel": ".create_workflow_dto_model", + "CreateWorkflowDtoNodesItem": ".create_workflow_dto_nodes_item", + "CreateWorkflowDtoTranscriber": ".create_workflow_dto_transcriber", + "CreateWorkflowDtoVoice": ".create_workflow_dto_voice", + "CreateXAiCredentialDto": ".create_x_ai_credential_dto", + "CredentialActionRequest": ".credential_action_request", + "CredentialEndUser": ".credential_end_user", + "CredentialSessionDto": ".credential_session_dto", + "CredentialSessionDtoProvider": ".credential_session_dto_provider", + "CredentialSessionError": ".credential_session_error", + "CredentialSessionResponse": ".credential_session_response", + "CredentialWebhookDto": ".credential_webhook_dto", + "CredentialWebhookDtoAuthMode": ".credential_webhook_dto_auth_mode", + "CredentialWebhookDtoOperation": ".credential_webhook_dto_operation", + "CredentialWebhookDtoType": ".credential_webhook_dto_type", + "CustomCredential": ".custom_credential", + "CustomCredentialAuthenticationPlan": ".custom_credential_authentication_plan", + "CustomEndpointingModelSmartEndpointingPlan": ".custom_endpointing_model_smart_endpointing_plan", + "CustomEndpointingModelSmartEndpointingPlanProvider": ".custom_endpointing_model_smart_endpointing_plan_provider", + "CustomKnowledgeBase": ".custom_knowledge_base", + "CustomLlmCredential": ".custom_llm_credential", + "CustomLlmModel": ".custom_llm_model", + "CustomLlmModelMetadataSendMode": ".custom_llm_model_metadata_send_mode", + "CustomLlmModelToolsItem": ".custom_llm_model_tools_item", + "CustomMessage": ".custom_message", + "CustomTranscriber": ".custom_transcriber", + "CustomVoice": ".custom_voice", + "CustomerCustomEndpointingRule": ".customer_custom_endpointing_rule", + "CustomerSpeechTimeoutOptions": ".customer_speech_timeout_options", + "DeepInfraCredential": ".deep_infra_credential", + "DeepInfraModel": ".deep_infra_model", + "DeepInfraModelToolsItem": ".deep_infra_model_tools_item", + "DeepSeekCredential": ".deep_seek_credential", + "DeepSeekModel": ".deep_seek_model", + "DeepSeekModelModel": ".deep_seek_model_model", + "DeepSeekModelToolsItem": ".deep_seek_model_tools_item", + "DeepgramCredential": ".deepgram_credential", + "DeepgramTranscriber": ".deepgram_transcriber", + "DeepgramTranscriberLanguage": ".deepgram_transcriber_language", + "DeepgramTranscriberModel": ".deepgram_transcriber_model", + "DeepgramVoice": ".deepgram_voice", + "DeepgramVoiceId": ".deepgram_voice_id", + "DeepgramVoiceModel": ".deepgram_voice_model", + "DeveloperMessage": ".developer_message", + "DtmfTool": ".dtmf_tool", + "DtmfToolMessagesItem": ".dtmf_tool_messages_item", + "Edge": ".edge", + "ElevenLabsCredential": ".eleven_labs_credential", + "ElevenLabsPronunciationDictionary": ".eleven_labs_pronunciation_dictionary", + "ElevenLabsPronunciationDictionaryLocator": ".eleven_labs_pronunciation_dictionary_locator", + "ElevenLabsPronunciationDictionaryPermissionOnResource": ".eleven_labs_pronunciation_dictionary_permission_on_resource", + "ElevenLabsTranscriber": ".eleven_labs_transcriber", + "ElevenLabsTranscriberLanguage": ".eleven_labs_transcriber_language", + "ElevenLabsVoice": ".eleven_labs_voice", + "ElevenLabsVoiceId": ".eleven_labs_voice_id", + "ElevenLabsVoiceIdEnum": ".eleven_labs_voice_id_enum", + "ElevenLabsVoiceModel": ".eleven_labs_voice_model", + "EndCallTool": ".end_call_tool", + "EndCallToolMessagesItem": ".end_call_tool_messages_item", + "ExactReplacement": ".exact_replacement", + "FailedEdgeCondition": ".failed_edge_condition", + "FallbackAssemblyAiTranscriber": ".fallback_assembly_ai_transcriber", + "FallbackAzureSpeechTranscriber": ".fallback_azure_speech_transcriber", + "FallbackAzureSpeechTranscriberLanguage": ".fallback_azure_speech_transcriber_language", + "FallbackAzureSpeechTranscriberSegmentationStrategy": ".fallback_azure_speech_transcriber_segmentation_strategy", + "FallbackAzureVoice": ".fallback_azure_voice", + "FallbackAzureVoiceId": ".fallback_azure_voice_id", + "FallbackAzureVoiceVoiceId": ".fallback_azure_voice_voice_id", + "FallbackCartesiaTranscriber": ".fallback_cartesia_transcriber", + "FallbackCartesiaTranscriberLanguage": ".fallback_cartesia_transcriber_language", + "FallbackCartesiaVoice": ".fallback_cartesia_voice", + "FallbackCartesiaVoiceLanguage": ".fallback_cartesia_voice_language", + "FallbackCartesiaVoiceModel": ".fallback_cartesia_voice_model", + "FallbackCustomTranscriber": ".fallback_custom_transcriber", + "FallbackCustomVoice": ".fallback_custom_voice", + "FallbackDeepgramTranscriber": ".fallback_deepgram_transcriber", + "FallbackDeepgramTranscriberLanguage": ".fallback_deepgram_transcriber_language", + "FallbackDeepgramTranscriberModel": ".fallback_deepgram_transcriber_model", + "FallbackDeepgramVoice": ".fallback_deepgram_voice", + "FallbackDeepgramVoiceId": ".fallback_deepgram_voice_id", + "FallbackDeepgramVoiceModel": ".fallback_deepgram_voice_model", + "FallbackElevenLabsTranscriber": ".fallback_eleven_labs_transcriber", + "FallbackElevenLabsTranscriberLanguage": ".fallback_eleven_labs_transcriber_language", + "FallbackElevenLabsVoice": ".fallback_eleven_labs_voice", + "FallbackElevenLabsVoiceId": ".fallback_eleven_labs_voice_id", + "FallbackElevenLabsVoiceIdEnum": ".fallback_eleven_labs_voice_id_enum", + "FallbackElevenLabsVoiceModel": ".fallback_eleven_labs_voice_model", + "FallbackGladiaTranscriber": ".fallback_gladia_transcriber", + "FallbackGladiaTranscriberLanguage": ".fallback_gladia_transcriber_language", + "FallbackGladiaTranscriberLanguageBehaviour": ".fallback_gladia_transcriber_language_behaviour", + "FallbackGladiaTranscriberLanguages": ".fallback_gladia_transcriber_languages", + "FallbackGladiaTranscriberModel": ".fallback_gladia_transcriber_model", + "FallbackGoogleTranscriber": ".fallback_google_transcriber", + "FallbackGoogleTranscriberLanguage": ".fallback_google_transcriber_language", + "FallbackGoogleTranscriberModel": ".fallback_google_transcriber_model", + "FallbackHumeVoice": ".fallback_hume_voice", + "FallbackInworldVoice": ".fallback_inworld_voice", + "FallbackInworldVoiceLanguageCode": ".fallback_inworld_voice_language_code", + "FallbackInworldVoiceVoiceId": ".fallback_inworld_voice_voice_id", + "FallbackLmntVoice": ".fallback_lmnt_voice", + "FallbackLmntVoiceId": ".fallback_lmnt_voice_id", + "FallbackLmntVoiceIdEnum": ".fallback_lmnt_voice_id_enum", + "FallbackLmntVoiceLanguage": ".fallback_lmnt_voice_language", + "FallbackMinimaxVoice": ".fallback_minimax_voice", + "FallbackMinimaxVoiceModel": ".fallback_minimax_voice_model", + "FallbackMinimaxVoiceRegion": ".fallback_minimax_voice_region", + "FallbackNeetsVoice": ".fallback_neets_voice", + "FallbackNeuphonicVoice": ".fallback_neuphonic_voice", + "FallbackNeuphonicVoiceModel": ".fallback_neuphonic_voice_model", + "FallbackOpenAiTranscriber": ".fallback_open_ai_transcriber", + "FallbackOpenAiTranscriberLanguage": ".fallback_open_ai_transcriber_language", + "FallbackOpenAiTranscriberModel": ".fallback_open_ai_transcriber_model", + "FallbackOpenAiVoice": ".fallback_open_ai_voice", + "FallbackOpenAiVoiceId": ".fallback_open_ai_voice_id", + "FallbackOpenAiVoiceIdEnum": ".fallback_open_ai_voice_id_enum", + "FallbackOpenAiVoiceModel": ".fallback_open_ai_voice_model", + "FallbackPlan": ".fallback_plan", + "FallbackPlanVoicesItem": ".fallback_plan_voices_item", + "FallbackPlayHtVoice": ".fallback_play_ht_voice", + "FallbackPlayHtVoiceEmotion": ".fallback_play_ht_voice_emotion", + "FallbackPlayHtVoiceId": ".fallback_play_ht_voice_id", + "FallbackPlayHtVoiceIdEnum": ".fallback_play_ht_voice_id_enum", + "FallbackPlayHtVoiceLanguage": ".fallback_play_ht_voice_language", + "FallbackPlayHtVoiceModel": ".fallback_play_ht_voice_model", + "FallbackRimeAiVoice": ".fallback_rime_ai_voice", + "FallbackRimeAiVoiceId": ".fallback_rime_ai_voice_id", + "FallbackRimeAiVoiceIdEnum": ".fallback_rime_ai_voice_id_enum", + "FallbackRimeAiVoiceModel": ".fallback_rime_ai_voice_model", + "FallbackSesameVoice": ".fallback_sesame_voice", + "FallbackSmallestAiVoice": ".fallback_smallest_ai_voice", + "FallbackSmallestAiVoiceId": ".fallback_smallest_ai_voice_id", + "FallbackSmallestAiVoiceIdEnum": ".fallback_smallest_ai_voice_id_enum", + "FallbackSpeechmaticsTranscriber": ".fallback_speechmatics_transcriber", + "FallbackSpeechmaticsTranscriberLanguage": ".fallback_speechmatics_transcriber_language", + "FallbackTalkscriberTranscriber": ".fallback_talkscriber_transcriber", + "FallbackTalkscriberTranscriberLanguage": ".fallback_talkscriber_transcriber_language", + "FallbackTavusVoice": ".fallback_tavus_voice", + "FallbackTavusVoiceVoiceId": ".fallback_tavus_voice_voice_id", + "FallbackTranscriberPlan": ".fallback_transcriber_plan", + "FallbackTranscriberPlanTranscribersItem": ".fallback_transcriber_plan_transcribers_item", + "FallbackVapiVoice": ".fallback_vapi_voice", + "FallbackVapiVoiceVoiceId": ".fallback_vapi_voice_voice_id", + "File": ".file", + "FileStatus": ".file_status", + "FormatPlan": ".format_plan", + "FormatPlanFormattersEnabledItem": ".format_plan_formatters_enabled_item", + "FormatPlanReplacementsItem": ".format_plan_replacements_item", + "FourierDenoisingPlan": ".fourier_denoising_plan", + "FunctionCall": ".function_call", + "FunctionCallAssistantHookAction": ".function_call_assistant_hook_action", + "FunctionCallHookAction": ".function_call_hook_action", + "FunctionCallHookActionMessagesItem": ".function_call_hook_action_messages_item", + "FunctionTool": ".function_tool", + "FunctionToolMessagesItem": ".function_tool_messages_item", + "FunctionToolProviderDetails": ".function_tool_provider_details", + "FunctionToolWithToolCall": ".function_tool_with_tool_call", + "FunctionToolWithToolCallMessagesItem": ".function_tool_with_tool_call_messages_item", + "GcpCredential": ".gcp_credential", + "GcpKey": ".gcp_key", + "GeminiMultimodalLivePrebuiltVoiceConfig": ".gemini_multimodal_live_prebuilt_voice_config", + "GeminiMultimodalLivePrebuiltVoiceConfigVoiceName": ".gemini_multimodal_live_prebuilt_voice_config_voice_name", + "GeminiMultimodalLiveSpeechConfig": ".gemini_multimodal_live_speech_config", + "GeminiMultimodalLiveVoiceConfig": ".gemini_multimodal_live_voice_config", + "GetChatPaginatedDto": ".get_chat_paginated_dto", + "GetChatPaginatedDtoSortOrder": ".get_chat_paginated_dto_sort_order", + "GetSessionPaginatedDto": ".get_session_paginated_dto", + "GetSessionPaginatedDtoSortOrder": ".get_session_paginated_dto_sort_order", + "GhlTool": ".ghl_tool", + "GhlToolMessagesItem": ".ghl_tool_messages_item", + "GhlToolMetadata": ".ghl_tool_metadata", + "GhlToolProviderDetails": ".ghl_tool_provider_details", + "GhlToolWithToolCall": ".ghl_tool_with_tool_call", + "GhlToolWithToolCallMessagesItem": ".ghl_tool_with_tool_call_messages_item", + "GladiaCredential": ".gladia_credential", + "GladiaCustomVocabularyConfigDto": ".gladia_custom_vocabulary_config_dto", + "GladiaCustomVocabularyConfigDtoVocabularyItem": ".gladia_custom_vocabulary_config_dto_vocabulary_item", + "GladiaTranscriber": ".gladia_transcriber", + "GladiaTranscriberLanguage": ".gladia_transcriber_language", + "GladiaTranscriberLanguageBehaviour": ".gladia_transcriber_language_behaviour", + "GladiaTranscriberLanguages": ".gladia_transcriber_languages", + "GladiaTranscriberModel": ".gladia_transcriber_model", + "GladiaVocabularyItemDto": ".gladia_vocabulary_item_dto", + "GlobalNodePlan": ".global_node_plan", + "GoHighLevelCalendarAvailabilityTool": ".go_high_level_calendar_availability_tool", + "GoHighLevelCalendarAvailabilityToolMessagesItem": ".go_high_level_calendar_availability_tool_messages_item", + "GoHighLevelCalendarAvailabilityToolProviderDetails": ".go_high_level_calendar_availability_tool_provider_details", + "GoHighLevelCalendarAvailabilityToolWithToolCall": ".go_high_level_calendar_availability_tool_with_tool_call", + "GoHighLevelCalendarAvailabilityToolWithToolCallMessagesItem": ".go_high_level_calendar_availability_tool_with_tool_call_messages_item", + "GoHighLevelCalendarEventCreateTool": ".go_high_level_calendar_event_create_tool", + "GoHighLevelCalendarEventCreateToolMessagesItem": ".go_high_level_calendar_event_create_tool_messages_item", + "GoHighLevelCalendarEventCreateToolProviderDetails": ".go_high_level_calendar_event_create_tool_provider_details", + "GoHighLevelCalendarEventCreateToolWithToolCall": ".go_high_level_calendar_event_create_tool_with_tool_call", + "GoHighLevelCalendarEventCreateToolWithToolCallMessagesItem": ".go_high_level_calendar_event_create_tool_with_tool_call_messages_item", + "GoHighLevelContactCreateTool": ".go_high_level_contact_create_tool", + "GoHighLevelContactCreateToolMessagesItem": ".go_high_level_contact_create_tool_messages_item", + "GoHighLevelContactCreateToolProviderDetails": ".go_high_level_contact_create_tool_provider_details", + "GoHighLevelContactCreateToolWithToolCall": ".go_high_level_contact_create_tool_with_tool_call", + "GoHighLevelContactCreateToolWithToolCallMessagesItem": ".go_high_level_contact_create_tool_with_tool_call_messages_item", + "GoHighLevelContactGetTool": ".go_high_level_contact_get_tool", + "GoHighLevelContactGetToolMessagesItem": ".go_high_level_contact_get_tool_messages_item", + "GoHighLevelContactGetToolProviderDetails": ".go_high_level_contact_get_tool_provider_details", + "GoHighLevelContactGetToolWithToolCall": ".go_high_level_contact_get_tool_with_tool_call", + "GoHighLevelContactGetToolWithToolCallMessagesItem": ".go_high_level_contact_get_tool_with_tool_call_messages_item", + "GoHighLevelCredential": ".go_high_level_credential", + "GoHighLevelMcpCredential": ".go_high_level_mcp_credential", + "GoogleCalendarCheckAvailabilityTool": ".google_calendar_check_availability_tool", + "GoogleCalendarCheckAvailabilityToolMessagesItem": ".google_calendar_check_availability_tool_messages_item", + "GoogleCalendarCreateEventTool": ".google_calendar_create_event_tool", + "GoogleCalendarCreateEventToolMessagesItem": ".google_calendar_create_event_tool_messages_item", + "GoogleCalendarCreateEventToolProviderDetails": ".google_calendar_create_event_tool_provider_details", + "GoogleCalendarCreateEventToolWithToolCall": ".google_calendar_create_event_tool_with_tool_call", + "GoogleCalendarCreateEventToolWithToolCallMessagesItem": ".google_calendar_create_event_tool_with_tool_call_messages_item", + "GoogleCalendarOAuth2AuthorizationCredential": ".google_calendar_o_auth_2_authorization_credential", + "GoogleCalendarOAuth2ClientCredential": ".google_calendar_o_auth_2_client_credential", + "GoogleCredential": ".google_credential", + "GoogleModel": ".google_model", + "GoogleModelModel": ".google_model_model", + "GoogleModelToolsItem": ".google_model_tools_item", + "GoogleRealtimeConfig": ".google_realtime_config", + "GoogleSheetsOAuth2AuthorizationCredential": ".google_sheets_o_auth_2_authorization_credential", + "GoogleSheetsRowAppendTool": ".google_sheets_row_append_tool", + "GoogleSheetsRowAppendToolMessagesItem": ".google_sheets_row_append_tool_messages_item", + "GoogleSheetsRowAppendToolProviderDetails": ".google_sheets_row_append_tool_provider_details", + "GoogleSheetsRowAppendToolWithToolCall": ".google_sheets_row_append_tool_with_tool_call", + "GoogleSheetsRowAppendToolWithToolCallMessagesItem": ".google_sheets_row_append_tool_with_tool_call_messages_item", + "GoogleTranscriber": ".google_transcriber", + "GoogleTranscriberLanguage": ".google_transcriber_language", + "GoogleTranscriberModel": ".google_transcriber_model", + "GoogleVoicemailDetectionPlan": ".google_voicemail_detection_plan", + "GoogleVoicemailDetectionPlanType": ".google_voicemail_detection_plan_type", + "GroqCredential": ".groq_credential", + "GroqModel": ".groq_model", + "GroqModelModel": ".groq_model_model", + "GroqModelToolsItem": ".groq_model_tools_item", + "GroupCondition": ".group_condition", + "GroupConditionConditionsItem": ".group_condition_conditions_item", + "GroupConditionOperator": ".group_condition_operator", + "HandoffDestinationAssistant": ".handoff_destination_assistant", + "HandoffDestinationAssistantContextEngineeringPlan": ".handoff_destination_assistant_context_engineering_plan", + "HandoffDestinationDynamic": ".handoff_destination_dynamic", + "HandoffTool": ".handoff_tool", + "HandoffToolDestinationsItem": ".handoff_tool_destinations_item", + "HandoffToolMessagesItem": ".handoff_tool_messages_item", + "HangupNode": ".hangup_node", + "HmacAuthenticationPlan": ".hmac_authentication_plan", + "HmacAuthenticationPlanAlgorithm": ".hmac_authentication_plan_algorithm", + "HmacAuthenticationPlanSignatureEncoding": ".hmac_authentication_plan_signature_encoding", + "HumeCredential": ".hume_credential", + "HumeVoice": ".hume_voice", + "ImportTwilioPhoneNumberDto": ".import_twilio_phone_number_dto", + "ImportTwilioPhoneNumberDtoFallbackDestination": ".import_twilio_phone_number_dto_fallback_destination", + "ImportTwilioPhoneNumberDtoHooksItem": ".import_twilio_phone_number_dto_hooks_item", + "ImportVonagePhoneNumberDto": ".import_vonage_phone_number_dto", + "ImportVonagePhoneNumberDtoFallbackDestination": ".import_vonage_phone_number_dto_fallback_destination", + "ImportVonagePhoneNumberDtoHooksItem": ".import_vonage_phone_number_dto_hooks_item", + "InflectionAiCredential": ".inflection_ai_credential", + "InflectionAiModel": ".inflection_ai_model", + "InflectionAiModelToolsItem": ".inflection_ai_model_tools_item", + "InviteUserDto": ".invite_user_dto", + "InviteUserDtoRole": ".invite_user_dto_role", + "InvoicePlan": ".invoice_plan", + "InworldCredential": ".inworld_credential", + "InworldVoice": ".inworld_voice", + "InworldVoiceLanguageCode": ".inworld_voice_language_code", + "InworldVoiceVoiceId": ".inworld_voice_voice_id", + "JsonSchema": ".json_schema", + "JsonSchemaFormat": ".json_schema_format", + "JsonSchemaType": ".json_schema_type", + "JwtResponse": ".jwt_response", + "KeypadInputPlan": ".keypad_input_plan", + "KeypadInputPlanDelimiters": ".keypad_input_plan_delimiters", + "KnowledgeBase": ".knowledge_base", + "KnowledgeBaseCost": ".knowledge_base_cost", + "KnowledgeBaseModel": ".knowledge_base_model", + "KnowledgeBaseResponseDocument": ".knowledge_base_response_document", + "LangfuseCredential": ".langfuse_credential", + "LangfuseObservabilityPlan": ".langfuse_observability_plan", + "LiquidCondition": ".liquid_condition", + "LivekitSmartEndpointingPlan": ".livekit_smart_endpointing_plan", + "LivekitSmartEndpointingPlanProvider": ".livekit_smart_endpointing_plan_provider", + "LmntCredential": ".lmnt_credential", + "LmntVoice": ".lmnt_voice", + "LmntVoiceId": ".lmnt_voice_id", + "LmntVoiceIdEnum": ".lmnt_voice_id_enum", + "LmntVoiceLanguage": ".lmnt_voice_language", + "LogicEdgeCondition": ".logic_edge_condition", + "MakeCredential": ".make_credential", + "MakeTool": ".make_tool", + "MakeToolMessagesItem": ".make_tool_messages_item", + "MakeToolMetadata": ".make_tool_metadata", + "MakeToolProviderDetails": ".make_tool_provider_details", + "MakeToolWithToolCall": ".make_tool_with_tool_call", + "MakeToolWithToolCallMessagesItem": ".make_tool_with_tool_call_messages_item", + "McpTool": ".mcp_tool", + "McpToolMessagesItem": ".mcp_tool_messages_item", + "McpToolMetadata": ".mcp_tool_metadata", + "McpToolMetadataProtocol": ".mcp_tool_metadata_protocol", + "MessageTarget": ".message_target", + "MessageTargetRole": ".message_target_role", + "MinimaxVoice": ".minimax_voice", + "MinimaxVoiceModel": ".minimax_voice_model", + "MinimaxVoiceRegion": ".minimax_voice_region", + "MistralCredential": ".mistral_credential", + "ModelCost": ".model_cost", + "Monitor": ".monitor", + "MonitorPlan": ".monitor_plan", + "Mono": ".mono", + "NeetsVoice": ".neets_voice", + "NeuphonicCredential": ".neuphonic_credential", + "NeuphonicVoice": ".neuphonic_voice", + "NeuphonicVoiceModel": ".neuphonic_voice_model", + "NodeArtifact": ".node_artifact", + "NodeArtifactMessagesItem": ".node_artifact_messages_item", + "OAuth2AuthenticationPlan": ".o_auth_2_authentication_plan", + "Oauth2AuthenticationSession": ".oauth_2_authentication_session", + "OpenAiCredential": ".open_ai_credential", + "OpenAiFunction": ".open_ai_function", + "OpenAiFunctionParameters": ".open_ai_function_parameters", + "OpenAiMessage": ".open_ai_message", + "OpenAiMessageRole": ".open_ai_message_role", + "OpenAiModel": ".open_ai_model", + "OpenAiModelFallbackModelsItem": ".open_ai_model_fallback_models_item", + "OpenAiModelModel": ".open_ai_model_model", + "OpenAiModelToolStrictCompatibilityMode": ".open_ai_model_tool_strict_compatibility_mode", + "OpenAiModelToolsItem": ".open_ai_model_tools_item", + "OpenAiTranscriber": ".open_ai_transcriber", + "OpenAiTranscriberLanguage": ".open_ai_transcriber_language", + "OpenAiTranscriberModel": ".open_ai_transcriber_model", + "OpenAiVoice": ".open_ai_voice", + "OpenAiVoiceId": ".open_ai_voice_id", + "OpenAiVoiceIdEnum": ".open_ai_voice_id_enum", + "OpenAiVoiceModel": ".open_ai_voice_model", + "OpenAiVoicemailDetectionPlan": ".open_ai_voicemail_detection_plan", + "OpenAiVoicemailDetectionPlanType": ".open_ai_voicemail_detection_plan_type", + "OpenAiWebChatRequest": ".open_ai_web_chat_request", + "OpenAiWebChatRequestInput": ".open_ai_web_chat_request_input", + "OpenAiWebChatRequestInputItem": ".open_ai_web_chat_request_input_item", + "OpenRouterCredential": ".open_router_credential", + "OpenRouterModel": ".open_router_model", + "OpenRouterModelToolsItem": ".open_router_model_tools_item", + "Org": ".org", + "OrgChannel": ".org_channel", + "OutputTool": ".output_tool", + "OutputToolMessagesItem": ".output_tool_messages_item", + "PaginationMeta": ".pagination_meta", + "PerformanceMetrics": ".performance_metrics", + "PerplexityAiCredential": ".perplexity_ai_credential", + "PerplexityAiModel": ".perplexity_ai_model", + "PerplexityAiModelToolsItem": ".perplexity_ai_model_tools_item", + "PhoneNumberCallEndingHookFilter": ".phone_number_call_ending_hook_filter", + "PhoneNumberCallEndingHookFilterOneOfItem": ".phone_number_call_ending_hook_filter_one_of_item", + "PhoneNumberHookCallEnding": ".phone_number_hook_call_ending", + "PhoneNumberHookCallEndingDo": ".phone_number_hook_call_ending_do", + "PhoneNumberHookCallRinging": ".phone_number_hook_call_ringing", + "PhoneNumberHookCallRingingDoItem": ".phone_number_hook_call_ringing_do_item", + "PhoneNumberPaginatedResponse": ".phone_number_paginated_response", + "PhoneNumberPaginatedResponseResultsItem": ".phone_number_paginated_response_results_item", + "PlayHtCredential": ".play_ht_credential", + "PlayHtVoice": ".play_ht_voice", + "PlayHtVoiceEmotion": ".play_ht_voice_emotion", + "PlayHtVoiceId": ".play_ht_voice_id", + "PlayHtVoiceIdEnum": ".play_ht_voice_id_enum", + "PlayHtVoiceLanguage": ".play_ht_voice_language", + "PlayHtVoiceModel": ".play_ht_voice_model", + "PromptInjectionSecurityFilter": ".prompt_injection_security_filter", + "ProviderResource": ".provider_resource", + "ProviderResourcePaginatedResponse": ".provider_resource_paginated_response", + "PunctuationBoundary": ".punctuation_boundary", + "QueryTool": ".query_tool", + "QueryToolMessagesItem": ".query_tool_messages_item", + "RceSecurityFilter": ".rce_security_filter", + "Recording": ".recording", + "RegexCondition": ".regex_condition", + "RegexOption": ".regex_option", + "RegexOptionType": ".regex_option_type", + "RegexReplacement": ".regex_replacement", + "RegexSecurityFilter": ".regex_security_filter", + "ResponseCompletedEvent": ".response_completed_event", + "ResponseErrorEvent": ".response_error_event", + "ResponseObject": ".response_object", + "ResponseObjectStatus": ".response_object_status", + "ResponseOutputMessage": ".response_output_message", + "ResponseOutputMessageStatus": ".response_output_message_status", + "ResponseOutputText": ".response_output_text", + "ResponseTextDeltaEvent": ".response_text_delta_event", + "ResponseTextDoneEvent": ".response_text_done_event", + "RimeAiCredential": ".rime_ai_credential", + "RimeAiVoice": ".rime_ai_voice", + "RimeAiVoiceId": ".rime_ai_voice_id", + "RimeAiVoiceIdEnum": ".rime_ai_voice_id_enum", + "RimeAiVoiceModel": ".rime_ai_voice_model", + "RunpodCredential": ".runpod_credential", + "S3Credential": ".s_3_credential", + "SayAssistantHookAction": ".say_assistant_hook_action", + "SayHookAction": ".say_hook_action", + "SayHookActionPrompt": ".say_hook_action_prompt", + "SayHookActionPromptItem": ".say_hook_action_prompt_item", + "SayPhoneNumberHookAction": ".say_phone_number_hook_action", + "SbcConfiguration": ".sbc_configuration", + "SchedulePlan": ".schedule_plan", + "SecurityFilterBase": ".security_filter_base", + "SecurityFilterPlan": ".security_filter_plan", + "SecurityFilterPlanMode": ".security_filter_plan_mode", + "Server": ".server", + "ServerMessage": ".server_message", + "ServerMessageAssistantRequest": ".server_message_assistant_request", + "ServerMessageAssistantRequestPhoneNumber": ".server_message_assistant_request_phone_number", + "ServerMessageCallEndpointingRequest": ".server_message_call_endpointing_request", + "ServerMessageCallEndpointingRequestMessagesItem": ".server_message_call_endpointing_request_messages_item", + "ServerMessageCallEndpointingRequestPhoneNumber": ".server_message_call_endpointing_request_phone_number", + "ServerMessageChatCreated": ".server_message_chat_created", + "ServerMessageChatCreatedPhoneNumber": ".server_message_chat_created_phone_number", + "ServerMessageChatDeleted": ".server_message_chat_deleted", + "ServerMessageChatDeletedPhoneNumber": ".server_message_chat_deleted_phone_number", + "ServerMessageConversationUpdate": ".server_message_conversation_update", + "ServerMessageConversationUpdateMessagesItem": ".server_message_conversation_update_messages_item", + "ServerMessageConversationUpdatePhoneNumber": ".server_message_conversation_update_phone_number", + "ServerMessageEndOfCallReport": ".server_message_end_of_call_report", + "ServerMessageEndOfCallReportCostsItem": ".server_message_end_of_call_report_costs_item", + "ServerMessageEndOfCallReportEndedReason": ".server_message_end_of_call_report_ended_reason", + "ServerMessageEndOfCallReportPhoneNumber": ".server_message_end_of_call_report_phone_number", + "ServerMessageHang": ".server_message_hang", + "ServerMessageHangPhoneNumber": ".server_message_hang_phone_number", + "ServerMessageKnowledgeBaseRequest": ".server_message_knowledge_base_request", + "ServerMessageKnowledgeBaseRequestMessagesItem": ".server_message_knowledge_base_request_messages_item", + "ServerMessageKnowledgeBaseRequestPhoneNumber": ".server_message_knowledge_base_request_phone_number", + "ServerMessageLanguageChangeDetected": ".server_message_language_change_detected", + "ServerMessageLanguageChangeDetectedPhoneNumber": ".server_message_language_change_detected_phone_number", + "ServerMessageMessage": ".server_message_message", + "ServerMessageModelOutput": ".server_message_model_output", + "ServerMessageModelOutputPhoneNumber": ".server_message_model_output_phone_number", + "ServerMessagePhoneCallControl": ".server_message_phone_call_control", + "ServerMessagePhoneCallControlDestination": ".server_message_phone_call_control_destination", + "ServerMessagePhoneCallControlPhoneNumber": ".server_message_phone_call_control_phone_number", + "ServerMessagePhoneCallControlRequest": ".server_message_phone_call_control_request", + "ServerMessageResponse": ".server_message_response", + "ServerMessageResponseAssistantRequest": ".server_message_response_assistant_request", + "ServerMessageResponseAssistantRequestDestination": ".server_message_response_assistant_request_destination", + "ServerMessageResponseCallEndpointingRequest": ".server_message_response_call_endpointing_request", + "ServerMessageResponseHandoffDestinationRequest": ".server_message_response_handoff_destination_request", + "ServerMessageResponseKnowledgeBaseRequest": ".server_message_response_knowledge_base_request", + "ServerMessageResponseMessageResponse": ".server_message_response_message_response", + "ServerMessageResponseToolCalls": ".server_message_response_tool_calls", + "ServerMessageResponseTransferDestinationRequest": ".server_message_response_transfer_destination_request", + "ServerMessageResponseTransferDestinationRequestDestination": ".server_message_response_transfer_destination_request_destination", + "ServerMessageResponseTransferDestinationRequestMessage": ".server_message_response_transfer_destination_request_message", + "ServerMessageResponseVoiceRequest": ".server_message_response_voice_request", + "ServerMessageSessionCreated": ".server_message_session_created", + "ServerMessageSessionCreatedPhoneNumber": ".server_message_session_created_phone_number", + "ServerMessageSessionDeleted": ".server_message_session_deleted", + "ServerMessageSessionDeletedPhoneNumber": ".server_message_session_deleted_phone_number", + "ServerMessageSessionUpdated": ".server_message_session_updated", + "ServerMessageSessionUpdatedPhoneNumber": ".server_message_session_updated_phone_number", + "ServerMessageSpeechUpdate": ".server_message_speech_update", + "ServerMessageSpeechUpdatePhoneNumber": ".server_message_speech_update_phone_number", + "ServerMessageSpeechUpdateRole": ".server_message_speech_update_role", + "ServerMessageSpeechUpdateStatus": ".server_message_speech_update_status", + "ServerMessageStatusUpdate": ".server_message_status_update", + "ServerMessageStatusUpdateDestination": ".server_message_status_update_destination", + "ServerMessageStatusUpdateEndedReason": ".server_message_status_update_ended_reason", + "ServerMessageStatusUpdateMessagesItem": ".server_message_status_update_messages_item", + "ServerMessageStatusUpdatePhoneNumber": ".server_message_status_update_phone_number", + "ServerMessageStatusUpdateStatus": ".server_message_status_update_status", + "ServerMessageToolCalls": ".server_message_tool_calls", + "ServerMessageToolCallsPhoneNumber": ".server_message_tool_calls_phone_number", + "ServerMessageToolCallsToolWithToolCallListItem": ".server_message_tool_calls_tool_with_tool_call_list_item", + "ServerMessageTranscript": ".server_message_transcript", + "ServerMessageTranscriptPhoneNumber": ".server_message_transcript_phone_number", + "ServerMessageTranscriptRole": ".server_message_transcript_role", + "ServerMessageTranscriptTranscriptType": ".server_message_transcript_transcript_type", + "ServerMessageTranscriptType": ".server_message_transcript_type", + "ServerMessageTransferDestinationRequest": ".server_message_transfer_destination_request", + "ServerMessageTransferDestinationRequestPhoneNumber": ".server_message_transfer_destination_request_phone_number", + "ServerMessageTransferUpdate": ".server_message_transfer_update", + "ServerMessageTransferUpdateDestination": ".server_message_transfer_update_destination", + "ServerMessageTransferUpdatePhoneNumber": ".server_message_transfer_update_phone_number", + "ServerMessageUserInterrupted": ".server_message_user_interrupted", + "ServerMessageUserInterruptedPhoneNumber": ".server_message_user_interrupted_phone_number", + "ServerMessageVoiceInput": ".server_message_voice_input", + "ServerMessageVoiceInputPhoneNumber": ".server_message_voice_input_phone_number", + "ServerMessageVoiceRequest": ".server_message_voice_request", + "ServerMessageVoiceRequestPhoneNumber": ".server_message_voice_request_phone_number", + "SesameVoice": ".sesame_voice", + "Session": ".session", + "SessionMessagesItem": ".session_messages_item", + "SessionPaginatedResponse": ".session_paginated_response", + "SessionStatus": ".session_status", + "SipAuthentication": ".sip_authentication", + "SipTrunkGateway": ".sip_trunk_gateway", + "SipTrunkGatewayOutboundProtocol": ".sip_trunk_gateway_outbound_protocol", + "SipTrunkOutboundAuthenticationPlan": ".sip_trunk_outbound_authentication_plan", + "SipTrunkOutboundSipRegisterPlan": ".sip_trunk_outbound_sip_register_plan", + "SlackOAuth2AuthorizationCredential": ".slack_o_auth_2_authorization_credential", + "SlackSendMessageTool": ".slack_send_message_tool", + "SlackSendMessageToolMessagesItem": ".slack_send_message_tool_messages_item", + "SmallestAiCredential": ".smallest_ai_credential", + "SmallestAiVoice": ".smallest_ai_voice", + "SmallestAiVoiceId": ".smallest_ai_voice_id", + "SmallestAiVoiceIdEnum": ".smallest_ai_voice_id_enum", + "SmartDenoisingPlan": ".smart_denoising_plan", + "SmsTool": ".sms_tool", + "SmsToolMessagesItem": ".sms_tool_messages_item", + "SpeechmaticsCredential": ".speechmatics_credential", + "SpeechmaticsTranscriber": ".speechmatics_transcriber", + "SpeechmaticsTranscriberLanguage": ".speechmatics_transcriber_language", + "SqlInjectionSecurityFilter": ".sql_injection_security_filter", + "Squad": ".squad", + "SquadMemberDto": ".squad_member_dto", + "SquadMemberDtoAssistantDestinationsItem": ".squad_member_dto_assistant_destinations_item", + "SsrfSecurityFilter": ".ssrf_security_filter", + "StartSpeakingPlan": ".start_speaking_plan", + "StartSpeakingPlanCustomEndpointingRulesItem": ".start_speaking_plan_custom_endpointing_rules_item", + "StartSpeakingPlanSmartEndpointingEnabled": ".start_speaking_plan_smart_endpointing_enabled", + "StartSpeakingPlanSmartEndpointingPlan": ".start_speaking_plan_smart_endpointing_plan", + "StopSpeakingPlan": ".stop_speaking_plan", + "StructuredDataMultiPlan": ".structured_data_multi_plan", + "StructuredDataPlan": ".structured_data_plan", + "StructuredOutput": ".structured_output", + "StructuredOutputModel": ".structured_output_model", + "StructuredOutputPaginatedResponse": ".structured_output_paginated_response", + "Subscription": ".subscription", + "SubscriptionMinutesIncludedResetFrequency": ".subscription_minutes_included_reset_frequency", + "SubscriptionStatus": ".subscription_status", + "SubscriptionType": ".subscription_type", + "SuccessEvaluationPlan": ".success_evaluation_plan", + "SuccessEvaluationPlanRubric": ".success_evaluation_plan_rubric", + "SummaryPlan": ".summary_plan", + "SupabaseBucketPlan": ".supabase_bucket_plan", + "SupabaseBucketPlanRegion": ".supabase_bucket_plan_region", + "SupabaseCredential": ".supabase_credential", + "SyncVoiceLibraryDto": ".sync_voice_library_dto", + "SyncVoiceLibraryDtoProvidersItem": ".sync_voice_library_dto_providers_item", + "SystemMessage": ".system_message", + "TalkscriberTranscriber": ".talkscriber_transcriber", + "TalkscriberTranscriberLanguage": ".talkscriber_transcriber_language", + "TargetPlan": ".target_plan", + "TavusConversationProperties": ".tavus_conversation_properties", + "TavusCredential": ".tavus_credential", + "TavusVoice": ".tavus_voice", + "TavusVoiceVoiceId": ".tavus_voice_voice_id", + "TelnyxPhoneNumber": ".telnyx_phone_number", + "TelnyxPhoneNumberFallbackDestination": ".telnyx_phone_number_fallback_destination", + "TelnyxPhoneNumberHooksItem": ".telnyx_phone_number_hooks_item", + "TelnyxPhoneNumberStatus": ".telnyx_phone_number_status", + "Template": ".template", + "TemplateDetails": ".template_details", + "TemplateProvider": ".template_provider", + "TemplateProviderDetails": ".template_provider_details", + "TemplateVisibility": ".template_visibility", + "TestSuite": ".test_suite", + "TestSuitePhoneNumber": ".test_suite_phone_number", + "TestSuiteRun": ".test_suite_run", + "TestSuiteRunScorerAi": ".test_suite_run_scorer_ai", + "TestSuiteRunScorerAiResult": ".test_suite_run_scorer_ai_result", + "TestSuiteRunStatus": ".test_suite_run_status", + "TestSuiteRunTestAttempt": ".test_suite_run_test_attempt", + "TestSuiteRunTestAttemptCall": ".test_suite_run_test_attempt_call", + "TestSuiteRunTestAttemptMetadata": ".test_suite_run_test_attempt_metadata", + "TestSuiteRunTestResult": ".test_suite_run_test_result", + "TestSuiteRunsPaginatedResponse": ".test_suite_runs_paginated_response", + "TestSuiteTestChat": ".test_suite_test_chat", + "TestSuiteTestScorerAi": ".test_suite_test_scorer_ai", + "TestSuiteTestVoice": ".test_suite_test_voice", + "TestSuiteTestsPaginatedResponse": ".test_suite_tests_paginated_response", + "TestSuiteTestsPaginatedResponseResultsItem": ".test_suite_tests_paginated_response_results_item", + "TestSuitesPaginatedResponse": ".test_suites_paginated_response", + "TesterPlan": ".tester_plan", + "TextContent": ".text_content", + "TextContentLanguage": ".text_content_language", + "TextEditorTool": ".text_editor_tool", + "TextEditorToolMessagesItem": ".text_editor_tool_messages_item", + "TextEditorToolWithToolCall": ".text_editor_tool_with_tool_call", + "TextEditorToolWithToolCallMessagesItem": ".text_editor_tool_with_tool_call_messages_item", + "TimeRange": ".time_range", + "TimeRangeStep": ".time_range_step", + "TogetherAiCredential": ".together_ai_credential", + "TogetherAiModel": ".together_ai_model", + "TogetherAiModelToolsItem": ".together_ai_model_tools_item", + "Token": ".token", + "TokenRestrictions": ".token_restrictions", + "TokenTag": ".token_tag", + "ToolCall": ".tool_call", + "ToolCallFunction": ".tool_call_function", + "ToolCallHookAction": ".tool_call_hook_action", + "ToolCallHookActionTool": ".tool_call_hook_action_tool", + "ToolCallMessage": ".tool_call_message", + "ToolCallResult": ".tool_call_result", + "ToolCallResultMessage": ".tool_call_result_message", + "ToolMessage": ".tool_message", + "ToolMessageComplete": ".tool_message_complete", + "ToolMessageCompleteRole": ".tool_message_complete_role", + "ToolMessageDelayed": ".tool_message_delayed", + "ToolMessageFailed": ".tool_message_failed", + "ToolMessageStart": ".tool_message_start", + "ToolNode": ".tool_node", + "ToolNodeTool": ".tool_node_tool", + "ToolRejectionPlan": ".tool_rejection_plan", + "ToolRejectionPlanConditionsItem": ".tool_rejection_plan_conditions_item", + "ToolTemplateMetadata": ".tool_template_metadata", + "ToolTemplateSetup": ".tool_template_setup", + "TranscriberCost": ".transcriber_cost", + "TranscriptPlan": ".transcript_plan", + "TranscriptionEndpointingPlan": ".transcription_endpointing_plan", + "TransferAssistant": ".transfer_assistant", + "TransferAssistantFirstMessageMode": ".transfer_assistant_first_message_mode", + "TransferAssistantHookAction": ".transfer_assistant_hook_action", + "TransferAssistantModel": ".transfer_assistant_model", + "TransferAssistantModelProvider": ".transfer_assistant_model_provider", + "TransferCallTool": ".transfer_call_tool", + "TransferCallToolDestinationsItem": ".transfer_call_tool_destinations_item", + "TransferCallToolMessagesItem": ".transfer_call_tool_messages_item", + "TransferCancelToolUserEditable": ".transfer_cancel_tool_user_editable", + "TransferCancelToolUserEditableMessagesItem": ".transfer_cancel_tool_user_editable_messages_item", + "TransferDestinationAssistant": ".transfer_destination_assistant", + "TransferDestinationAssistantMessage": ".transfer_destination_assistant_message", + "TransferDestinationNumber": ".transfer_destination_number", + "TransferDestinationNumberMessage": ".transfer_destination_number_message", + "TransferDestinationSip": ".transfer_destination_sip", + "TransferDestinationSipMessage": ".transfer_destination_sip_message", + "TransferFallbackPlan": ".transfer_fallback_plan", + "TransferFallbackPlanMessage": ".transfer_fallback_plan_message", + "TransferHookAction": ".transfer_hook_action", + "TransferHookActionDestination": ".transfer_hook_action_destination", + "TransferMode": ".transfer_mode", + "TransferPhoneNumberHookAction": ".transfer_phone_number_hook_action", + "TransferPhoneNumberHookActionDestination": ".transfer_phone_number_hook_action_destination", + "TransferPlan": ".transfer_plan", + "TransferPlanMessage": ".transfer_plan_message", + "TransferPlanMode": ".transfer_plan_mode", + "TransferSuccessfulToolUserEditable": ".transfer_successful_tool_user_editable", + "TransferSuccessfulToolUserEditableMessagesItem": ".transfer_successful_tool_user_editable_messages_item", + "TransportConfigurationTwilio": ".transport_configuration_twilio", + "TransportConfigurationTwilioRecordingChannels": ".transport_configuration_twilio_recording_channels", + "TransportCost": ".transport_cost", + "TransportCostProvider": ".transport_cost_provider", + "TrieveCredential": ".trieve_credential", + "TrieveKnowledgeBase": ".trieve_knowledge_base", + "TrieveKnowledgeBaseChunkPlan": ".trieve_knowledge_base_chunk_plan", + "TrieveKnowledgeBaseCreate": ".trieve_knowledge_base_create", + "TrieveKnowledgeBaseImport": ".trieve_knowledge_base_import", + "TrieveKnowledgeBaseSearchPlan": ".trieve_knowledge_base_search_plan", + "TrieveKnowledgeBaseSearchPlanSearchType": ".trieve_knowledge_base_search_plan_search_type", + "TurnLatency": ".turn_latency", + "TwilioCredential": ".twilio_credential", + "TwilioPhoneNumber": ".twilio_phone_number", + "TwilioPhoneNumberFallbackDestination": ".twilio_phone_number_fallback_destination", + "TwilioPhoneNumberHooksItem": ".twilio_phone_number_hooks_item", + "TwilioPhoneNumberStatus": ".twilio_phone_number_status", + "TwilioVoicemailDetectionPlan": ".twilio_voicemail_detection_plan", + "TwilioVoicemailDetectionPlanVoicemailDetectionTypesItem": ".twilio_voicemail_detection_plan_voicemail_detection_types_item", + "UpdateAnthropicCredentialDto": ".update_anthropic_credential_dto", + "UpdateAnyscaleCredentialDto": ".update_anyscale_credential_dto", + "UpdateApiRequestToolDto": ".update_api_request_tool_dto", + "UpdateApiRequestToolDtoMessagesItem": ".update_api_request_tool_dto_messages_item", + "UpdateApiRequestToolDtoMethod": ".update_api_request_tool_dto_method", + "UpdateAssemblyAiCredentialDto": ".update_assembly_ai_credential_dto", + "UpdateAzureCredentialDto": ".update_azure_credential_dto", + "UpdateAzureCredentialDtoRegion": ".update_azure_credential_dto_region", + "UpdateAzureCredentialDtoService": ".update_azure_credential_dto_service", + "UpdateAzureOpenAiCredentialDto": ".update_azure_open_ai_credential_dto", + "UpdateAzureOpenAiCredentialDtoModelsItem": ".update_azure_open_ai_credential_dto_models_item", + "UpdateAzureOpenAiCredentialDtoRegion": ".update_azure_open_ai_credential_dto_region", + "UpdateBashToolDto": ".update_bash_tool_dto", + "UpdateBashToolDtoMessagesItem": ".update_bash_tool_dto_messages_item", + "UpdateByoPhoneNumberDto": ".update_byo_phone_number_dto", + "UpdateByoPhoneNumberDtoFallbackDestination": ".update_byo_phone_number_dto_fallback_destination", + "UpdateByoPhoneNumberDtoHooksItem": ".update_byo_phone_number_dto_hooks_item", + "UpdateByoSipTrunkCredentialDto": ".update_byo_sip_trunk_credential_dto", + "UpdateCartesiaCredentialDto": ".update_cartesia_credential_dto", + "UpdateCerebrasCredentialDto": ".update_cerebras_credential_dto", + "UpdateCloudflareCredentialDto": ".update_cloudflare_credential_dto", + "UpdateComputerToolDto": ".update_computer_tool_dto", + "UpdateComputerToolDtoMessagesItem": ".update_computer_tool_dto_messages_item", + "UpdateCustomCredentialDto": ".update_custom_credential_dto", + "UpdateCustomCredentialDtoAuthenticationPlan": ".update_custom_credential_dto_authentication_plan", + "UpdateCustomKnowledgeBaseDto": ".update_custom_knowledge_base_dto", + "UpdateCustomLlmCredentialDto": ".update_custom_llm_credential_dto", + "UpdateDeepInfraCredentialDto": ".update_deep_infra_credential_dto", + "UpdateDeepSeekCredentialDto": ".update_deep_seek_credential_dto", + "UpdateDeepgramCredentialDto": ".update_deepgram_credential_dto", + "UpdateDtmfToolDto": ".update_dtmf_tool_dto", + "UpdateDtmfToolDtoMessagesItem": ".update_dtmf_tool_dto_messages_item", + "UpdateElevenLabsCredentialDto": ".update_eleven_labs_credential_dto", + "UpdateEndCallToolDto": ".update_end_call_tool_dto", + "UpdateEndCallToolDtoMessagesItem": ".update_end_call_tool_dto_messages_item", + "UpdateFunctionToolDto": ".update_function_tool_dto", + "UpdateFunctionToolDtoMessagesItem": ".update_function_tool_dto_messages_item", + "UpdateGcpCredentialDto": ".update_gcp_credential_dto", + "UpdateGhlToolDto": ".update_ghl_tool_dto", + "UpdateGhlToolDtoMessagesItem": ".update_ghl_tool_dto_messages_item", + "UpdateGladiaCredentialDto": ".update_gladia_credential_dto", + "UpdateGoHighLevelCalendarAvailabilityToolDto": ".update_go_high_level_calendar_availability_tool_dto", + "UpdateGoHighLevelCalendarAvailabilityToolDtoMessagesItem": ".update_go_high_level_calendar_availability_tool_dto_messages_item", + "UpdateGoHighLevelCalendarEventCreateToolDto": ".update_go_high_level_calendar_event_create_tool_dto", + "UpdateGoHighLevelCalendarEventCreateToolDtoMessagesItem": ".update_go_high_level_calendar_event_create_tool_dto_messages_item", + "UpdateGoHighLevelContactCreateToolDto": ".update_go_high_level_contact_create_tool_dto", + "UpdateGoHighLevelContactCreateToolDtoMessagesItem": ".update_go_high_level_contact_create_tool_dto_messages_item", + "UpdateGoHighLevelContactGetToolDto": ".update_go_high_level_contact_get_tool_dto", + "UpdateGoHighLevelContactGetToolDtoMessagesItem": ".update_go_high_level_contact_get_tool_dto_messages_item", + "UpdateGoHighLevelCredentialDto": ".update_go_high_level_credential_dto", + "UpdateGoHighLevelMcpCredentialDto": ".update_go_high_level_mcp_credential_dto", + "UpdateGoogleCalendarCheckAvailabilityToolDto": ".update_google_calendar_check_availability_tool_dto", + "UpdateGoogleCalendarCheckAvailabilityToolDtoMessagesItem": ".update_google_calendar_check_availability_tool_dto_messages_item", + "UpdateGoogleCalendarCreateEventToolDto": ".update_google_calendar_create_event_tool_dto", + "UpdateGoogleCalendarCreateEventToolDtoMessagesItem": ".update_google_calendar_create_event_tool_dto_messages_item", + "UpdateGoogleCalendarOAuth2AuthorizationCredentialDto": ".update_google_calendar_o_auth_2_authorization_credential_dto", + "UpdateGoogleCalendarOAuth2ClientCredentialDto": ".update_google_calendar_o_auth_2_client_credential_dto", + "UpdateGoogleCredentialDto": ".update_google_credential_dto", + "UpdateGoogleSheetsOAuth2AuthorizationCredentialDto": ".update_google_sheets_o_auth_2_authorization_credential_dto", + "UpdateGoogleSheetsRowAppendToolDto": ".update_google_sheets_row_append_tool_dto", + "UpdateGoogleSheetsRowAppendToolDtoMessagesItem": ".update_google_sheets_row_append_tool_dto_messages_item", + "UpdateGroqCredentialDto": ".update_groq_credential_dto", + "UpdateHandoffToolDto": ".update_handoff_tool_dto", + "UpdateHandoffToolDtoDestinationsItem": ".update_handoff_tool_dto_destinations_item", + "UpdateHandoffToolDtoMessagesItem": ".update_handoff_tool_dto_messages_item", + "UpdateHumeCredentialDto": ".update_hume_credential_dto", + "UpdateInflectionAiCredentialDto": ".update_inflection_ai_credential_dto", + "UpdateInworldCredentialDto": ".update_inworld_credential_dto", + "UpdateLangfuseCredentialDto": ".update_langfuse_credential_dto", + "UpdateLmntCredentialDto": ".update_lmnt_credential_dto", + "UpdateMakeCredentialDto": ".update_make_credential_dto", + "UpdateMakeToolDto": ".update_make_tool_dto", + "UpdateMakeToolDtoMessagesItem": ".update_make_tool_dto_messages_item", + "UpdateMcpToolDto": ".update_mcp_tool_dto", + "UpdateMcpToolDtoMessagesItem": ".update_mcp_tool_dto_messages_item", + "UpdateMistralCredentialDto": ".update_mistral_credential_dto", + "UpdateNeuphonicCredentialDto": ".update_neuphonic_credential_dto", + "UpdateOpenAiCredentialDto": ".update_open_ai_credential_dto", + "UpdateOpenRouterCredentialDto": ".update_open_router_credential_dto", + "UpdateOrgDto": ".update_org_dto", + "UpdateOrgDtoChannel": ".update_org_dto_channel", + "UpdateOutputToolDto": ".update_output_tool_dto", + "UpdateOutputToolDtoMessagesItem": ".update_output_tool_dto_messages_item", + "UpdatePerplexityAiCredentialDto": ".update_perplexity_ai_credential_dto", + "UpdatePlayHtCredentialDto": ".update_play_ht_credential_dto", + "UpdateQueryToolDto": ".update_query_tool_dto", + "UpdateQueryToolDtoMessagesItem": ".update_query_tool_dto_messages_item", + "UpdateRimeAiCredentialDto": ".update_rime_ai_credential_dto", + "UpdateRunpodCredentialDto": ".update_runpod_credential_dto", + "UpdateS3CredentialDto": ".update_s_3_credential_dto", + "UpdateSlackOAuth2AuthorizationCredentialDto": ".update_slack_o_auth_2_authorization_credential_dto", + "UpdateSlackSendMessageToolDto": ".update_slack_send_message_tool_dto", + "UpdateSlackSendMessageToolDtoMessagesItem": ".update_slack_send_message_tool_dto_messages_item", + "UpdateSmallestAiCredentialDto": ".update_smallest_ai_credential_dto", + "UpdateSmsToolDto": ".update_sms_tool_dto", + "UpdateSmsToolDtoMessagesItem": ".update_sms_tool_dto_messages_item", + "UpdateSpeechmaticsCredentialDto": ".update_speechmatics_credential_dto", + "UpdateSupabaseCredentialDto": ".update_supabase_credential_dto", + "UpdateTavusCredentialDto": ".update_tavus_credential_dto", + "UpdateTelnyxPhoneNumberDto": ".update_telnyx_phone_number_dto", + "UpdateTelnyxPhoneNumberDtoFallbackDestination": ".update_telnyx_phone_number_dto_fallback_destination", + "UpdateTelnyxPhoneNumberDtoHooksItem": ".update_telnyx_phone_number_dto_hooks_item", + "UpdateTestSuiteDto": ".update_test_suite_dto", + "UpdateTestSuiteRunDto": ".update_test_suite_run_dto", + "UpdateTestSuiteTestChatDto": ".update_test_suite_test_chat_dto", + "UpdateTestSuiteTestVoiceDto": ".update_test_suite_test_voice_dto", + "UpdateTextEditorToolDto": ".update_text_editor_tool_dto", + "UpdateTextEditorToolDtoMessagesItem": ".update_text_editor_tool_dto_messages_item", + "UpdateTogetherAiCredentialDto": ".update_together_ai_credential_dto", + "UpdateTokenDto": ".update_token_dto", + "UpdateTokenDtoTag": ".update_token_dto_tag", + "UpdateToolTemplateDto": ".update_tool_template_dto", + "UpdateToolTemplateDtoDetails": ".update_tool_template_dto_details", + "UpdateToolTemplateDtoProvider": ".update_tool_template_dto_provider", + "UpdateToolTemplateDtoProviderDetails": ".update_tool_template_dto_provider_details", + "UpdateToolTemplateDtoVisibility": ".update_tool_template_dto_visibility", + "UpdateTransferCallToolDto": ".update_transfer_call_tool_dto", + "UpdateTransferCallToolDtoDestinationsItem": ".update_transfer_call_tool_dto_destinations_item", + "UpdateTransferCallToolDtoMessagesItem": ".update_transfer_call_tool_dto_messages_item", + "UpdateTrieveCredentialDto": ".update_trieve_credential_dto", + "UpdateTrieveKnowledgeBaseDto": ".update_trieve_knowledge_base_dto", + "UpdateTwilioCredentialDto": ".update_twilio_credential_dto", + "UpdateTwilioPhoneNumberDto": ".update_twilio_phone_number_dto", + "UpdateTwilioPhoneNumberDtoFallbackDestination": ".update_twilio_phone_number_dto_fallback_destination", + "UpdateTwilioPhoneNumberDtoHooksItem": ".update_twilio_phone_number_dto_hooks_item", + "UpdateUserRoleDto": ".update_user_role_dto", + "UpdateUserRoleDtoRole": ".update_user_role_dto_role", + "UpdateVapiPhoneNumberDto": ".update_vapi_phone_number_dto", + "UpdateVapiPhoneNumberDtoFallbackDestination": ".update_vapi_phone_number_dto_fallback_destination", + "UpdateVapiPhoneNumberDtoHooksItem": ".update_vapi_phone_number_dto_hooks_item", + "UpdateVonageCredentialDto": ".update_vonage_credential_dto", + "UpdateVonagePhoneNumberDto": ".update_vonage_phone_number_dto", + "UpdateVonagePhoneNumberDtoFallbackDestination": ".update_vonage_phone_number_dto_fallback_destination", + "UpdateVonagePhoneNumberDtoHooksItem": ".update_vonage_phone_number_dto_hooks_item", + "UpdateWebhookCredentialDto": ".update_webhook_credential_dto", + "UpdateWebhookCredentialDtoAuthenticationPlan": ".update_webhook_credential_dto_authentication_plan", + "UpdateWorkflowDto": ".update_workflow_dto", + "UpdateWorkflowDtoBackgroundSound": ".update_workflow_dto_background_sound", + "UpdateWorkflowDtoBackgroundSoundZero": ".update_workflow_dto_background_sound_zero", + "UpdateWorkflowDtoCredentialsItem": ".update_workflow_dto_credentials_item", + "UpdateWorkflowDtoHooksItem": ".update_workflow_dto_hooks_item", + "UpdateWorkflowDtoModel": ".update_workflow_dto_model", + "UpdateWorkflowDtoNodesItem": ".update_workflow_dto_nodes_item", + "UpdateWorkflowDtoTranscriber": ".update_workflow_dto_transcriber", + "UpdateWorkflowDtoVoice": ".update_workflow_dto_voice", + "UpdateXAiCredentialDto": ".update_x_ai_credential_dto", + "User": ".user", + "UserMessage": ".user_message", + "VapiCost": ".vapi_cost", + "VapiCostSubType": ".vapi_cost_sub_type", + "VapiModel": ".vapi_model", + "VapiModelToolsItem": ".vapi_model_tools_item", + "VapiPhoneNumber": ".vapi_phone_number", + "VapiPhoneNumberFallbackDestination": ".vapi_phone_number_fallback_destination", + "VapiPhoneNumberHooksItem": ".vapi_phone_number_hooks_item", + "VapiPhoneNumberStatus": ".vapi_phone_number_status", + "VapiSmartEndpointingPlan": ".vapi_smart_endpointing_plan", + "VapiSmartEndpointingPlanProvider": ".vapi_smart_endpointing_plan_provider", + "VapiVoice": ".vapi_voice", + "VapiVoiceVoiceId": ".vapi_voice_voice_id", + "VapiVoicemailDetectionPlan": ".vapi_voicemail_detection_plan", + "VapiVoicemailDetectionPlanType": ".vapi_voicemail_detection_plan_type", + "VariableExtractionAlias": ".variable_extraction_alias", + "VariableExtractionPlan": ".variable_extraction_plan", + "VoiceCost": ".voice_cost", + "VoiceLibrary": ".voice_library", + "VoiceLibraryGender": ".voice_library_gender", + "VoiceLibraryVoiceResponse": ".voice_library_voice_response", + "VoicemailDetectionBackoffPlan": ".voicemail_detection_backoff_plan", + "VoicemailDetectionCost": ".voicemail_detection_cost", + "VoicemailDetectionCostProvider": ".voicemail_detection_cost_provider", + "VonageCredential": ".vonage_credential", + "VonagePhoneNumber": ".vonage_phone_number", + "VonagePhoneNumberFallbackDestination": ".vonage_phone_number_fallback_destination", + "VonagePhoneNumberHooksItem": ".vonage_phone_number_hooks_item", + "VonagePhoneNumberStatus": ".vonage_phone_number_status", + "WebChat": ".web_chat", + "WebChatOutputItem": ".web_chat_output_item", + "WebhookCredential": ".webhook_credential", + "WebhookCredentialAuthenticationPlan": ".webhook_credential_authentication_plan", + "Workflow": ".workflow", + "WorkflowAnthropicModel": ".workflow_anthropic_model", + "WorkflowAnthropicModelModel": ".workflow_anthropic_model_model", + "WorkflowBackgroundSound": ".workflow_background_sound", + "WorkflowBackgroundSoundZero": ".workflow_background_sound_zero", + "WorkflowCredentialsItem": ".workflow_credentials_item", + "WorkflowCustomModel": ".workflow_custom_model", + "WorkflowCustomModelMetadataSendMode": ".workflow_custom_model_metadata_send_mode", + "WorkflowGoogleModel": ".workflow_google_model", + "WorkflowGoogleModelModel": ".workflow_google_model_model", + "WorkflowHooksItem": ".workflow_hooks_item", + "WorkflowModel": ".workflow_model", + "WorkflowNodesItem": ".workflow_nodes_item", + "WorkflowOpenAiModel": ".workflow_open_ai_model", + "WorkflowOpenAiModelModel": ".workflow_open_ai_model_model", + "WorkflowOverrides": ".workflow_overrides", + "WorkflowTranscriber": ".workflow_transcriber", + "WorkflowUserEditable": ".workflow_user_editable", + "WorkflowUserEditableBackgroundSound": ".workflow_user_editable_background_sound", + "WorkflowUserEditableBackgroundSoundZero": ".workflow_user_editable_background_sound_zero", + "WorkflowUserEditableCredentialsItem": ".workflow_user_editable_credentials_item", + "WorkflowUserEditableHooksItem": ".workflow_user_editable_hooks_item", + "WorkflowUserEditableModel": ".workflow_user_editable_model", + "WorkflowUserEditableNodesItem": ".workflow_user_editable_nodes_item", + "WorkflowUserEditableTranscriber": ".workflow_user_editable_transcriber", + "WorkflowUserEditableVoice": ".workflow_user_editable_voice", + "WorkflowVoice": ".workflow_voice", + "XAiCredential": ".x_ai_credential", + "XaiModel": ".xai_model", + "XaiModelModel": ".xai_model_model", + "XaiModelToolsItem": ".xai_model_tools_item", + "XssSecurityFilter": ".xss_security_filter", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = [ + "AddVoiceToProviderDto", + "AiEdgeCondition", + "Analysis", + "AnalysisCost", + "AnalysisCostAnalysisType", + "AnalysisCostBreakdown", + "AnalysisPlan", + "AnalyticsOperation", + "AnalyticsOperationColumn", + "AnalyticsOperationOperation", + "AnalyticsQuery", + "AnalyticsQueryGroupByItem", + "AnalyticsQueryResult", + "AnalyticsQueryTable", + "AnthropicCredential", + "AnthropicModel", + "AnthropicModelModel", + "AnthropicModelToolsItem", + "AnthropicThinkingConfig", + "AnyscaleCredential", + "AnyscaleModel", + "AnyscaleModelToolsItem", + "ApiRequestTool", + "ApiRequestToolMessagesItem", + "ApiRequestToolMethod", + "Artifact", + "ArtifactMessagesItem", + "ArtifactPlan", + "ArtifactPlanRecordingFormat", + "AssemblyAiCredential", + "AssemblyAiTranscriber", + "Assistant", + "AssistantBackgroundSound", + "AssistantBackgroundSoundZero", + "AssistantClientMessagesItem", + "AssistantCredentialsItem", + "AssistantCustomEndpointingRule", + "AssistantFirstMessageMode", + "AssistantHookAssistantSpeechInterrupted", + "AssistantHookCallEnding", + "AssistantHookCustomerSpeechInterrupted", + "AssistantHooksItem", + "AssistantMessage", + "AssistantModel", + "AssistantOverrides", + "AssistantOverridesBackgroundSound", + "AssistantOverridesBackgroundSoundZero", + "AssistantOverridesClientMessagesItem", + "AssistantOverridesCredentialsItem", + "AssistantOverridesFirstMessageMode", + "AssistantOverridesHooksItem", + "AssistantOverridesModel", + "AssistantOverridesServerMessagesItem", + "AssistantOverridesTranscriber", + "AssistantOverridesVoice", + "AssistantOverridesVoicemailDetection", + "AssistantPaginatedResponse", + "AssistantServerMessagesItem", + "AssistantTranscriber", + "AssistantUserEditable", + "AssistantVersionPaginatedResponse", + "AssistantVoice", + "AssistantVoicemailDetection", + "AutoReloadPlan", + "AzureBlobStorageBucketPlan", + "AzureCredential", + "AzureCredentialRegion", + "AzureCredentialService", + "AzureOpenAiCredential", + "AzureOpenAiCredentialModelsItem", + "AzureOpenAiCredentialRegion", + "AzureSpeechTranscriber", + "AzureSpeechTranscriberLanguage", + "AzureSpeechTranscriberSegmentationStrategy", + "AzureVoice", + "AzureVoiceId", + "AzureVoiceIdEnum", + "BackgroundSpeechDenoisingPlan", + "BackoffPlan", + "BashTool", + "BashToolMessagesItem", + "BashToolWithToolCall", + "BashToolWithToolCallMessagesItem", + "BearerAuthenticationPlan", + "BotMessage", + "BothCustomEndpointingRule", + "BucketPlan", + "ByoPhoneNumber", + "ByoPhoneNumberFallbackDestination", + "ByoPhoneNumberHooksItem", + "ByoPhoneNumberStatus", + "ByoSipTrunkCredential", + "Call", + "CallBatchError", + "CallBatchResponse", + "CallCostsItem", + "CallDestination", + "CallEndedReason", + "CallHookAssistantSpeechInterrupted", + "CallHookAssistantSpeechInterruptedDoItem", + "CallHookCallEnding", + "CallHookCustomerSpeechInterrupted", + "CallHookCustomerSpeechInterruptedDoItem", + "CallHookCustomerSpeechTimeout", + "CallHookCustomerSpeechTimeoutDoItem", + "CallHookFilter", + "CallMessagesItem", + "CallPaginatedResponse", + "CallPhoneCallProvider", + "CallPhoneCallTransport", + "CallStatus", + "CallType", + "Campaign", + "CampaignEndedReason", + "CampaignPaginatedResponse", + "CampaignStatus", + "CartesiaCredential", + "CartesiaExperimentalControls", + "CartesiaExperimentalControlsEmotion", + "CartesiaExperimentalControlsSpeed", + "CartesiaSpeedControl", + "CartesiaTranscriber", + "CartesiaTranscriberLanguage", + "CartesiaVoice", + "CartesiaVoiceLanguage", + "CartesiaVoiceModel", + "CerebrasCredential", + "CerebrasModel", + "CerebrasModelModel", + "CerebrasModelToolsItem", + "Chat", + "ChatAssistantOverrides", + "ChatCost", + "ChatCostsItem", + "ChatInput", + "ChatInputItem", + "ChatMessagesItem", + "ChatOutputItem", + "ChatPaginatedResponse", + "ChunkPlan", + "ClientInboundMessage", + "ClientInboundMessageAddMessage", + "ClientInboundMessageControl", + "ClientInboundMessageControlControl", + "ClientInboundMessageEndCall", + "ClientInboundMessageMessage", + "ClientInboundMessageSay", + "ClientInboundMessageTransfer", + "ClientInboundMessageTransferDestination", + "ClientMessage", + "ClientMessageChatCreated", + "ClientMessageChatCreatedPhoneNumber", + "ClientMessageChatDeleted", + "ClientMessageChatDeletedPhoneNumber", + "ClientMessageConversationUpdate", + "ClientMessageConversationUpdateMessagesItem", + "ClientMessageConversationUpdatePhoneNumber", + "ClientMessageHang", + "ClientMessageHangPhoneNumber", + "ClientMessageLanguageChangeDetected", + "ClientMessageLanguageChangeDetectedPhoneNumber", + "ClientMessageMessage", + "ClientMessageMetadata", + "ClientMessageMetadataPhoneNumber", + "ClientMessageModelOutput", + "ClientMessageModelOutputPhoneNumber", + "ClientMessageSessionCreated", + "ClientMessageSessionCreatedPhoneNumber", + "ClientMessageSessionDeleted", + "ClientMessageSessionDeletedPhoneNumber", + "ClientMessageSessionUpdated", + "ClientMessageSessionUpdatedPhoneNumber", + "ClientMessageSpeechUpdate", + "ClientMessageSpeechUpdatePhoneNumber", + "ClientMessageSpeechUpdateRole", + "ClientMessageSpeechUpdateStatus", + "ClientMessageToolCalls", + "ClientMessageToolCallsPhoneNumber", + "ClientMessageToolCallsResult", + "ClientMessageToolCallsResultPhoneNumber", + "ClientMessageToolCallsToolWithToolCallListItem", + "ClientMessageTranscript", + "ClientMessageTranscriptPhoneNumber", + "ClientMessageTranscriptRole", + "ClientMessageTranscriptTranscriptType", + "ClientMessageTranscriptType", + "ClientMessageTransferUpdate", + "ClientMessageTransferUpdateDestination", + "ClientMessageTransferUpdatePhoneNumber", + "ClientMessageUserInterrupted", + "ClientMessageUserInterruptedPhoneNumber", + "ClientMessageVoiceInput", + "ClientMessageVoiceInputPhoneNumber", + "ClientMessageWorkflowNodeStarted", + "ClientMessageWorkflowNodeStartedPhoneNumber", + "CloneVoiceDto", + "CloudflareCredential", + "CloudflareR2BucketPlan", + "CompliancePlan", + "ComputerTool", + "ComputerToolMessagesItem", + "ComputerToolWithToolCall", + "ComputerToolWithToolCallMessagesItem", + "Condition", + "ConditionOperator", + "ContextEngineeringPlanAll", + "ContextEngineeringPlanLastNMessages", + "ContextEngineeringPlanNone", + "ConversationNode", + "ConversationNodeModel", + "ConversationNodeToolsItem", + "ConversationNodeTranscriber", + "ConversationNodeVoice", + "CostBreakdown", + "CreateAnthropicCredentialDto", + "CreateAnyscaleCredentialDto", + "CreateApiRequestToolDto", + "CreateApiRequestToolDtoMessagesItem", + "CreateApiRequestToolDtoMethod", + "CreateAssemblyAiCredentialDto", + "CreateAssistantDto", + "CreateAssistantDtoBackgroundSound", + "CreateAssistantDtoBackgroundSoundZero", + "CreateAssistantDtoClientMessagesItem", + "CreateAssistantDtoCredentialsItem", + "CreateAssistantDtoFirstMessageMode", + "CreateAssistantDtoHooksItem", + "CreateAssistantDtoModel", + "CreateAssistantDtoServerMessagesItem", + "CreateAssistantDtoTranscriber", + "CreateAssistantDtoVoice", + "CreateAssistantDtoVoicemailDetection", + "CreateAzureCredentialDto", + "CreateAzureCredentialDtoRegion", + "CreateAzureCredentialDtoService", + "CreateAzureOpenAiCredentialDto", + "CreateAzureOpenAiCredentialDtoModelsItem", + "CreateAzureOpenAiCredentialDtoRegion", + "CreateBashToolDto", + "CreateBashToolDtoMessagesItem", + "CreateByoPhoneNumberDto", + "CreateByoPhoneNumberDtoFallbackDestination", + "CreateByoPhoneNumberDtoHooksItem", + "CreateByoSipTrunkCredentialDto", + "CreateCartesiaCredentialDto", + "CreateCerebrasCredentialDto", + "CreateChatStreamResponse", + "CreateCloudflareCredentialDto", + "CreateComputerToolDto", + "CreateComputerToolDtoMessagesItem", + "CreateCustomCredentialDto", + "CreateCustomCredentialDtoAuthenticationPlan", + "CreateCustomKnowledgeBaseDto", + "CreateCustomLlmCredentialDto", + "CreateCustomerDto", + "CreateDeepInfraCredentialDto", + "CreateDeepSeekCredentialDto", + "CreateDeepgramCredentialDto", + "CreateDtmfToolDto", + "CreateDtmfToolDtoMessagesItem", + "CreateElevenLabsCredentialDto", + "CreateEndCallToolDto", + "CreateEndCallToolDtoMessagesItem", + "CreateFunctionToolDto", + "CreateFunctionToolDtoMessagesItem", + "CreateGcpCredentialDto", + "CreateGhlToolDto", + "CreateGhlToolDtoMessagesItem", + "CreateGladiaCredentialDto", + "CreateGoHighLevelCalendarAvailabilityToolDto", + "CreateGoHighLevelCalendarAvailabilityToolDtoMessagesItem", + "CreateGoHighLevelCalendarEventCreateToolDto", + "CreateGoHighLevelCalendarEventCreateToolDtoMessagesItem", + "CreateGoHighLevelContactCreateToolDto", + "CreateGoHighLevelContactCreateToolDtoMessagesItem", + "CreateGoHighLevelContactGetToolDto", + "CreateGoHighLevelContactGetToolDtoMessagesItem", + "CreateGoHighLevelCredentialDto", + "CreateGoHighLevelMcpCredentialDto", + "CreateGoogleCalendarCheckAvailabilityToolDto", + "CreateGoogleCalendarCheckAvailabilityToolDtoMessagesItem", + "CreateGoogleCalendarCreateEventToolDto", + "CreateGoogleCalendarCreateEventToolDtoMessagesItem", + "CreateGoogleCalendarOAuth2AuthorizationCredentialDto", + "CreateGoogleCalendarOAuth2ClientCredentialDto", + "CreateGoogleCredentialDto", + "CreateGoogleSheetsOAuth2AuthorizationCredentialDto", + "CreateGoogleSheetsRowAppendToolDto", + "CreateGoogleSheetsRowAppendToolDtoMessagesItem", + "CreateGroqCredentialDto", + "CreateHandoffToolDto", + "CreateHandoffToolDtoDestinationsItem", + "CreateHandoffToolDtoMessagesItem", + "CreateHumeCredentialDto", + "CreateInflectionAiCredentialDto", + "CreateInworldCredentialDto", + "CreateLangfuseCredentialDto", + "CreateLmntCredentialDto", + "CreateMakeCredentialDto", + "CreateMakeToolDto", + "CreateMakeToolDtoMessagesItem", + "CreateMcpToolDto", + "CreateMcpToolDtoMessagesItem", + "CreateMinimaxCredentialDto", + "CreateMistralCredentialDto", + "CreateNeuphonicCredentialDto", + "CreateOpenAiCredentialDto", + "CreateOpenRouterCredentialDto", + "CreateOrgDto", + "CreateOrgDtoChannel", + "CreateOutboundCallDto", + "CreateOutputToolDto", + "CreateOutputToolDtoMessagesItem", + "CreatePerplexityAiCredentialDto", + "CreatePlayHtCredentialDto", + "CreateQueryToolDto", + "CreateQueryToolDtoMessagesItem", + "CreateRimeAiCredentialDto", + "CreateRunpodCredentialDto", + "CreateS3CredentialDto", + "CreateSesameVoiceDto", + "CreateSlackOAuth2AuthorizationCredentialDto", + "CreateSlackSendMessageToolDto", + "CreateSlackSendMessageToolDtoMessagesItem", + "CreateSmallestAiCredentialDto", + "CreateSmsToolDto", + "CreateSmsToolDtoMessagesItem", + "CreateSpeechmaticsCredentialDto", + "CreateSquadDto", + "CreateSupabaseCredentialDto", + "CreateTavusCredentialDto", + "CreateTelnyxPhoneNumberDto", + "CreateTelnyxPhoneNumberDtoFallbackDestination", + "CreateTelnyxPhoneNumberDtoHooksItem", + "CreateTestSuiteDto", + "CreateTestSuiteRunDto", + "CreateTestSuiteTestChatDto", + "CreateTestSuiteTestVoiceDto", + "CreateTextEditorToolDto", + "CreateTextEditorToolDtoMessagesItem", + "CreateTogetherAiCredentialDto", + "CreateTokenDto", + "CreateTokenDtoTag", + "CreateToolTemplateDto", + "CreateToolTemplateDtoDetails", + "CreateToolTemplateDtoProvider", + "CreateToolTemplateDtoProviderDetails", + "CreateToolTemplateDtoVisibility", + "CreateTransferCallToolDto", + "CreateTransferCallToolDtoDestinationsItem", + "CreateTransferCallToolDtoMessagesItem", + "CreateTrieveCredentialDto", + "CreateTrieveKnowledgeBaseDto", + "CreateTwilioCredentialDto", + "CreateTwilioPhoneNumberDto", + "CreateTwilioPhoneNumberDtoFallbackDestination", + "CreateTwilioPhoneNumberDtoHooksItem", + "CreateVapiPhoneNumberDto", + "CreateVapiPhoneNumberDtoFallbackDestination", + "CreateVapiPhoneNumberDtoHooksItem", + "CreateVoicemailToolDto", + "CreateVoicemailToolDtoMessagesItem", + "CreateVonageCredentialDto", + "CreateVonagePhoneNumberDto", + "CreateVonagePhoneNumberDtoFallbackDestination", + "CreateVonagePhoneNumberDtoHooksItem", + "CreateWebCallDto", + "CreateWebChatDto", + "CreateWebChatDtoInput", + "CreateWebChatDtoInputItem", + "CreateWebCustomerDto", + "CreateWebhookCredentialDto", + "CreateWebhookCredentialDtoAuthenticationPlan", + "CreateWorkflowDto", + "CreateWorkflowDtoBackgroundSound", + "CreateWorkflowDtoBackgroundSoundZero", + "CreateWorkflowDtoCredentialsItem", + "CreateWorkflowDtoHooksItem", + "CreateWorkflowDtoModel", + "CreateWorkflowDtoNodesItem", + "CreateWorkflowDtoTranscriber", + "CreateWorkflowDtoVoice", + "CreateXAiCredentialDto", + "CredentialActionRequest", + "CredentialEndUser", + "CredentialSessionDto", + "CredentialSessionDtoProvider", + "CredentialSessionError", + "CredentialSessionResponse", + "CredentialWebhookDto", + "CredentialWebhookDtoAuthMode", + "CredentialWebhookDtoOperation", + "CredentialWebhookDtoType", + "CustomCredential", + "CustomCredentialAuthenticationPlan", + "CustomEndpointingModelSmartEndpointingPlan", + "CustomEndpointingModelSmartEndpointingPlanProvider", + "CustomKnowledgeBase", + "CustomLlmCredential", + "CustomLlmModel", + "CustomLlmModelMetadataSendMode", + "CustomLlmModelToolsItem", + "CustomMessage", + "CustomTranscriber", + "CustomVoice", + "CustomerCustomEndpointingRule", + "CustomerSpeechTimeoutOptions", + "DeepInfraCredential", + "DeepInfraModel", + "DeepInfraModelToolsItem", + "DeepSeekCredential", + "DeepSeekModel", + "DeepSeekModelModel", + "DeepSeekModelToolsItem", + "DeepgramCredential", + "DeepgramTranscriber", + "DeepgramTranscriberLanguage", + "DeepgramTranscriberModel", + "DeepgramVoice", + "DeepgramVoiceId", + "DeepgramVoiceModel", + "DeveloperMessage", + "DtmfTool", + "DtmfToolMessagesItem", + "Edge", + "ElevenLabsCredential", + "ElevenLabsPronunciationDictionary", + "ElevenLabsPronunciationDictionaryLocator", + "ElevenLabsPronunciationDictionaryPermissionOnResource", + "ElevenLabsTranscriber", + "ElevenLabsTranscriberLanguage", + "ElevenLabsVoice", + "ElevenLabsVoiceId", + "ElevenLabsVoiceIdEnum", + "ElevenLabsVoiceModel", + "EndCallTool", + "EndCallToolMessagesItem", + "ExactReplacement", + "FailedEdgeCondition", + "FallbackAssemblyAiTranscriber", + "FallbackAzureSpeechTranscriber", + "FallbackAzureSpeechTranscriberLanguage", + "FallbackAzureSpeechTranscriberSegmentationStrategy", + "FallbackAzureVoice", + "FallbackAzureVoiceId", + "FallbackAzureVoiceVoiceId", + "FallbackCartesiaTranscriber", + "FallbackCartesiaTranscriberLanguage", + "FallbackCartesiaVoice", + "FallbackCartesiaVoiceLanguage", + "FallbackCartesiaVoiceModel", + "FallbackCustomTranscriber", + "FallbackCustomVoice", + "FallbackDeepgramTranscriber", + "FallbackDeepgramTranscriberLanguage", + "FallbackDeepgramTranscriberModel", + "FallbackDeepgramVoice", + "FallbackDeepgramVoiceId", + "FallbackDeepgramVoiceModel", + "FallbackElevenLabsTranscriber", + "FallbackElevenLabsTranscriberLanguage", + "FallbackElevenLabsVoice", + "FallbackElevenLabsVoiceId", + "FallbackElevenLabsVoiceIdEnum", + "FallbackElevenLabsVoiceModel", + "FallbackGladiaTranscriber", + "FallbackGladiaTranscriberLanguage", + "FallbackGladiaTranscriberLanguageBehaviour", + "FallbackGladiaTranscriberLanguages", + "FallbackGladiaTranscriberModel", + "FallbackGoogleTranscriber", + "FallbackGoogleTranscriberLanguage", + "FallbackGoogleTranscriberModel", + "FallbackHumeVoice", + "FallbackInworldVoice", + "FallbackInworldVoiceLanguageCode", + "FallbackInworldVoiceVoiceId", + "FallbackLmntVoice", + "FallbackLmntVoiceId", + "FallbackLmntVoiceIdEnum", + "FallbackLmntVoiceLanguage", + "FallbackMinimaxVoice", + "FallbackMinimaxVoiceModel", + "FallbackMinimaxVoiceRegion", + "FallbackNeetsVoice", + "FallbackNeuphonicVoice", + "FallbackNeuphonicVoiceModel", + "FallbackOpenAiTranscriber", + "FallbackOpenAiTranscriberLanguage", + "FallbackOpenAiTranscriberModel", + "FallbackOpenAiVoice", + "FallbackOpenAiVoiceId", + "FallbackOpenAiVoiceIdEnum", + "FallbackOpenAiVoiceModel", + "FallbackPlan", + "FallbackPlanVoicesItem", + "FallbackPlayHtVoice", + "FallbackPlayHtVoiceEmotion", + "FallbackPlayHtVoiceId", + "FallbackPlayHtVoiceIdEnum", + "FallbackPlayHtVoiceLanguage", + "FallbackPlayHtVoiceModel", + "FallbackRimeAiVoice", + "FallbackRimeAiVoiceId", + "FallbackRimeAiVoiceIdEnum", + "FallbackRimeAiVoiceModel", + "FallbackSesameVoice", + "FallbackSmallestAiVoice", + "FallbackSmallestAiVoiceId", + "FallbackSmallestAiVoiceIdEnum", + "FallbackSpeechmaticsTranscriber", + "FallbackSpeechmaticsTranscriberLanguage", + "FallbackTalkscriberTranscriber", + "FallbackTalkscriberTranscriberLanguage", + "FallbackTavusVoice", + "FallbackTavusVoiceVoiceId", + "FallbackTranscriberPlan", + "FallbackTranscriberPlanTranscribersItem", + "FallbackVapiVoice", + "FallbackVapiVoiceVoiceId", + "File", + "FileStatus", + "FormatPlan", + "FormatPlanFormattersEnabledItem", + "FormatPlanReplacementsItem", + "FourierDenoisingPlan", + "FunctionCall", + "FunctionCallAssistantHookAction", + "FunctionCallHookAction", + "FunctionCallHookActionMessagesItem", + "FunctionTool", + "FunctionToolMessagesItem", + "FunctionToolProviderDetails", + "FunctionToolWithToolCall", + "FunctionToolWithToolCallMessagesItem", + "GcpCredential", + "GcpKey", + "GeminiMultimodalLivePrebuiltVoiceConfig", + "GeminiMultimodalLivePrebuiltVoiceConfigVoiceName", + "GeminiMultimodalLiveSpeechConfig", + "GeminiMultimodalLiveVoiceConfig", + "GetChatPaginatedDto", + "GetChatPaginatedDtoSortOrder", + "GetSessionPaginatedDto", + "GetSessionPaginatedDtoSortOrder", + "GhlTool", + "GhlToolMessagesItem", + "GhlToolMetadata", + "GhlToolProviderDetails", + "GhlToolWithToolCall", + "GhlToolWithToolCallMessagesItem", + "GladiaCredential", + "GladiaCustomVocabularyConfigDto", + "GladiaCustomVocabularyConfigDtoVocabularyItem", + "GladiaTranscriber", + "GladiaTranscriberLanguage", + "GladiaTranscriberLanguageBehaviour", + "GladiaTranscriberLanguages", + "GladiaTranscriberModel", + "GladiaVocabularyItemDto", + "GlobalNodePlan", + "GoHighLevelCalendarAvailabilityTool", + "GoHighLevelCalendarAvailabilityToolMessagesItem", + "GoHighLevelCalendarAvailabilityToolProviderDetails", + "GoHighLevelCalendarAvailabilityToolWithToolCall", + "GoHighLevelCalendarAvailabilityToolWithToolCallMessagesItem", + "GoHighLevelCalendarEventCreateTool", + "GoHighLevelCalendarEventCreateToolMessagesItem", + "GoHighLevelCalendarEventCreateToolProviderDetails", + "GoHighLevelCalendarEventCreateToolWithToolCall", + "GoHighLevelCalendarEventCreateToolWithToolCallMessagesItem", + "GoHighLevelContactCreateTool", + "GoHighLevelContactCreateToolMessagesItem", + "GoHighLevelContactCreateToolProviderDetails", + "GoHighLevelContactCreateToolWithToolCall", + "GoHighLevelContactCreateToolWithToolCallMessagesItem", + "GoHighLevelContactGetTool", + "GoHighLevelContactGetToolMessagesItem", + "GoHighLevelContactGetToolProviderDetails", + "GoHighLevelContactGetToolWithToolCall", + "GoHighLevelContactGetToolWithToolCallMessagesItem", + "GoHighLevelCredential", + "GoHighLevelMcpCredential", + "GoogleCalendarCheckAvailabilityTool", + "GoogleCalendarCheckAvailabilityToolMessagesItem", + "GoogleCalendarCreateEventTool", + "GoogleCalendarCreateEventToolMessagesItem", + "GoogleCalendarCreateEventToolProviderDetails", + "GoogleCalendarCreateEventToolWithToolCall", + "GoogleCalendarCreateEventToolWithToolCallMessagesItem", + "GoogleCalendarOAuth2AuthorizationCredential", + "GoogleCalendarOAuth2ClientCredential", + "GoogleCredential", + "GoogleModel", + "GoogleModelModel", + "GoogleModelToolsItem", + "GoogleRealtimeConfig", + "GoogleSheetsOAuth2AuthorizationCredential", + "GoogleSheetsRowAppendTool", + "GoogleSheetsRowAppendToolMessagesItem", + "GoogleSheetsRowAppendToolProviderDetails", + "GoogleSheetsRowAppendToolWithToolCall", + "GoogleSheetsRowAppendToolWithToolCallMessagesItem", + "GoogleTranscriber", + "GoogleTranscriberLanguage", + "GoogleTranscriberModel", + "GoogleVoicemailDetectionPlan", + "GoogleVoicemailDetectionPlanType", + "GroqCredential", + "GroqModel", + "GroqModelModel", + "GroqModelToolsItem", + "GroupCondition", + "GroupConditionConditionsItem", + "GroupConditionOperator", + "HandoffDestinationAssistant", + "HandoffDestinationAssistantContextEngineeringPlan", + "HandoffDestinationDynamic", + "HandoffTool", + "HandoffToolDestinationsItem", + "HandoffToolMessagesItem", + "HangupNode", + "HmacAuthenticationPlan", + "HmacAuthenticationPlanAlgorithm", + "HmacAuthenticationPlanSignatureEncoding", + "HumeCredential", + "HumeVoice", + "ImportTwilioPhoneNumberDto", + "ImportTwilioPhoneNumberDtoFallbackDestination", + "ImportTwilioPhoneNumberDtoHooksItem", + "ImportVonagePhoneNumberDto", + "ImportVonagePhoneNumberDtoFallbackDestination", + "ImportVonagePhoneNumberDtoHooksItem", + "InflectionAiCredential", + "InflectionAiModel", + "InflectionAiModelToolsItem", + "InviteUserDto", + "InviteUserDtoRole", + "InvoicePlan", + "InworldCredential", + "InworldVoice", + "InworldVoiceLanguageCode", + "InworldVoiceVoiceId", + "JsonSchema", + "JsonSchemaFormat", + "JsonSchemaType", + "JwtResponse", + "KeypadInputPlan", + "KeypadInputPlanDelimiters", + "KnowledgeBase", + "KnowledgeBaseCost", + "KnowledgeBaseModel", + "KnowledgeBaseResponseDocument", + "LangfuseCredential", + "LangfuseObservabilityPlan", + "LiquidCondition", + "LivekitSmartEndpointingPlan", + "LivekitSmartEndpointingPlanProvider", + "LmntCredential", + "LmntVoice", + "LmntVoiceId", + "LmntVoiceIdEnum", + "LmntVoiceLanguage", + "LogicEdgeCondition", + "MakeCredential", + "MakeTool", + "MakeToolMessagesItem", + "MakeToolMetadata", + "MakeToolProviderDetails", + "MakeToolWithToolCall", + "MakeToolWithToolCallMessagesItem", + "McpTool", + "McpToolMessagesItem", + "McpToolMetadata", + "McpToolMetadataProtocol", + "MessageTarget", + "MessageTargetRole", + "MinimaxVoice", + "MinimaxVoiceModel", + "MinimaxVoiceRegion", + "MistralCredential", + "ModelCost", + "Monitor", + "MonitorPlan", + "Mono", + "NeetsVoice", + "NeuphonicCredential", + "NeuphonicVoice", + "NeuphonicVoiceModel", + "NodeArtifact", + "NodeArtifactMessagesItem", + "OAuth2AuthenticationPlan", + "Oauth2AuthenticationSession", + "OpenAiCredential", + "OpenAiFunction", + "OpenAiFunctionParameters", + "OpenAiMessage", + "OpenAiMessageRole", + "OpenAiModel", + "OpenAiModelFallbackModelsItem", + "OpenAiModelModel", + "OpenAiModelToolStrictCompatibilityMode", + "OpenAiModelToolsItem", + "OpenAiTranscriber", + "OpenAiTranscriberLanguage", + "OpenAiTranscriberModel", + "OpenAiVoice", + "OpenAiVoiceId", + "OpenAiVoiceIdEnum", + "OpenAiVoiceModel", + "OpenAiVoicemailDetectionPlan", + "OpenAiVoicemailDetectionPlanType", + "OpenAiWebChatRequest", + "OpenAiWebChatRequestInput", + "OpenAiWebChatRequestInputItem", + "OpenRouterCredential", + "OpenRouterModel", + "OpenRouterModelToolsItem", + "Org", + "OrgChannel", + "OutputTool", + "OutputToolMessagesItem", + "PaginationMeta", + "PerformanceMetrics", + "PerplexityAiCredential", + "PerplexityAiModel", + "PerplexityAiModelToolsItem", + "PhoneNumberCallEndingHookFilter", + "PhoneNumberCallEndingHookFilterOneOfItem", + "PhoneNumberHookCallEnding", + "PhoneNumberHookCallEndingDo", + "PhoneNumberHookCallRinging", + "PhoneNumberHookCallRingingDoItem", + "PhoneNumberPaginatedResponse", + "PhoneNumberPaginatedResponseResultsItem", + "PlayHtCredential", + "PlayHtVoice", + "PlayHtVoiceEmotion", + "PlayHtVoiceId", + "PlayHtVoiceIdEnum", + "PlayHtVoiceLanguage", + "PlayHtVoiceModel", + "PromptInjectionSecurityFilter", + "ProviderResource", + "ProviderResourcePaginatedResponse", + "PunctuationBoundary", + "QueryTool", + "QueryToolMessagesItem", + "RceSecurityFilter", + "Recording", + "RegexCondition", + "RegexOption", + "RegexOptionType", + "RegexReplacement", + "RegexSecurityFilter", + "ResponseCompletedEvent", + "ResponseErrorEvent", + "ResponseObject", + "ResponseObjectStatus", + "ResponseOutputMessage", + "ResponseOutputMessageStatus", + "ResponseOutputText", + "ResponseTextDeltaEvent", + "ResponseTextDoneEvent", + "RimeAiCredential", + "RimeAiVoice", + "RimeAiVoiceId", + "RimeAiVoiceIdEnum", + "RimeAiVoiceModel", + "RunpodCredential", + "S3Credential", + "SayAssistantHookAction", + "SayHookAction", + "SayHookActionPrompt", + "SayHookActionPromptItem", + "SayPhoneNumberHookAction", + "SbcConfiguration", + "SchedulePlan", + "SecurityFilterBase", + "SecurityFilterPlan", + "SecurityFilterPlanMode", + "Server", + "ServerMessage", + "ServerMessageAssistantRequest", + "ServerMessageAssistantRequestPhoneNumber", + "ServerMessageCallEndpointingRequest", + "ServerMessageCallEndpointingRequestMessagesItem", + "ServerMessageCallEndpointingRequestPhoneNumber", + "ServerMessageChatCreated", + "ServerMessageChatCreatedPhoneNumber", + "ServerMessageChatDeleted", + "ServerMessageChatDeletedPhoneNumber", + "ServerMessageConversationUpdate", + "ServerMessageConversationUpdateMessagesItem", + "ServerMessageConversationUpdatePhoneNumber", + "ServerMessageEndOfCallReport", + "ServerMessageEndOfCallReportCostsItem", + "ServerMessageEndOfCallReportEndedReason", + "ServerMessageEndOfCallReportPhoneNumber", + "ServerMessageHang", + "ServerMessageHangPhoneNumber", + "ServerMessageKnowledgeBaseRequest", + "ServerMessageKnowledgeBaseRequestMessagesItem", + "ServerMessageKnowledgeBaseRequestPhoneNumber", + "ServerMessageLanguageChangeDetected", + "ServerMessageLanguageChangeDetectedPhoneNumber", + "ServerMessageMessage", + "ServerMessageModelOutput", + "ServerMessageModelOutputPhoneNumber", + "ServerMessagePhoneCallControl", + "ServerMessagePhoneCallControlDestination", + "ServerMessagePhoneCallControlPhoneNumber", + "ServerMessagePhoneCallControlRequest", + "ServerMessageResponse", + "ServerMessageResponseAssistantRequest", + "ServerMessageResponseAssistantRequestDestination", + "ServerMessageResponseCallEndpointingRequest", + "ServerMessageResponseHandoffDestinationRequest", + "ServerMessageResponseKnowledgeBaseRequest", + "ServerMessageResponseMessageResponse", + "ServerMessageResponseToolCalls", + "ServerMessageResponseTransferDestinationRequest", + "ServerMessageResponseTransferDestinationRequestDestination", + "ServerMessageResponseTransferDestinationRequestMessage", + "ServerMessageResponseVoiceRequest", + "ServerMessageSessionCreated", + "ServerMessageSessionCreatedPhoneNumber", + "ServerMessageSessionDeleted", + "ServerMessageSessionDeletedPhoneNumber", + "ServerMessageSessionUpdated", + "ServerMessageSessionUpdatedPhoneNumber", + "ServerMessageSpeechUpdate", + "ServerMessageSpeechUpdatePhoneNumber", + "ServerMessageSpeechUpdateRole", + "ServerMessageSpeechUpdateStatus", + "ServerMessageStatusUpdate", + "ServerMessageStatusUpdateDestination", + "ServerMessageStatusUpdateEndedReason", + "ServerMessageStatusUpdateMessagesItem", + "ServerMessageStatusUpdatePhoneNumber", + "ServerMessageStatusUpdateStatus", + "ServerMessageToolCalls", + "ServerMessageToolCallsPhoneNumber", + "ServerMessageToolCallsToolWithToolCallListItem", + "ServerMessageTranscript", + "ServerMessageTranscriptPhoneNumber", + "ServerMessageTranscriptRole", + "ServerMessageTranscriptTranscriptType", + "ServerMessageTranscriptType", + "ServerMessageTransferDestinationRequest", + "ServerMessageTransferDestinationRequestPhoneNumber", + "ServerMessageTransferUpdate", + "ServerMessageTransferUpdateDestination", + "ServerMessageTransferUpdatePhoneNumber", + "ServerMessageUserInterrupted", + "ServerMessageUserInterruptedPhoneNumber", + "ServerMessageVoiceInput", + "ServerMessageVoiceInputPhoneNumber", + "ServerMessageVoiceRequest", + "ServerMessageVoiceRequestPhoneNumber", + "SesameVoice", + "Session", + "SessionMessagesItem", + "SessionPaginatedResponse", + "SessionStatus", + "SipAuthentication", + "SipTrunkGateway", + "SipTrunkGatewayOutboundProtocol", + "SipTrunkOutboundAuthenticationPlan", + "SipTrunkOutboundSipRegisterPlan", + "SlackOAuth2AuthorizationCredential", + "SlackSendMessageTool", + "SlackSendMessageToolMessagesItem", + "SmallestAiCredential", + "SmallestAiVoice", + "SmallestAiVoiceId", + "SmallestAiVoiceIdEnum", + "SmartDenoisingPlan", + "SmsTool", + "SmsToolMessagesItem", + "SpeechmaticsCredential", + "SpeechmaticsTranscriber", + "SpeechmaticsTranscriberLanguage", + "SqlInjectionSecurityFilter", + "Squad", + "SquadMemberDto", + "SquadMemberDtoAssistantDestinationsItem", + "SsrfSecurityFilter", + "StartSpeakingPlan", + "StartSpeakingPlanCustomEndpointingRulesItem", + "StartSpeakingPlanSmartEndpointingEnabled", + "StartSpeakingPlanSmartEndpointingPlan", + "StopSpeakingPlan", + "StructuredDataMultiPlan", + "StructuredDataPlan", + "StructuredOutput", + "StructuredOutputModel", + "StructuredOutputPaginatedResponse", + "Subscription", + "SubscriptionMinutesIncludedResetFrequency", + "SubscriptionStatus", + "SubscriptionType", + "SuccessEvaluationPlan", + "SuccessEvaluationPlanRubric", + "SummaryPlan", + "SupabaseBucketPlan", + "SupabaseBucketPlanRegion", + "SupabaseCredential", + "SyncVoiceLibraryDto", + "SyncVoiceLibraryDtoProvidersItem", + "SystemMessage", + "TalkscriberTranscriber", + "TalkscriberTranscriberLanguage", + "TargetPlan", + "TavusConversationProperties", + "TavusCredential", + "TavusVoice", + "TavusVoiceVoiceId", + "TelnyxPhoneNumber", + "TelnyxPhoneNumberFallbackDestination", + "TelnyxPhoneNumberHooksItem", + "TelnyxPhoneNumberStatus", + "Template", + "TemplateDetails", + "TemplateProvider", + "TemplateProviderDetails", + "TemplateVisibility", + "TestSuite", + "TestSuitePhoneNumber", + "TestSuiteRun", + "TestSuiteRunScorerAi", + "TestSuiteRunScorerAiResult", + "TestSuiteRunStatus", + "TestSuiteRunTestAttempt", + "TestSuiteRunTestAttemptCall", + "TestSuiteRunTestAttemptMetadata", + "TestSuiteRunTestResult", + "TestSuiteRunsPaginatedResponse", + "TestSuiteTestChat", + "TestSuiteTestScorerAi", + "TestSuiteTestVoice", + "TestSuiteTestsPaginatedResponse", + "TestSuiteTestsPaginatedResponseResultsItem", + "TestSuitesPaginatedResponse", + "TesterPlan", + "TextContent", + "TextContentLanguage", + "TextEditorTool", + "TextEditorToolMessagesItem", + "TextEditorToolWithToolCall", + "TextEditorToolWithToolCallMessagesItem", + "TimeRange", + "TimeRangeStep", + "TogetherAiCredential", + "TogetherAiModel", + "TogetherAiModelToolsItem", + "Token", + "TokenRestrictions", + "TokenTag", + "ToolCall", + "ToolCallFunction", + "ToolCallHookAction", + "ToolCallHookActionTool", + "ToolCallMessage", + "ToolCallResult", + "ToolCallResultMessage", + "ToolMessage", + "ToolMessageComplete", + "ToolMessageCompleteRole", + "ToolMessageDelayed", + "ToolMessageFailed", + "ToolMessageStart", + "ToolNode", + "ToolNodeTool", + "ToolRejectionPlan", + "ToolRejectionPlanConditionsItem", + "ToolTemplateMetadata", + "ToolTemplateSetup", + "TranscriberCost", + "TranscriptPlan", + "TranscriptionEndpointingPlan", + "TransferAssistant", + "TransferAssistantFirstMessageMode", + "TransferAssistantHookAction", + "TransferAssistantModel", + "TransferAssistantModelProvider", + "TransferCallTool", + "TransferCallToolDestinationsItem", + "TransferCallToolMessagesItem", + "TransferCancelToolUserEditable", + "TransferCancelToolUserEditableMessagesItem", + "TransferDestinationAssistant", + "TransferDestinationAssistantMessage", + "TransferDestinationNumber", + "TransferDestinationNumberMessage", + "TransferDestinationSip", + "TransferDestinationSipMessage", + "TransferFallbackPlan", + "TransferFallbackPlanMessage", + "TransferHookAction", + "TransferHookActionDestination", + "TransferMode", + "TransferPhoneNumberHookAction", + "TransferPhoneNumberHookActionDestination", + "TransferPlan", + "TransferPlanMessage", + "TransferPlanMode", + "TransferSuccessfulToolUserEditable", + "TransferSuccessfulToolUserEditableMessagesItem", + "TransportConfigurationTwilio", + "TransportConfigurationTwilioRecordingChannels", + "TransportCost", + "TransportCostProvider", + "TrieveCredential", + "TrieveKnowledgeBase", + "TrieveKnowledgeBaseChunkPlan", + "TrieveKnowledgeBaseCreate", + "TrieveKnowledgeBaseImport", + "TrieveKnowledgeBaseSearchPlan", + "TrieveKnowledgeBaseSearchPlanSearchType", + "TurnLatency", + "TwilioCredential", + "TwilioPhoneNumber", + "TwilioPhoneNumberFallbackDestination", + "TwilioPhoneNumberHooksItem", + "TwilioPhoneNumberStatus", + "TwilioVoicemailDetectionPlan", + "TwilioVoicemailDetectionPlanVoicemailDetectionTypesItem", + "UpdateAnthropicCredentialDto", + "UpdateAnyscaleCredentialDto", + "UpdateApiRequestToolDto", + "UpdateApiRequestToolDtoMessagesItem", + "UpdateApiRequestToolDtoMethod", + "UpdateAssemblyAiCredentialDto", + "UpdateAzureCredentialDto", + "UpdateAzureCredentialDtoRegion", + "UpdateAzureCredentialDtoService", + "UpdateAzureOpenAiCredentialDto", + "UpdateAzureOpenAiCredentialDtoModelsItem", + "UpdateAzureOpenAiCredentialDtoRegion", + "UpdateBashToolDto", + "UpdateBashToolDtoMessagesItem", + "UpdateByoPhoneNumberDto", + "UpdateByoPhoneNumberDtoFallbackDestination", + "UpdateByoPhoneNumberDtoHooksItem", + "UpdateByoSipTrunkCredentialDto", + "UpdateCartesiaCredentialDto", + "UpdateCerebrasCredentialDto", + "UpdateCloudflareCredentialDto", + "UpdateComputerToolDto", + "UpdateComputerToolDtoMessagesItem", + "UpdateCustomCredentialDto", + "UpdateCustomCredentialDtoAuthenticationPlan", + "UpdateCustomKnowledgeBaseDto", + "UpdateCustomLlmCredentialDto", + "UpdateDeepInfraCredentialDto", + "UpdateDeepSeekCredentialDto", + "UpdateDeepgramCredentialDto", + "UpdateDtmfToolDto", + "UpdateDtmfToolDtoMessagesItem", + "UpdateElevenLabsCredentialDto", + "UpdateEndCallToolDto", + "UpdateEndCallToolDtoMessagesItem", + "UpdateFunctionToolDto", + "UpdateFunctionToolDtoMessagesItem", + "UpdateGcpCredentialDto", + "UpdateGhlToolDto", + "UpdateGhlToolDtoMessagesItem", + "UpdateGladiaCredentialDto", + "UpdateGoHighLevelCalendarAvailabilityToolDto", + "UpdateGoHighLevelCalendarAvailabilityToolDtoMessagesItem", + "UpdateGoHighLevelCalendarEventCreateToolDto", + "UpdateGoHighLevelCalendarEventCreateToolDtoMessagesItem", + "UpdateGoHighLevelContactCreateToolDto", + "UpdateGoHighLevelContactCreateToolDtoMessagesItem", + "UpdateGoHighLevelContactGetToolDto", + "UpdateGoHighLevelContactGetToolDtoMessagesItem", + "UpdateGoHighLevelCredentialDto", + "UpdateGoHighLevelMcpCredentialDto", + "UpdateGoogleCalendarCheckAvailabilityToolDto", + "UpdateGoogleCalendarCheckAvailabilityToolDtoMessagesItem", + "UpdateGoogleCalendarCreateEventToolDto", + "UpdateGoogleCalendarCreateEventToolDtoMessagesItem", + "UpdateGoogleCalendarOAuth2AuthorizationCredentialDto", + "UpdateGoogleCalendarOAuth2ClientCredentialDto", + "UpdateGoogleCredentialDto", + "UpdateGoogleSheetsOAuth2AuthorizationCredentialDto", + "UpdateGoogleSheetsRowAppendToolDto", + "UpdateGoogleSheetsRowAppendToolDtoMessagesItem", + "UpdateGroqCredentialDto", + "UpdateHandoffToolDto", + "UpdateHandoffToolDtoDestinationsItem", + "UpdateHandoffToolDtoMessagesItem", + "UpdateHumeCredentialDto", + "UpdateInflectionAiCredentialDto", + "UpdateInworldCredentialDto", + "UpdateLangfuseCredentialDto", + "UpdateLmntCredentialDto", + "UpdateMakeCredentialDto", + "UpdateMakeToolDto", + "UpdateMakeToolDtoMessagesItem", + "UpdateMcpToolDto", + "UpdateMcpToolDtoMessagesItem", + "UpdateMistralCredentialDto", + "UpdateNeuphonicCredentialDto", + "UpdateOpenAiCredentialDto", + "UpdateOpenRouterCredentialDto", + "UpdateOrgDto", + "UpdateOrgDtoChannel", + "UpdateOutputToolDto", + "UpdateOutputToolDtoMessagesItem", + "UpdatePerplexityAiCredentialDto", + "UpdatePlayHtCredentialDto", + "UpdateQueryToolDto", + "UpdateQueryToolDtoMessagesItem", + "UpdateRimeAiCredentialDto", + "UpdateRunpodCredentialDto", + "UpdateS3CredentialDto", + "UpdateSlackOAuth2AuthorizationCredentialDto", + "UpdateSlackSendMessageToolDto", + "UpdateSlackSendMessageToolDtoMessagesItem", + "UpdateSmallestAiCredentialDto", + "UpdateSmsToolDto", + "UpdateSmsToolDtoMessagesItem", + "UpdateSpeechmaticsCredentialDto", + "UpdateSupabaseCredentialDto", + "UpdateTavusCredentialDto", + "UpdateTelnyxPhoneNumberDto", + "UpdateTelnyxPhoneNumberDtoFallbackDestination", + "UpdateTelnyxPhoneNumberDtoHooksItem", + "UpdateTestSuiteDto", + "UpdateTestSuiteRunDto", + "UpdateTestSuiteTestChatDto", + "UpdateTestSuiteTestVoiceDto", + "UpdateTextEditorToolDto", + "UpdateTextEditorToolDtoMessagesItem", + "UpdateTogetherAiCredentialDto", + "UpdateTokenDto", + "UpdateTokenDtoTag", + "UpdateToolTemplateDto", + "UpdateToolTemplateDtoDetails", + "UpdateToolTemplateDtoProvider", + "UpdateToolTemplateDtoProviderDetails", + "UpdateToolTemplateDtoVisibility", + "UpdateTransferCallToolDto", + "UpdateTransferCallToolDtoDestinationsItem", + "UpdateTransferCallToolDtoMessagesItem", + "UpdateTrieveCredentialDto", + "UpdateTrieveKnowledgeBaseDto", + "UpdateTwilioCredentialDto", + "UpdateTwilioPhoneNumberDto", + "UpdateTwilioPhoneNumberDtoFallbackDestination", + "UpdateTwilioPhoneNumberDtoHooksItem", + "UpdateUserRoleDto", + "UpdateUserRoleDtoRole", + "UpdateVapiPhoneNumberDto", + "UpdateVapiPhoneNumberDtoFallbackDestination", + "UpdateVapiPhoneNumberDtoHooksItem", + "UpdateVonageCredentialDto", + "UpdateVonagePhoneNumberDto", + "UpdateVonagePhoneNumberDtoFallbackDestination", + "UpdateVonagePhoneNumberDtoHooksItem", + "UpdateWebhookCredentialDto", + "UpdateWebhookCredentialDtoAuthenticationPlan", + "UpdateWorkflowDto", + "UpdateWorkflowDtoBackgroundSound", + "UpdateWorkflowDtoBackgroundSoundZero", + "UpdateWorkflowDtoCredentialsItem", + "UpdateWorkflowDtoHooksItem", + "UpdateWorkflowDtoModel", + "UpdateWorkflowDtoNodesItem", + "UpdateWorkflowDtoTranscriber", + "UpdateWorkflowDtoVoice", + "UpdateXAiCredentialDto", + "User", + "UserMessage", + "VapiCost", + "VapiCostSubType", + "VapiModel", + "VapiModelToolsItem", + "VapiPhoneNumber", + "VapiPhoneNumberFallbackDestination", + "VapiPhoneNumberHooksItem", + "VapiPhoneNumberStatus", + "VapiSmartEndpointingPlan", + "VapiSmartEndpointingPlanProvider", + "VapiVoice", + "VapiVoiceVoiceId", + "VapiVoicemailDetectionPlan", + "VapiVoicemailDetectionPlanType", + "VariableExtractionAlias", + "VariableExtractionPlan", + "VoiceCost", + "VoiceLibrary", + "VoiceLibraryGender", + "VoiceLibraryVoiceResponse", + "VoicemailDetectionBackoffPlan", + "VoicemailDetectionCost", + "VoicemailDetectionCostProvider", + "VonageCredential", + "VonagePhoneNumber", + "VonagePhoneNumberFallbackDestination", + "VonagePhoneNumberHooksItem", + "VonagePhoneNumberStatus", + "WebChat", + "WebChatOutputItem", + "WebhookCredential", + "WebhookCredentialAuthenticationPlan", + "Workflow", + "WorkflowAnthropicModel", + "WorkflowAnthropicModelModel", + "WorkflowBackgroundSound", + "WorkflowBackgroundSoundZero", + "WorkflowCredentialsItem", + "WorkflowCustomModel", + "WorkflowCustomModelMetadataSendMode", + "WorkflowGoogleModel", + "WorkflowGoogleModelModel", + "WorkflowHooksItem", + "WorkflowModel", + "WorkflowNodesItem", + "WorkflowOpenAiModel", + "WorkflowOpenAiModelModel", + "WorkflowOverrides", + "WorkflowTranscriber", + "WorkflowUserEditable", + "WorkflowUserEditableBackgroundSound", + "WorkflowUserEditableBackgroundSoundZero", + "WorkflowUserEditableCredentialsItem", + "WorkflowUserEditableHooksItem", + "WorkflowUserEditableModel", + "WorkflowUserEditableNodesItem", + "WorkflowUserEditableTranscriber", + "WorkflowUserEditableVoice", + "WorkflowVoice", + "XAiCredential", + "XaiModel", + "XaiModelModel", + "XaiModelToolsItem", + "XssSecurityFilter", +] diff --git a/src/vapi/types/analysis_cost_analysis_type.py b/src/vapi/types/analysis_cost_analysis_type.py index 483ab82..b2b010b 100644 --- a/src/vapi/types/analysis_cost_analysis_type.py +++ b/src/vapi/types/analysis_cost_analysis_type.py @@ -2,4 +2,6 @@ import typing -AnalysisCostAnalysisType = typing.Union[typing.Literal["summary", "structuredData", "successEvaluation"], typing.Any] +AnalysisCostAnalysisType = typing.Union[ + typing.Literal["summary", "structuredData", "successEvaluation", "structuredOutput"], typing.Any +] diff --git a/src/vapi/types/analysis_cost_breakdown.py b/src/vapi/types/analysis_cost_breakdown.py index f0d8cd8..bfda7ec 100644 --- a/src/vapi/types/analysis_cost_breakdown.py +++ b/src/vapi/types/analysis_cost_breakdown.py @@ -71,6 +71,27 @@ class AnalysisCostBreakdown(UncheckedBaseModel): This is the number of completion tokens used to evaluate if the call was successful. """ + structured_output: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="structuredOutput")] = ( + pydantic.Field(default=None) + ) + """ + This is the cost to evaluate structuredOutputs from the call. + """ + + structured_output_prompt_tokens: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="structuredOutputPromptTokens") + ] = pydantic.Field(default=None) + """ + This is the number of prompt tokens used to evaluate structuredOutputs from the call. + """ + + structured_output_completion_tokens: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="structuredOutputCompletionTokens") + ] = pydantic.Field(default=None) + """ + This is the number of completion tokens used to evaluate structuredOutputs from the call. + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/vapi/types/analysis_plan.py b/src/vapi/types/analysis_plan.py index 617e768..50b1b13 100644 --- a/src/vapi/types/analysis_plan.py +++ b/src/vapi/types/analysis_plan.py @@ -51,6 +51,14 @@ class AnalysisPlan(UncheckedBaseModel): This is the plan for generating the success evaluation of the call. This outputs to `call.analysis.successEvaluation`. """ + outcome_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="outcomeIds")] = ( + pydantic.Field(default=None) + ) + """ + This is an array of outcome UUIDs to be calculated during analysis. + The outcomes will be calculated and stored in `call.analysis.outcomes`. + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/vapi/types/analytics_operation_column.py b/src/vapi/types/analytics_operation_column.py index f64a2ca..8f46b84 100644 --- a/src/vapi/types/analytics_operation_column.py +++ b/src/vapi/types/analytics_operation_column.py @@ -10,6 +10,9 @@ "costBreakdown.stt", "costBreakdown.tts", "costBreakdown.vapi", + "costBreakdown.transport", + "costBreakdown.analysisBreakdown.summary", + "costBreakdown.transcriber", "costBreakdown.ttsCharacters", "costBreakdown.llmPromptTokens", "costBreakdown.llmCompletionTokens", diff --git a/src/vapi/types/anthropic_model.py b/src/vapi/types/anthropic_model.py index 887684c..8df8e49 100644 --- a/src/vapi/types/anthropic_model.py +++ b/src/vapi/types/anthropic_model.py @@ -1,14 +1,15 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .anthropic_model_model import AnthropicModelModel -from .anthropic_model_tools_item import AnthropicModelToolsItem from .anthropic_thinking_config import AnthropicThinkingConfig from .create_custom_knowledge_base_dto import CreateCustomKnowledgeBaseDto from .open_ai_message import OpenAiMessage @@ -20,7 +21,7 @@ class AnthropicModel(UncheckedBaseModel): This is the starting state for the conversation. """ - tools: typing.Optional[typing.List[AnthropicModelToolsItem]] = pydantic.Field(default=None) + tools: typing.Optional[typing.List["AnthropicModelToolsItem"]] = pydantic.Field(default=None) """ These are the tools that the assistant can use during the call. To use existing tools, use `toolIds`. @@ -43,13 +44,6 @@ class AnthropicModel(UncheckedBaseModel): These are the options for the knowledge base. """ - knowledge_base_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="knowledgeBaseId")] = ( - pydantic.Field(default=None) - ) - """ - This is the ID of the knowledge base the model will use. - """ - model: AnthropicModelModel = pydantic.Field() """ The specific Anthropic/Claude model that will be used. @@ -109,3 +103,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 +from .anthropic_model_tools_item import AnthropicModelToolsItem # noqa: E402, F401, I001 + +update_forward_refs(AnthropicModel) diff --git a/src/vapi/types/anthropic_model_tools_item.py b/src/vapi/types/anthropic_model_tools_item.py index e190a5a..20e00fb 100644 --- a/src/vapi/types/anthropic_model_tools_item.py +++ b/src/vapi/types/anthropic_model_tools_item.py @@ -1,5 +1,7 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing from .create_api_request_tool_dto import CreateApiRequestToolDto @@ -22,6 +24,8 @@ from .create_text_editor_tool_dto import CreateTextEditorToolDto from .create_transfer_call_tool_dto import CreateTransferCallToolDto +if typing.TYPE_CHECKING: + from .create_handoff_tool_dto import CreateHandoffToolDto AnthropicModelToolsItem = typing.Union[ CreateApiRequestToolDto, CreateBashToolDto, @@ -36,6 +40,7 @@ CreateGoogleCalendarCheckAvailabilityToolDto, CreateGoogleCalendarCreateEventToolDto, CreateGoogleSheetsRowAppendToolDto, + "CreateHandoffToolDto", CreateMcpToolDto, CreateQueryToolDto, CreateSlackSendMessageToolDto, diff --git a/src/vapi/types/anyscale_model.py b/src/vapi/types/anyscale_model.py index 0955c22..d62b378 100644 --- a/src/vapi/types/anyscale_model.py +++ b/src/vapi/types/anyscale_model.py @@ -1,13 +1,14 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel -from .anyscale_model_tools_item import AnyscaleModelToolsItem from .create_custom_knowledge_base_dto import CreateCustomKnowledgeBaseDto from .open_ai_message import OpenAiMessage @@ -18,7 +19,7 @@ class AnyscaleModel(UncheckedBaseModel): This is the starting state for the conversation. """ - tools: typing.Optional[typing.List[AnyscaleModelToolsItem]] = pydantic.Field(default=None) + tools: typing.Optional[typing.List["AnyscaleModelToolsItem"]] = pydantic.Field(default=None) """ These are the tools that the assistant can use during the call. To use existing tools, use `toolIds`. @@ -41,13 +42,6 @@ class AnyscaleModel(UncheckedBaseModel): These are the options for the knowledge base. """ - knowledge_base_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="knowledgeBaseId")] = ( - pydantic.Field(default=None) - ) - """ - This is the ID of the knowledge base the model will use. - """ - provider: typing.Literal["anyscale"] = "anyscale" model: str = pydantic.Field() """ @@ -96,3 +90,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 +from .anyscale_model_tools_item import AnyscaleModelToolsItem # noqa: E402, F401, I001 + +update_forward_refs(AnyscaleModel) diff --git a/src/vapi/types/anyscale_model_tools_item.py b/src/vapi/types/anyscale_model_tools_item.py index 91de099..1dcc9bd 100644 --- a/src/vapi/types/anyscale_model_tools_item.py +++ b/src/vapi/types/anyscale_model_tools_item.py @@ -1,5 +1,7 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing from .create_api_request_tool_dto import CreateApiRequestToolDto @@ -22,6 +24,8 @@ from .create_text_editor_tool_dto import CreateTextEditorToolDto from .create_transfer_call_tool_dto import CreateTransferCallToolDto +if typing.TYPE_CHECKING: + from .create_handoff_tool_dto import CreateHandoffToolDto AnyscaleModelToolsItem = typing.Union[ CreateApiRequestToolDto, CreateBashToolDto, @@ -36,6 +40,7 @@ CreateGoogleCalendarCheckAvailabilityToolDto, CreateGoogleCalendarCreateEventToolDto, CreateGoogleSheetsRowAppendToolDto, + "CreateHandoffToolDto", CreateMcpToolDto, CreateQueryToolDto, CreateSlackSendMessageToolDto, diff --git a/src/vapi/types/api_request_tool.py b/src/vapi/types/api_request_tool.py index 70a24cc..bec7d9d 100644 --- a/src/vapi/types/api_request_tool.py +++ b/src/vapi/types/api_request_tool.py @@ -1,18 +1,20 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import datetime as dt import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .api_request_tool_messages_item import ApiRequestToolMessagesItem from .api_request_tool_method import ApiRequestToolMethod from .backoff_plan import BackoffPlan from .json_schema import JsonSchema -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan from .variable_extraction_plan import VariableExtractionPlan @@ -35,6 +37,13 @@ class ApiRequestTool(UncheckedBaseModel): @default 20 """ + credential_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="credentialId")] = ( + pydantic.Field(default=None) + ) + """ + The credential ID for API request authentication + """ + id: str = pydantic.Field() """ This is the unique identifier for the tool. @@ -55,13 +64,88 @@ class ApiRequestTool(UncheckedBaseModel): This is the ISO 8601 date-time string of when the tool was last updated. """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` + + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` + + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ name: typing.Optional[str] = pydantic.Field(default=None) @@ -88,7 +172,7 @@ class ApiRequestTool(UncheckedBaseModel): headers: typing.Optional[JsonSchema] = pydantic.Field(default=None) """ - These are the headers to send in the request. + These are the headers to send with the request. """ backoff_plan: typing_extensions.Annotated[typing.Optional[BackoffPlan], FieldMetadata(alias="backoffPlan")] = ( @@ -183,33 +267,9 @@ class ApiRequestTool(UncheckedBaseModel): } } ``` - - 4.2. If you hit example.com and it returns `{"name": {"first": "John", "last": "Doe"}}`, then you can specify the schema as: - - ```json - { - "schema": { - "type": "object", - "properties": { - "name": { - "type": "object", - "properties": { - "first": { - "type": "string" - }, - "last": { - "type": "string" - } - } - } - } - } - } - ``` - These will be extracted as `{{ name }}` and `{{ age }}` respectively. To emphasize, object properties are extracted as direct global variables. - 4.3. If you hit example.com and it returns `{"name": {"first": "John", "last": "Doe"}}`, then you can specify the schema as: + 4.2. If you hit example.com and it returns `{"name": {"first": "John", "last": "Doe"}}`, then you can specify the schema as: ```json { @@ -234,7 +294,7 @@ class ApiRequestTool(UncheckedBaseModel): These will be extracted as `{{ name }}`. And, `{{ name.first }}` and `{{ name.last }}` will be accessible. - 4.4. If you hit example.com and it returns `["94123", "94124"]`, then you can specify the schema as: + 4.3. If you hit example.com and it returns `["94123", "94124"]`, then you can specify the schema as: ```json { @@ -250,7 +310,7 @@ class ApiRequestTool(UncheckedBaseModel): This will be extracted as `{{ zipCodes }}`. To access the array items, you can use `{{ zipCodes[0] }}` and `{{ zipCodes[1] }}`. - 4.5. If you hit example.com and it returns `[{"name": "John", "age": 30, "zipCodes": ["94123", "94124"]}, {"name": "Jane", "age": 25, "zipCodes": ["94125", "94126"]}]`, then you can specify the schema as: + 4.4. If you hit example.com and it returns `[{"name": "John", "age": 30, "zipCodes": ["94123", "94124"]}, {"name": "Jane", "age": 25, "zipCodes": ["94125", "94126"]}]`, then you can specify the schema as: ```json { @@ -291,3 +351,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(ApiRequestTool) diff --git a/src/vapi/types/api_request_tool_method.py b/src/vapi/types/api_request_tool_method.py index d800d50..73cb92c 100644 --- a/src/vapi/types/api_request_tool_method.py +++ b/src/vapi/types/api_request_tool_method.py @@ -2,4 +2,4 @@ import typing -ApiRequestToolMethod = typing.Union[typing.Literal["POST", "GET"], typing.Any] +ApiRequestToolMethod = typing.Union[typing.Literal["POST", "GET", "PUT", "PATCH", "DELETE"], typing.Any] diff --git a/src/vapi/types/artifact.py b/src/vapi/types/artifact.py index ff5fe10..bcde1c0 100644 --- a/src/vapi/types/artifact.py +++ b/src/vapi/types/artifact.py @@ -10,6 +10,7 @@ from .artifact_messages_item import ArtifactMessagesItem from .node_artifact import NodeArtifact from .open_ai_message import OpenAiMessage +from .performance_metrics import PerformanceMetrics from .recording import Recording @@ -71,6 +72,13 @@ class Artifact(UncheckedBaseModel): This is the packet capture url for the call. This is only available for `phone` type calls where phone number's provider is `vapi` or `byo-phone-number`. """ + log_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="logUrl")] = pydantic.Field( + default=None + ) + """ + This is the url for the call logs. This includes all logging output during the call for debugging purposes. + """ + nodes: typing.Optional[typing.List[NodeArtifact]] = pydantic.Field(default=None) """ This is the history of workflow nodes that were executed during the call. @@ -83,6 +91,21 @@ class Artifact(UncheckedBaseModel): These are the variable values at the end of the workflow execution. """ + performance_metrics: typing_extensions.Annotated[ + typing.Optional[PerformanceMetrics], FieldMetadata(alias="performanceMetrics") + ] = pydantic.Field(default=None) + """ + This is the performance metrics for the call. It contains the turn latency, broken down by component. + """ + + structured_outputs: typing_extensions.Annotated[ + typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]], FieldMetadata(alias="structuredOutputs") + ] = pydantic.Field(default=None) + """ + These are the structured outputs that will be extracted from the call. + To enable, set `assistant.artifactPlan.structuredOutputIds` with the IDs of the structured outputs you want to extract. + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/vapi/types/artifact_plan.py b/src/vapi/types/artifact_plan.py index 1e9acfc..7cfbb53 100644 --- a/src/vapi/types/artifact_plan.py +++ b/src/vapi/types/artifact_plan.py @@ -36,6 +36,21 @@ class ArtifactPlan(UncheckedBaseModel): @default 'wav;l16' """ + recording_use_custom_storage_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="recordingUseCustomStorageEnabled") + ] = pydantic.Field(default=None) + """ + This determines whether to use custom storage (S3 or GCP) for call recordings when storage credentials are configured. + + When set to false, recordings will be stored on Vapi's storage instead of your custom storage, even if you have custom storage credentials configured. + + Usage: + - Set to false if you have custom storage configured but want to store recordings on Vapi's storage for this assistant. + - Set to true (or leave unset) to use your custom storage for recordings when available. + + @default true + """ + video_recording_enabled: typing_extensions.Annotated[ typing.Optional[bool], FieldMetadata(alias="videoRecordingEnabled") ] = pydantic.Field(default=None) @@ -73,6 +88,45 @@ class ArtifactPlan(UncheckedBaseModel): @default '/' """ + pcap_use_custom_storage_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="pcapUseCustomStorageEnabled") + ] = pydantic.Field(default=None) + """ + This determines whether to use custom storage (S3 or GCP) for SIP packet captures when storage credentials are configured. + + When set to false, packet captures will be stored on Vapi's storage instead of your custom storage, even if you have custom storage credentials configured. + + Usage: + - Set to false if you have custom storage configured but want to store packet captures on Vapi's storage for this assistant. + - Set to true (or leave unset) to use your custom storage for packet captures when available. + + @default true + """ + + logging_enabled: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="loggingEnabled")] = ( + pydantic.Field(default=None) + ) + """ + This determines whether the call logs are enabled. Defaults to true. + + @default true + """ + + logging_use_custom_storage_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="loggingUseCustomStorageEnabled") + ] = pydantic.Field(default=None) + """ + This determines whether to use custom storage (S3 or GCP) for call logs when storage credentials are configured. + + When set to false, logs will be stored on Vapi's storage instead of your custom storage, even if you have custom storage credentials configured. + + Usage: + - Set to false if you have custom storage configured but want to store logs on Vapi's storage for this assistant. + - Set to true (or leave unset) to use your custom storage for logs when available. + + @default true + """ + transcript_plan: typing_extensions.Annotated[ typing.Optional[TranscriptPlan], FieldMetadata(alias="transcriptPlan") ] = pydantic.Field(default=None) @@ -95,6 +149,29 @@ class ArtifactPlan(UncheckedBaseModel): @default '/' """ + structured_output_ids: typing_extensions.Annotated[ + typing.Optional[typing.List[str]], FieldMetadata(alias="structuredOutputIds") + ] = pydantic.Field(default=None) + """ + This is an array of structured output IDs to be calculated during the call. + The outputs will be extracted and stored in `call.artifact.structuredOutputs` after the call is ended. + """ + + logging_path: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="loggingPath")] = ( + pydantic.Field(default=None) + ) + """ + This is the path where the call logs will be uploaded. This is only used if you have provided S3 or GCP credentials on the Provider Credentials page in the Dashboard. + + If credential.s3PathPrefix or credential.bucketPlan.path is set, this will append to it. + + Usage: + - If you want to upload the call logs to a specific path, set this to the path. Example: `/my-assistant-logs`. + - If you want to upload the call logs to the root of the bucket, set this to `/`. + + @default '/' + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/vapi/types/assembly_ai_transcriber.py b/src/vapi/types/assembly_ai_transcriber.py index 7ad8924..9e4c6ec 100644 --- a/src/vapi/types/assembly_ai_transcriber.py +++ b/src/vapi/types/assembly_ai_transcriber.py @@ -30,30 +30,23 @@ class AssemblyAiTranscriber(UncheckedBaseModel): @default 0.4 """ - enable_universal_streaming_api: typing_extensions.Annotated[ - typing.Optional[bool], FieldMetadata(alias="enableUniversalStreamingApi") - ] = pydantic.Field(default=None) - """ - Uses Assembly AI's new Universal Streaming API. See: https://www.assemblyai.com/docs/speech-to-text/universal-streaming - - @default false - """ - format_turns: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="formatTurns")] = ( pydantic.Field(default=None) ) """ - This enables formatting of transcripts. Only used when `enableUniversalStreamingApi` is true. + This enables formatting of transcripts. - @default false + @default true """ end_of_turn_confidence_threshold: typing_extensions.Annotated[ typing.Optional[float], FieldMetadata(alias="endOfTurnConfidenceThreshold") ] = pydantic.Field(default=None) """ - The confidence threshold to use when determining if the end of a turn has been reached. Only used when `enableUniversalStreamingApi` is true. + This is the end of turn confidence threshold. The minimum confidence that the end of turn is detected. + @min 0 + @max 1 @default 0.7 """ @@ -61,7 +54,7 @@ class AssemblyAiTranscriber(UncheckedBaseModel): typing.Optional[float], FieldMetadata(alias="minEndOfTurnSilenceWhenConfident") ] = pydantic.Field(default=None) """ - The minimum amount of silence in milliseconds required to detect end of turn when confident. Only used when `enableUniversalStreamingApi` is true. + This is the minimum end of turn silence when confident in milliseconds. @default 160 """ @@ -70,7 +63,7 @@ class AssemblyAiTranscriber(UncheckedBaseModel): typing.Optional[float], FieldMetadata(alias="wordFinalizationMaxWaitTime") ] = pydantic.Field(default=None) """ - The maximum wait time for word finalization. Only used when `enableUniversalStreamingApi` is true. + This is the maximum wait time for word finalization in milliseconds. @default 160 """ @@ -79,7 +72,7 @@ class AssemblyAiTranscriber(UncheckedBaseModel): pydantic.Field(default=None) ) """ - The maximum amount of silence in milliseconds allowed in a turn before end of turn is triggered. Only used when `enableUniversalStreamingApi` is true. + This is the maximum turn silence time in milliseconds. @default 400 """ diff --git a/src/vapi/types/assistant.py b/src/vapi/types/assistant.py index e8dbad0..0608651 100644 --- a/src/vapi/types/assistant.py +++ b/src/vapi/types/assistant.py @@ -1,11 +1,13 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import datetime as dt import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .analysis_plan import AnalysisPlan @@ -24,7 +26,6 @@ from .compliance_plan import CompliancePlan from .keypad_input_plan import KeypadInputPlan from .langfuse_observability_plan import LangfuseObservabilityPlan -from .message_plan import MessagePlan from .monitor_plan import MonitorPlan from .server import Server from .start_speaking_plan import StartSpeakingPlan @@ -94,16 +95,7 @@ class Assistant(UncheckedBaseModel): typing.Optional[typing.List[AssistantServerMessagesItem]], FieldMetadata(alias="serverMessages") ] = pydantic.Field(default=None) """ - These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema. - """ - - silence_timeout_seconds: typing_extensions.Annotated[ - typing.Optional[float], FieldMetadata(alias="silenceTimeoutSeconds") - ] = pydantic.Field(default=None) - """ - How many seconds of silence to wait before ending the call. Defaults to 30. - - @default 30 + These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,handoff-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema. """ max_duration_seconds: typing_extensions.Annotated[ @@ -123,17 +115,6 @@ class Assistant(UncheckedBaseModel): You can also provide a custom sound by providing a URL to an audio file. """ - background_denoising_enabled: typing_extensions.Annotated[ - typing.Optional[bool], FieldMetadata(alias="backgroundDenoisingEnabled") - ] = pydantic.Field(default=None) - """ - This enables filtering of noise and background speech while the user is talking. - - Default `false` while in beta. - - @default false - """ - model_output_in_messages_enabled: typing_extensions.Annotated[ typing.Optional[bool], FieldMetadata(alias="modelOutputInMessagesEnabled") ] = pydantic.Field(default=None) @@ -242,15 +223,6 @@ class Assistant(UncheckedBaseModel): This is the plan for artifacts generated during assistant's calls. Stored in `call.artifact`. """ - message_plan: typing_extensions.Annotated[typing.Optional[MessagePlan], FieldMetadata(alias="messagePlan")] = ( - pydantic.Field(default=None) - ) - """ - This is the plan for static predefined messages that can be spoken by the assistant during the call, like `idleMessages`. - - Note: `firstMessage`, `voicemailMessage`, and `endCallMessage` are currently at the root level. They will be moved to `messagePlan` in the future, but will remain backwards compatible. - """ - start_speaking_plan: typing_extensions.Annotated[ typing.Optional[StartSpeakingPlan], FieldMetadata(alias="startSpeakingPlan") ] = pydantic.Field(default=None) @@ -337,3 +309,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(Assistant) diff --git a/src/vapi/types/assistant_credentials_item.py b/src/vapi/types/assistant_credentials_item.py index efe70cd..27196b2 100644 --- a/src/vapi/types/assistant_credentials_item.py +++ b/src/vapi/types/assistant_credentials_item.py @@ -11,6 +11,7 @@ from .create_cartesia_credential_dto import CreateCartesiaCredentialDto from .create_cerebras_credential_dto import CreateCerebrasCredentialDto from .create_cloudflare_credential_dto import CreateCloudflareCredentialDto +from .create_custom_credential_dto import CreateCustomCredentialDto from .create_custom_llm_credential_dto import CreateCustomLlmCredentialDto from .create_deep_infra_credential_dto import CreateDeepInfraCredentialDto from .create_deep_seek_credential_dto import CreateDeepSeekCredentialDto @@ -31,9 +32,11 @@ from .create_groq_credential_dto import CreateGroqCredentialDto from .create_hume_credential_dto import CreateHumeCredentialDto from .create_inflection_ai_credential_dto import CreateInflectionAiCredentialDto +from .create_inworld_credential_dto import CreateInworldCredentialDto from .create_langfuse_credential_dto import CreateLangfuseCredentialDto from .create_lmnt_credential_dto import CreateLmntCredentialDto from .create_make_credential_dto import CreateMakeCredentialDto +from .create_minimax_credential_dto import CreateMinimaxCredentialDto from .create_mistral_credential_dto import CreateMistralCredentialDto from .create_neuphonic_credential_dto import CreateNeuphonicCredentialDto from .create_open_ai_credential_dto import CreateOpenAiCredentialDto @@ -93,6 +96,7 @@ CreateTwilioCredentialDto, CreateVonageCredentialDto, CreateWebhookCredentialDto, + CreateCustomCredentialDto, CreateXAiCredentialDto, CreateNeuphonicCredentialDto, CreateHumeCredentialDto, @@ -104,5 +108,6 @@ CreateGoogleSheetsOAuth2AuthorizationCredentialDto, CreateSlackOAuth2AuthorizationCredentialDto, CreateGoHighLevelMcpCredentialDto, - typing.Optional[typing.Any], + CreateInworldCredentialDto, + CreateMinimaxCredentialDto, ] diff --git a/src/vapi/types/assistant_hook_assistant_speech_interrupted.py b/src/vapi/types/assistant_hook_assistant_speech_interrupted.py index 181b89c..8d82458 100644 --- a/src/vapi/types/assistant_hook_assistant_speech_interrupted.py +++ b/src/vapi/types/assistant_hook_assistant_speech_interrupted.py @@ -2,28 +2,4 @@ import typing -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .assistant_hook_assistant_speech_interrupted_do_item import AssistantHookAssistantSpeechInterruptedDoItem - - -class AssistantHookAssistantSpeechInterrupted(UncheckedBaseModel): - on: typing.Literal["assistant.speech.interrupted"] = pydantic.Field(default="assistant.speech.interrupted") - """ - This is the event that triggers this hook - """ - - do: typing.List[AssistantHookAssistantSpeechInterruptedDoItem] = pydantic.Field() - """ - This is the set of actions to perform when the hook triggers - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow +AssistantHookAssistantSpeechInterrupted = typing.Optional[typing.Any] diff --git a/src/vapi/types/assistant_hook_assistant_speech_interrupted_do_item.py b/src/vapi/types/assistant_hook_assistant_speech_interrupted_do_item.py deleted file mode 100644 index 203689c..0000000 --- a/src/vapi/types/assistant_hook_assistant_speech_interrupted_do_item.py +++ /dev/null @@ -1,11 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from .function_call_assistant_hook_action import FunctionCallAssistantHookAction -from .say_assistant_hook_action import SayAssistantHookAction -from .transfer_assistant_hook_action import TransferAssistantHookAction - -AssistantHookAssistantSpeechInterruptedDoItem = typing.Union[ - TransferAssistantHookAction, FunctionCallAssistantHookAction, SayAssistantHookAction -] diff --git a/src/vapi/types/assistant_hook_call_ending.py b/src/vapi/types/assistant_hook_call_ending.py index 9cb3f6c..c202462 100644 --- a/src/vapi/types/assistant_hook_call_ending.py +++ b/src/vapi/types/assistant_hook_call_ending.py @@ -2,34 +2,4 @@ import typing -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .assistant_hook_call_ending_do_item import AssistantHookCallEndingDoItem -from .assistant_hook_filter import AssistantHookFilter - - -class AssistantHookCallEnding(UncheckedBaseModel): - on: typing.Literal["call.ending"] = pydantic.Field(default="call.ending") - """ - This is the event that triggers this hook - """ - - do: typing.List[AssistantHookCallEndingDoItem] = pydantic.Field() - """ - This is the set of actions to perform when the hook triggers - """ - - filters: typing.Optional[typing.List[AssistantHookFilter]] = pydantic.Field(default=None) - """ - This is the set of filters that must match for the hook to trigger - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow +AssistantHookCallEnding = typing.Optional[typing.Any] diff --git a/src/vapi/types/assistant_hook_call_ending_do_item.py b/src/vapi/types/assistant_hook_call_ending_do_item.py deleted file mode 100644 index 360923c..0000000 --- a/src/vapi/types/assistant_hook_call_ending_do_item.py +++ /dev/null @@ -1,8 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from .function_call_assistant_hook_action import FunctionCallAssistantHookAction -from .transfer_assistant_hook_action import TransferAssistantHookAction - -AssistantHookCallEndingDoItem = typing.Union[TransferAssistantHookAction, FunctionCallAssistantHookAction] diff --git a/src/vapi/types/assistant_hook_customer_speech_interrupted.py b/src/vapi/types/assistant_hook_customer_speech_interrupted.py index 65f063d..4dd78a7 100644 --- a/src/vapi/types/assistant_hook_customer_speech_interrupted.py +++ b/src/vapi/types/assistant_hook_customer_speech_interrupted.py @@ -2,28 +2,4 @@ import typing -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .assistant_hook_customer_speech_interrupted_do_item import AssistantHookCustomerSpeechInterruptedDoItem - - -class AssistantHookCustomerSpeechInterrupted(UncheckedBaseModel): - on: typing.Literal["customer.speech.interrupted"] = pydantic.Field(default="customer.speech.interrupted") - """ - This is the event that triggers this hook - """ - - do: typing.List[AssistantHookCustomerSpeechInterruptedDoItem] = pydantic.Field() - """ - This is the set of actions to perform when the hook triggers - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow +AssistantHookCustomerSpeechInterrupted = typing.Optional[typing.Any] diff --git a/src/vapi/types/assistant_hook_customer_speech_interrupted_do_item.py b/src/vapi/types/assistant_hook_customer_speech_interrupted_do_item.py deleted file mode 100644 index 99d0a8e..0000000 --- a/src/vapi/types/assistant_hook_customer_speech_interrupted_do_item.py +++ /dev/null @@ -1,11 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from .function_call_assistant_hook_action import FunctionCallAssistantHookAction -from .say_assistant_hook_action import SayAssistantHookAction -from .transfer_assistant_hook_action import TransferAssistantHookAction - -AssistantHookCustomerSpeechInterruptedDoItem = typing.Union[ - TransferAssistantHookAction, FunctionCallAssistantHookAction, SayAssistantHookAction -] diff --git a/src/vapi/types/assistant_hooks_item.py b/src/vapi/types/assistant_hooks_item.py index 210788e..2172ab9 100644 --- a/src/vapi/types/assistant_hooks_item.py +++ b/src/vapi/types/assistant_hooks_item.py @@ -2,10 +2,14 @@ import typing -from .assistant_hook_assistant_speech_interrupted import AssistantHookAssistantSpeechInterrupted -from .assistant_hook_call_ending import AssistantHookCallEnding -from .assistant_hook_customer_speech_interrupted import AssistantHookCustomerSpeechInterrupted +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted +from .call_hook_call_ending import CallHookCallEnding +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout AssistantHooksItem = typing.Union[ - AssistantHookCallEnding, AssistantHookAssistantSpeechInterrupted, AssistantHookCustomerSpeechInterrupted + CallHookCallEnding, + CallHookAssistantSpeechInterrupted, + CallHookCustomerSpeechInterrupted, + CallHookCustomerSpeechTimeout, ] diff --git a/src/vapi/types/assistant_message.py b/src/vapi/types/assistant_message.py index f2a7f43..5c09710 100644 --- a/src/vapi/types/assistant_message.py +++ b/src/vapi/types/assistant_message.py @@ -34,6 +34,11 @@ class AssistantMessage(UncheckedBaseModel): This is an optional name for the participant """ + metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None) + """ + This is an optional metadata for the message + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/vapi/types/assistant_overrides.py b/src/vapi/types/assistant_overrides.py index b21d2d2..0ae9d47 100644 --- a/src/vapi/types/assistant_overrides.py +++ b/src/vapi/types/assistant_overrides.py @@ -1,10 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .analysis_plan import AnalysisPlan @@ -23,7 +25,6 @@ from .compliance_plan import CompliancePlan from .keypad_input_plan import KeypadInputPlan from .langfuse_observability_plan import LangfuseObservabilityPlan -from .message_plan import MessagePlan from .monitor_plan import MonitorPlan from .server import Server from .start_speaking_plan import StartSpeakingPlan @@ -93,16 +94,7 @@ class AssistantOverrides(UncheckedBaseModel): typing.Optional[typing.List[AssistantOverridesServerMessagesItem]], FieldMetadata(alias="serverMessages") ] = pydantic.Field(default=None) """ - These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema. - """ - - silence_timeout_seconds: typing_extensions.Annotated[ - typing.Optional[float], FieldMetadata(alias="silenceTimeoutSeconds") - ] = pydantic.Field(default=None) - """ - How many seconds of silence to wait before ending the call. Defaults to 30. - - @default 30 + These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,handoff-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema. """ max_duration_seconds: typing_extensions.Annotated[ @@ -122,17 +114,6 @@ class AssistantOverrides(UncheckedBaseModel): You can also provide a custom sound by providing a URL to an audio file. """ - background_denoising_enabled: typing_extensions.Annotated[ - typing.Optional[bool], FieldMetadata(alias="backgroundDenoisingEnabled") - ] = pydantic.Field(default=None) - """ - This enables filtering of noise and background speech while the user is talking. - - Default `false` while in beta. - - @default false - """ - model_output_in_messages_enabled: typing_extensions.Annotated[ typing.Optional[bool], FieldMetadata(alias="modelOutputInMessagesEnabled") ] = pydantic.Field(default=None) @@ -254,15 +235,6 @@ class AssistantOverrides(UncheckedBaseModel): This is the plan for artifacts generated during assistant's calls. Stored in `call.artifact`. """ - message_plan: typing_extensions.Annotated[typing.Optional[MessagePlan], FieldMetadata(alias="messagePlan")] = ( - pydantic.Field(default=None) - ) - """ - This is the plan for static predefined messages that can be spoken by the assistant during the call, like `idleMessages`. - - Note: `firstMessage`, `voicemailMessage`, and `endCallMessage` are currently at the root level. They will be moved to `messagePlan` in the future, but will remain backwards compatible. - """ - start_speaking_plan: typing_extensions.Annotated[ typing.Optional[StartSpeakingPlan], FieldMetadata(alias="startSpeakingPlan") ] = pydantic.Field(default=None) @@ -330,3 +302,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(AssistantOverrides) diff --git a/src/vapi/types/assistant_overrides_credentials_item.py b/src/vapi/types/assistant_overrides_credentials_item.py index 594b57e..023c59e 100644 --- a/src/vapi/types/assistant_overrides_credentials_item.py +++ b/src/vapi/types/assistant_overrides_credentials_item.py @@ -11,6 +11,7 @@ from .create_cartesia_credential_dto import CreateCartesiaCredentialDto from .create_cerebras_credential_dto import CreateCerebrasCredentialDto from .create_cloudflare_credential_dto import CreateCloudflareCredentialDto +from .create_custom_credential_dto import CreateCustomCredentialDto from .create_custom_llm_credential_dto import CreateCustomLlmCredentialDto from .create_deep_infra_credential_dto import CreateDeepInfraCredentialDto from .create_deep_seek_credential_dto import CreateDeepSeekCredentialDto @@ -31,9 +32,11 @@ from .create_groq_credential_dto import CreateGroqCredentialDto from .create_hume_credential_dto import CreateHumeCredentialDto from .create_inflection_ai_credential_dto import CreateInflectionAiCredentialDto +from .create_inworld_credential_dto import CreateInworldCredentialDto from .create_langfuse_credential_dto import CreateLangfuseCredentialDto from .create_lmnt_credential_dto import CreateLmntCredentialDto from .create_make_credential_dto import CreateMakeCredentialDto +from .create_minimax_credential_dto import CreateMinimaxCredentialDto from .create_mistral_credential_dto import CreateMistralCredentialDto from .create_neuphonic_credential_dto import CreateNeuphonicCredentialDto from .create_open_ai_credential_dto import CreateOpenAiCredentialDto @@ -93,6 +96,7 @@ CreateTwilioCredentialDto, CreateVonageCredentialDto, CreateWebhookCredentialDto, + CreateCustomCredentialDto, CreateXAiCredentialDto, CreateNeuphonicCredentialDto, CreateHumeCredentialDto, @@ -104,5 +108,6 @@ CreateGoogleSheetsOAuth2AuthorizationCredentialDto, CreateSlackOAuth2AuthorizationCredentialDto, CreateGoHighLevelMcpCredentialDto, - typing.Optional[typing.Any], + CreateInworldCredentialDto, + CreateMinimaxCredentialDto, ] diff --git a/src/vapi/types/assistant_overrides_hooks_item.py b/src/vapi/types/assistant_overrides_hooks_item.py index 416747a..67f420a 100644 --- a/src/vapi/types/assistant_overrides_hooks_item.py +++ b/src/vapi/types/assistant_overrides_hooks_item.py @@ -2,10 +2,14 @@ import typing -from .assistant_hook_assistant_speech_interrupted import AssistantHookAssistantSpeechInterrupted -from .assistant_hook_call_ending import AssistantHookCallEnding -from .assistant_hook_customer_speech_interrupted import AssistantHookCustomerSpeechInterrupted +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted +from .call_hook_call_ending import CallHookCallEnding +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout AssistantOverridesHooksItem = typing.Union[ - AssistantHookCallEnding, AssistantHookAssistantSpeechInterrupted, AssistantHookCustomerSpeechInterrupted + CallHookCallEnding, + CallHookAssistantSpeechInterrupted, + CallHookCustomerSpeechInterrupted, + CallHookCustomerSpeechTimeout, ] diff --git a/src/vapi/types/assistant_overrides_voice.py b/src/vapi/types/assistant_overrides_voice.py index e241c7e..bd6af32 100644 --- a/src/vapi/types/assistant_overrides_voice.py +++ b/src/vapi/types/assistant_overrides_voice.py @@ -10,6 +10,7 @@ from .hume_voice import HumeVoice from .inworld_voice import InworldVoice from .lmnt_voice import LmntVoice +from .minimax_voice import MinimaxVoice from .neuphonic_voice import NeuphonicVoice from .open_ai_voice import OpenAiVoice from .play_ht_voice import PlayHtVoice @@ -36,4 +37,5 @@ VapiVoice, SesameVoice, InworldVoice, + MinimaxVoice, ] diff --git a/src/vapi/types/assistant_paginated_response.py b/src/vapi/types/assistant_paginated_response.py index 4bbc23b..d1cafb3 100644 --- a/src/vapi/types/assistant_paginated_response.py +++ b/src/vapi/types/assistant_paginated_response.py @@ -1,9 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .assistant import Assistant from .pagination_meta import PaginationMeta @@ -21,3 +23,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(AssistantPaginatedResponse) diff --git a/src/vapi/types/assistant_voice.py b/src/vapi/types/assistant_voice.py index fc74910..a472941 100644 --- a/src/vapi/types/assistant_voice.py +++ b/src/vapi/types/assistant_voice.py @@ -10,6 +10,7 @@ from .hume_voice import HumeVoice from .inworld_voice import InworldVoice from .lmnt_voice import LmntVoice +from .minimax_voice import MinimaxVoice from .neuphonic_voice import NeuphonicVoice from .open_ai_voice import OpenAiVoice from .play_ht_voice import PlayHtVoice @@ -36,4 +37,5 @@ VapiVoice, SesameVoice, InworldVoice, + MinimaxVoice, ] diff --git a/src/vapi/types/azure_open_ai_credential_models_item.py b/src/vapi/types/azure_open_ai_credential_models_item.py index 36c8121..44e9b75 100644 --- a/src/vapi/types/azure_open_ai_credential_models_item.py +++ b/src/vapi/types/azure_open_ai_credential_models_item.py @@ -4,6 +4,9 @@ AzureOpenAiCredentialModelsItem = typing.Union[ typing.Literal[ + "gpt-5", + "gpt-5-mini", + "gpt-5-nano", "gpt-4.1-2025-04-14", "gpt-4.1-mini-2025-04-14", "gpt-4.1-nano-2025-04-14", diff --git a/src/vapi/types/azure_speech_transcriber.py b/src/vapi/types/azure_speech_transcriber.py index c555c71..5cb84ae 100644 --- a/src/vapi/types/azure_speech_transcriber.py +++ b/src/vapi/types/azure_speech_transcriber.py @@ -8,6 +8,7 @@ from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .azure_speech_transcriber_language import AzureSpeechTranscriberLanguage +from .azure_speech_transcriber_segmentation_strategy import AzureSpeechTranscriberSegmentationStrategy from .fallback_transcriber_plan import FallbackTranscriberPlan @@ -22,6 +23,27 @@ class AzureSpeechTranscriber(UncheckedBaseModel): This is the language that will be set for the transcription. The list of languages Azure supports can be found here: https://learn.microsoft.com/en-us/azure/ai-services/speech-service/language-support?tabs=stt """ + segmentation_strategy: typing_extensions.Annotated[ + typing.Optional[AzureSpeechTranscriberSegmentationStrategy], FieldMetadata(alias="segmentationStrategy") + ] = pydantic.Field(default=None) + """ + Controls how phrase boundaries are detected, enabling either simple time/silence heuristics or more advanced semantic segmentation. + """ + + segmentation_silence_timeout_ms: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="segmentationSilenceTimeoutMs") + ] = pydantic.Field(default=None) + """ + Duration of detected silence after which the service finalizes a phrase. Configure to adjust sensitivity to pauses in speech. + """ + + segmentation_maximum_time_ms: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="segmentationMaximumTimeMs") + ] = pydantic.Field(default=None) + """ + Maximum duration a segment can reach before being cut off when using time-based segmentation. + """ + fallback_plan: typing_extensions.Annotated[ typing.Optional[FallbackTranscriberPlan], FieldMetadata(alias="fallbackPlan") ] = pydantic.Field(default=None) diff --git a/src/vapi/types/azure_speech_transcriber_segmentation_strategy.py b/src/vapi/types/azure_speech_transcriber_segmentation_strategy.py new file mode 100644 index 0000000..8d9aee4 --- /dev/null +++ b/src/vapi/types/azure_speech_transcriber_segmentation_strategy.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +AzureSpeechTranscriberSegmentationStrategy = typing.Union[typing.Literal["Default", "Time", "Semantic"], typing.Any] diff --git a/src/vapi/types/backoff_plan.py b/src/vapi/types/backoff_plan.py index be6a768..097523c 100644 --- a/src/vapi/types/backoff_plan.py +++ b/src/vapi/types/backoff_plan.py @@ -29,6 +29,15 @@ class BackoffPlan(UncheckedBaseModel): This is the base delay in seconds. For linear backoff, this is the delay between each retry. For exponential backoff, this is the initial delay. """ + excluded_status_codes: typing_extensions.Annotated[ + typing.Optional[typing.List[typing.Dict[str, typing.Optional[typing.Any]]]], + FieldMetadata(alias="excludedStatusCodes"), + ] = pydantic.Field(default=None) + """ + This is the excluded status codes. If the response status code is in this list, the request will not be retried. + By default, the request will be retried for any non-2xx status code. + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/vapi/types/bash_tool.py b/src/vapi/types/bash_tool.py index 6c70976..c8e18e7 100644 --- a/src/vapi/types/bash_tool.py +++ b/src/vapi/types/bash_tool.py @@ -1,16 +1,18 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import datetime as dt import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .bash_tool_messages_item import BashToolMessagesItem -from .open_ai_function import OpenAiFunction from .server import Server +from .tool_rejection_plan import ToolRejectionPlan class BashTool(UncheckedBaseModel): @@ -62,13 +64,88 @@ class BashTool(UncheckedBaseModel): This is the ISO 8601 date-time string of when the tool was last updated. """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ name: typing.Literal["bash"] = pydantic.Field(default="bash") @@ -84,3 +161,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(BashTool) diff --git a/src/vapi/types/bash_tool_with_tool_call.py b/src/vapi/types/bash_tool_with_tool_call.py index 6006e72..8c82617 100644 --- a/src/vapi/types/bash_tool_with_tool_call.py +++ b/src/vapi/types/bash_tool_with_tool_call.py @@ -1,16 +1,18 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .bash_tool_with_tool_call_messages_item import BashToolWithToolCallMessagesItem -from .open_ai_function import OpenAiFunction from .server import Server from .tool_call import ToolCall +from .tool_rejection_plan import ToolRejectionPlan class BashToolWithToolCall(UncheckedBaseModel): @@ -52,13 +54,88 @@ class BashToolWithToolCall(UncheckedBaseModel): The name of the tool, fixed to 'bash' """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -69,3 +146,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(BashToolWithToolCall) diff --git a/src/vapi/types/bearer_authentication_plan.py b/src/vapi/types/bearer_authentication_plan.py new file mode 100644 index 0000000..481d714 --- /dev/null +++ b/src/vapi/types/bearer_authentication_plan.py @@ -0,0 +1,40 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel + + +class BearerAuthenticationPlan(UncheckedBaseModel): + type: typing.Literal["bearer"] = "bearer" + token: str = pydantic.Field() + """ + This is the bearer token value. + """ + + header_name: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="headerName")] = pydantic.Field( + default=None + ) + """ + This is the header name where the bearer token will be sent. Defaults to 'Authorization'. + """ + + bearer_prefix_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="bearerPrefixEnabled") + ] = pydantic.Field(default=None) + """ + Whether to include the 'Bearer ' prefix in the header value. Defaults to true. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/byo_phone_number.py b/src/vapi/types/byo_phone_number.py index 0eb3117..20006ac 100644 --- a/src/vapi/types/byo_phone_number.py +++ b/src/vapi/types/byo_phone_number.py @@ -9,8 +9,8 @@ from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .byo_phone_number_fallback_destination import ByoPhoneNumberFallbackDestination +from .byo_phone_number_hooks_item import ByoPhoneNumberHooksItem from .byo_phone_number_status import ByoPhoneNumberStatus -from .phone_number_hook_call_ringing import PhoneNumberHookCallRinging from .server import Server @@ -27,7 +27,7 @@ class ByoPhoneNumber(UncheckedBaseModel): If this is not set and above conditions are met, the inbound call is hung up with an error message. """ - hooks: typing.Optional[typing.List[PhoneNumberHookCallRinging]] = pydantic.Field(default=None) + hooks: typing.Optional[typing.List[ByoPhoneNumberHooksItem]] = pydantic.Field(default=None) """ This is the hooks that will be used for incoming calls to this phone number. """ diff --git a/src/vapi/types/byo_phone_number_hooks_item.py b/src/vapi/types/byo_phone_number_hooks_item.py new file mode 100644 index 0000000..9389ad5 --- /dev/null +++ b/src/vapi/types/byo_phone_number_hooks_item.py @@ -0,0 +1,8 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .phone_number_hook_call_ending import PhoneNumberHookCallEnding +from .phone_number_hook_call_ringing import PhoneNumberHookCallRinging + +ByoPhoneNumberHooksItem = typing.Union[PhoneNumberHookCallRinging, PhoneNumberHookCallEnding] diff --git a/src/vapi/types/call.py b/src/vapi/types/call.py index 24aa536..bd59785 100644 --- a/src/vapi/types/call.py +++ b/src/vapi/types/call.py @@ -1,11 +1,13 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import datetime as dt import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .analysis import Analysis @@ -21,7 +23,6 @@ from .call_status import CallStatus from .call_type import CallType from .cost_breakdown import CostBreakdown -from .create_assistant_dto import CreateAssistantDto from .create_customer_dto import CreateCustomerDto from .create_squad_dto import CreateSquadDto from .create_workflow_dto import CreateWorkflowDto @@ -174,7 +175,7 @@ class Call(UncheckedBaseModel): - Workflow, use `workflowId` or `workflow` """ - assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) """ This is the assistant that will be used for the call. To use an existing assistant, use `assistantId` instead. @@ -301,3 +302,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(Call) diff --git a/src/vapi/types/call_batch_error.py b/src/vapi/types/call_batch_error.py index 4f86a0e..bb48039 100644 --- a/src/vapi/types/call_batch_error.py +++ b/src/vapi/types/call_batch_error.py @@ -1,9 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .create_customer_dto import CreateCustomerDto @@ -20,3 +22,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(CallBatchError) diff --git a/src/vapi/types/call_batch_response.py b/src/vapi/types/call_batch_response.py index 043a3ff..654522a 100644 --- a/src/vapi/types/call_batch_response.py +++ b/src/vapi/types/call_batch_response.py @@ -1,9 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .call import Call from .call_batch_error import CallBatchError @@ -28,3 +30,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(CallBatchResponse) diff --git a/src/vapi/types/call_ended_reason.py b/src/vapi/types/call_ended_reason.py index dbf9906..eb13c89 100644 --- a/src/vapi/types/call_ended_reason.py +++ b/src/vapi/types/call_ended_reason.py @@ -42,6 +42,7 @@ "pipeline-error-hume-voice-failed", "pipeline-error-sesame-voice-failed", "pipeline-error-inworld-voice-failed", + "pipeline-error-minimax-voice-failed", "pipeline-error-tavus-video-failed", "call.in-progress.error-vapifault-openai-voice-failed", "call.in-progress.error-vapifault-cartesia-voice-failed", @@ -56,6 +57,7 @@ "call.in-progress.error-vapifault-hume-voice-failed", "call.in-progress.error-vapifault-sesame-voice-failed", "call.in-progress.error-vapifault-inworld-voice-failed", + "call.in-progress.error-vapifault-minimax-voice-failed", "call.in-progress.error-vapifault-tavus-video-failed", "pipeline-error-vapi-llm-failed", "pipeline-error-vapi-400-bad-request-validation-failed", @@ -64,7 +66,7 @@ "pipeline-error-vapi-429-exceeded-quota", "pipeline-error-vapi-500-server-error", "pipeline-error-vapi-503-server-overloaded-error", - "call.in-progress.error-vapifault-vapi-llm-failed", + "call.in-progress.error-providerfault-vapi-llm-failed", "call.in-progress.error-vapifault-vapi-400-bad-request-validation-failed", "call.in-progress.error-vapifault-vapi-401-unauthorized", "call.in-progress.error-vapifault-vapi-403-model-access-denied", @@ -107,15 +109,15 @@ "call.in-progress.error-vapifault-worker-died", "call.in-progress.twilio-completed-call", "call.in-progress.sip-completed-call", - "call.in-progress.error-vapifault-openai-llm-failed", - "call.in-progress.error-vapifault-azure-openai-llm-failed", - "call.in-progress.error-vapifault-groq-llm-failed", - "call.in-progress.error-vapifault-google-llm-failed", - "call.in-progress.error-vapifault-xai-llm-failed", - "call.in-progress.error-vapifault-mistral-llm-failed", - "call.in-progress.error-vapifault-inflection-ai-llm-failed", - "call.in-progress.error-vapifault-cerebras-llm-failed", - "call.in-progress.error-vapifault-deep-seek-llm-failed", + "call.in-progress.error-providerfault-openai-llm-failed", + "call.in-progress.error-providerfault-azure-openai-llm-failed", + "call.in-progress.error-providerfault-groq-llm-failed", + "call.in-progress.error-providerfault-google-llm-failed", + "call.in-progress.error-providerfault-xai-llm-failed", + "call.in-progress.error-providerfault-mistral-llm-failed", + "call.in-progress.error-providerfault-inflection-ai-llm-failed", + "call.in-progress.error-providerfault-cerebras-llm-failed", + "call.in-progress.error-providerfault-deep-seek-llm-failed", "call.in-progress.error-vapifault-chat-pipeline-failed-to-start", "pipeline-error-openai-400-bad-request-validation-failed", "pipeline-error-openai-401-unauthorized", @@ -247,7 +249,7 @@ "pipeline-error-anthropic-500-server-error", "pipeline-error-anthropic-503-server-overloaded-error", "pipeline-error-anthropic-llm-failed", - "call.in-progress.error-vapifault-anthropic-llm-failed", + "call.in-progress.error-providerfault-anthropic-llm-failed", "call.in-progress.error-vapifault-anthropic-400-bad-request-validation-failed", "call.in-progress.error-vapifault-anthropic-401-unauthorized", "call.in-progress.error-vapifault-anthropic-403-model-access-denied", @@ -261,7 +263,7 @@ "pipeline-error-anthropic-bedrock-500-server-error", "pipeline-error-anthropic-bedrock-503-server-overloaded-error", "pipeline-error-anthropic-bedrock-llm-failed", - "call.in-progress.error-vapifault-anthropic-bedrock-llm-failed", + "call.in-progress.error-providerfault-anthropic-bedrock-llm-failed", "call.in-progress.error-vapifault-anthropic-bedrock-400-bad-request-validation-failed", "call.in-progress.error-vapifault-anthropic-bedrock-401-unauthorized", "call.in-progress.error-vapifault-anthropic-bedrock-403-model-access-denied", @@ -275,7 +277,7 @@ "pipeline-error-anthropic-vertex-500-server-error", "pipeline-error-anthropic-vertex-503-server-overloaded-error", "pipeline-error-anthropic-vertex-llm-failed", - "call.in-progress.error-vapifault-anthropic-vertex-llm-failed", + "call.in-progress.error-providerfault-anthropic-vertex-llm-failed", "call.in-progress.error-vapifault-anthropic-vertex-400-bad-request-validation-failed", "call.in-progress.error-vapifault-anthropic-vertex-401-unauthorized", "call.in-progress.error-vapifault-anthropic-vertex-403-model-access-denied", @@ -289,7 +291,7 @@ "pipeline-error-together-ai-500-server-error", "pipeline-error-together-ai-503-server-overloaded-error", "pipeline-error-together-ai-llm-failed", - "call.in-progress.error-vapifault-together-ai-llm-failed", + "call.in-progress.error-providerfault-together-ai-llm-failed", "call.in-progress.error-vapifault-together-ai-400-bad-request-validation-failed", "call.in-progress.error-vapifault-together-ai-401-unauthorized", "call.in-progress.error-vapifault-together-ai-403-model-access-denied", @@ -303,7 +305,7 @@ "pipeline-error-anyscale-500-server-error", "pipeline-error-anyscale-503-server-overloaded-error", "pipeline-error-anyscale-llm-failed", - "call.in-progress.error-vapifault-anyscale-llm-failed", + "call.in-progress.error-providerfault-anyscale-llm-failed", "call.in-progress.error-vapifault-anyscale-400-bad-request-validation-failed", "call.in-progress.error-vapifault-anyscale-401-unauthorized", "call.in-progress.error-vapifault-anyscale-403-model-access-denied", @@ -317,7 +319,7 @@ "pipeline-error-openrouter-500-server-error", "pipeline-error-openrouter-503-server-overloaded-error", "pipeline-error-openrouter-llm-failed", - "call.in-progress.error-vapifault-openrouter-llm-failed", + "call.in-progress.error-providerfault-openrouter-llm-failed", "call.in-progress.error-vapifault-openrouter-400-bad-request-validation-failed", "call.in-progress.error-vapifault-openrouter-401-unauthorized", "call.in-progress.error-vapifault-openrouter-403-model-access-denied", @@ -331,7 +333,7 @@ "pipeline-error-perplexity-ai-500-server-error", "pipeline-error-perplexity-ai-503-server-overloaded-error", "pipeline-error-perplexity-ai-llm-failed", - "call.in-progress.error-vapifault-perplexity-ai-llm-failed", + "call.in-progress.error-providerfault-perplexity-ai-llm-failed", "call.in-progress.error-vapifault-perplexity-ai-400-bad-request-validation-failed", "call.in-progress.error-vapifault-perplexity-ai-401-unauthorized", "call.in-progress.error-vapifault-perplexity-ai-403-model-access-denied", @@ -345,7 +347,7 @@ "pipeline-error-deepinfra-500-server-error", "pipeline-error-deepinfra-503-server-overloaded-error", "pipeline-error-deepinfra-llm-failed", - "call.in-progress.error-vapifault-deepinfra-llm-failed", + "call.in-progress.error-providerfault-deepinfra-llm-failed", "call.in-progress.error-vapifault-deepinfra-400-bad-request-validation-failed", "call.in-progress.error-vapifault-deepinfra-401-unauthorized", "call.in-progress.error-vapifault-deepinfra-403-model-access-denied", @@ -359,7 +361,7 @@ "pipeline-error-runpod-500-server-error", "pipeline-error-runpod-503-server-overloaded-error", "pipeline-error-runpod-llm-failed", - "call.in-progress.error-vapifault-runpod-llm-failed", + "call.in-progress.error-providerfault-runpod-llm-failed", "call.in-progress.error-vapifault-runpod-400-bad-request-validation-failed", "call.in-progress.error-vapifault-runpod-401-unauthorized", "call.in-progress.error-vapifault-runpod-403-model-access-denied", @@ -373,7 +375,7 @@ "pipeline-error-custom-llm-500-server-error", "pipeline-error-custom-llm-503-server-overloaded-error", "pipeline-error-custom-llm-llm-failed", - "call.in-progress.error-vapifault-custom-llm-llm-failed", + "call.in-progress.error-providerfault-custom-llm-llm-failed", "call.in-progress.error-vapifault-custom-llm-400-bad-request-validation-failed", "call.in-progress.error-vapifault-custom-llm-401-unauthorized", "call.in-progress.error-vapifault-custom-llm-403-model-access-denied", @@ -484,6 +486,12 @@ "call.in-progress.error-vapifault-google-transcriber-failed", "pipeline-error-openai-transcriber-failed", "call.in-progress.error-vapifault-openai-transcriber-failed", + "call.in-progress.error-warm-transfer-max-duration", + "call.in-progress.error-warm-transfer-assistant-cancelled", + "call.in-progress.error-warm-transfer-silence-timeout", + "call.in-progress.error-warm-transfer-microphone-timeout", + "call.in-progress.error-warm-transfer-hang-timeout", + "call.in-progress.error-warm-transfer-idle-timeout", "assistant-ended-call", "assistant-said-end-call-phrase", "assistant-ended-call-with-hangup-task", @@ -494,6 +502,7 @@ "call.in-progress.error-transfer-failed", "customer-busy", "customer-ended-call", + "customer-ended-call-after-warm-transfer-attempt", "customer-did-not-answer", "customer-did-not-give-microphone-permission", "exceeded-max-duration", @@ -509,6 +518,8 @@ "call.in-progress.error-sip-outbound-call-failed-to-connect", "call.ringing.hook-executed-say", "call.ringing.hook-executed-transfer", + "call.ending.hook-executed-say", + "call.ending.hook-executed-transfer", "call.ringing.sip-inbound-caller-hungup-before-call-connect", "call.ringing.error-sip-inbound-call-failed-to-connect", "twilio-failed-to-connect-call", diff --git a/src/vapi/types/call_hook_assistant_speech_interrupted.py b/src/vapi/types/call_hook_assistant_speech_interrupted.py new file mode 100644 index 0000000..9698569 --- /dev/null +++ b/src/vapi/types/call_hook_assistant_speech_interrupted.py @@ -0,0 +1,57 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.unchecked_base_model import UncheckedBaseModel + + +class CallHookAssistantSpeechInterrupted(UncheckedBaseModel): + on: typing.Literal["assistant.speech.interrupted"] = pydantic.Field(default="assistant.speech.interrupted") + """ + This is the event that triggers this hook + """ + + do: typing.List["CallHookAssistantSpeechInterruptedDoItem"] = pydantic.Field() + """ + This is the set of actions to perform when the hook triggers + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted_do_item import CallHookAssistantSpeechInterruptedDoItem # noqa: E402, F401, I001 + +update_forward_refs(CallHookAssistantSpeechInterrupted) diff --git a/src/vapi/types/call_hook_assistant_speech_interrupted_do_item.py b/src/vapi/types/call_hook_assistant_speech_interrupted_do_item.py new file mode 100644 index 0000000..ec0bb85 --- /dev/null +++ b/src/vapi/types/call_hook_assistant_speech_interrupted_do_item.py @@ -0,0 +1,11 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +from .say_hook_action import SayHookAction + +if typing.TYPE_CHECKING: + from .tool_call_hook_action import ToolCallHookAction +CallHookAssistantSpeechInterruptedDoItem = typing.Union[SayHookAction, "ToolCallHookAction"] diff --git a/src/vapi/types/call_hook_call_ending.py b/src/vapi/types/call_hook_call_ending.py new file mode 100644 index 0000000..a6bd801 --- /dev/null +++ b/src/vapi/types/call_hook_call_ending.py @@ -0,0 +1,62 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.unchecked_base_model import UncheckedBaseModel +from .call_hook_filter import CallHookFilter + + +class CallHookCallEnding(UncheckedBaseModel): + on: typing.Literal["call.ending"] = pydantic.Field(default="call.ending") + """ + This is the event that triggers this hook + """ + + do: typing.List["ToolCallHookAction"] = pydantic.Field() + """ + This is the set of actions to perform when the hook triggers + """ + + filters: typing.Optional[typing.List[CallHookFilter]] = pydantic.Field(default=None) + """ + This is the set of filters that must match for the hook to trigger + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(CallHookCallEnding) diff --git a/src/vapi/types/call_hook_customer_speech_interrupted.py b/src/vapi/types/call_hook_customer_speech_interrupted.py new file mode 100644 index 0000000..8cbd179 --- /dev/null +++ b/src/vapi/types/call_hook_customer_speech_interrupted.py @@ -0,0 +1,57 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.unchecked_base_model import UncheckedBaseModel + + +class CallHookCustomerSpeechInterrupted(UncheckedBaseModel): + on: typing.Literal["customer.speech.interrupted"] = pydantic.Field(default="customer.speech.interrupted") + """ + This is the event that triggers this hook + """ + + do: typing.List["CallHookCustomerSpeechInterruptedDoItem"] = pydantic.Field() + """ + This is the set of actions to perform when the hook triggers + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted_do_item import CallHookCustomerSpeechInterruptedDoItem # noqa: E402, F401, I001 + +update_forward_refs(CallHookCustomerSpeechInterrupted) diff --git a/src/vapi/types/call_hook_customer_speech_interrupted_do_item.py b/src/vapi/types/call_hook_customer_speech_interrupted_do_item.py new file mode 100644 index 0000000..a3bd835 --- /dev/null +++ b/src/vapi/types/call_hook_customer_speech_interrupted_do_item.py @@ -0,0 +1,11 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +from .say_hook_action import SayHookAction + +if typing.TYPE_CHECKING: + from .tool_call_hook_action import ToolCallHookAction +CallHookCustomerSpeechInterruptedDoItem = typing.Union[SayHookAction, "ToolCallHookAction"] diff --git a/src/vapi/types/call_hook_customer_speech_timeout.py b/src/vapi/types/call_hook_customer_speech_timeout.py new file mode 100644 index 0000000..bc4727d --- /dev/null +++ b/src/vapi/types/call_hook_customer_speech_timeout.py @@ -0,0 +1,71 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.unchecked_base_model import UncheckedBaseModel +from .customer_speech_timeout_options import CustomerSpeechTimeoutOptions + + +class CallHookCustomerSpeechTimeout(UncheckedBaseModel): + on: str = pydantic.Field() + """ + Must be either "customer.speech.timeout" or match the pattern "customer.speech.timeout[property=value]" + """ + + do: typing.List["CallHookCustomerSpeechTimeoutDoItem"] = pydantic.Field() + """ + This is the set of actions to perform when the hook triggers + """ + + options: typing.Optional[CustomerSpeechTimeoutOptions] = pydantic.Field(default=None) + """ + This is the set of filters that must match for the hook to trigger + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of the hook, it can be set by the user to identify the hook. + If no name is provided, the hook will be auto generated as UUID. + + @default UUID + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout_do_item import CallHookCustomerSpeechTimeoutDoItem # noqa: E402, F401, I001 + +update_forward_refs(CallHookCustomerSpeechTimeout) diff --git a/src/vapi/types/call_hook_customer_speech_timeout_do_item.py b/src/vapi/types/call_hook_customer_speech_timeout_do_item.py new file mode 100644 index 0000000..18581ba --- /dev/null +++ b/src/vapi/types/call_hook_customer_speech_timeout_do_item.py @@ -0,0 +1,11 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +from .say_hook_action import SayHookAction + +if typing.TYPE_CHECKING: + from .tool_call_hook_action import ToolCallHookAction +CallHookCustomerSpeechTimeoutDoItem = typing.Union[SayHookAction, "ToolCallHookAction"] diff --git a/src/vapi/types/assistant_hook_filter.py b/src/vapi/types/call_hook_filter.py similarity index 95% rename from src/vapi/types/assistant_hook_filter.py rename to src/vapi/types/call_hook_filter.py index 2d38cca..3fc40e6 100644 --- a/src/vapi/types/assistant_hook_filter.py +++ b/src/vapi/types/call_hook_filter.py @@ -9,7 +9,7 @@ from ..core.unchecked_base_model import UncheckedBaseModel -class AssistantHookFilter(UncheckedBaseModel): +class CallHookFilter(UncheckedBaseModel): type: typing.Literal["oneOf"] = pydantic.Field(default="oneOf") """ This is the type of filter - currently only "oneOf" is supported diff --git a/src/vapi/types/call_log_privileged.py b/src/vapi/types/call_log_privileged.py deleted file mode 100644 index 49e08ba..0000000 --- a/src/vapi/types/call_log_privileged.py +++ /dev/null @@ -1,47 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing - -import pydantic -import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.serialization import FieldMetadata -from ..core.unchecked_base_model import UncheckedBaseModel -from .call_log_privileged_level import CallLogPrivilegedLevel - - -class CallLogPrivileged(UncheckedBaseModel): - call_id: typing_extensions.Annotated[str, FieldMetadata(alias="callId")] = pydantic.Field() - """ - This is the unique identifier for the call. - """ - - org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() - """ - This is the unique identifier for the org that this call log belongs to. - """ - - log: str = pydantic.Field() - """ - This is the log message associated with the call. - """ - - level: CallLogPrivilegedLevel = pydantic.Field() - """ - This is the level of the log message. - """ - - time: dt.datetime = pydantic.Field() - """ - This is the ISO 8601 date-time string of when the log was created. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/vapi/types/call_log_privileged_level.py b/src/vapi/types/call_log_privileged_level.py deleted file mode 100644 index 5826106..0000000 --- a/src/vapi/types/call_log_privileged_level.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -CallLogPrivilegedLevel = typing.Union[typing.Literal["INFO", "LOG", "WARN", "ERROR", "CHECKPOINT"], typing.Any] diff --git a/src/vapi/types/call_paginated_response.py b/src/vapi/types/call_paginated_response.py index 349ffbe..6888a64 100644 --- a/src/vapi/types/call_paginated_response.py +++ b/src/vapi/types/call_paginated_response.py @@ -1,9 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .call import Call from .pagination_meta import PaginationMeta @@ -21,3 +23,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(CallPaginatedResponse) diff --git a/src/vapi/types/campaign.py b/src/vapi/types/campaign.py index 0795a82..bc32cfa 100644 --- a/src/vapi/types/campaign.py +++ b/src/vapi/types/campaign.py @@ -1,11 +1,13 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import datetime as dt import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .campaign_ended_reason import CampaignEndedReason @@ -129,3 +131,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(Campaign) diff --git a/src/vapi/types/campaign_paginated_response.py b/src/vapi/types/campaign_paginated_response.py index bf13d06..4a56ea7 100644 --- a/src/vapi/types/campaign_paginated_response.py +++ b/src/vapi/types/campaign_paginated_response.py @@ -1,9 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .campaign import Campaign from .pagination_meta import PaginationMeta @@ -21,3 +23,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(CampaignPaginatedResponse) diff --git a/src/vapi/types/cerebras_model.py b/src/vapi/types/cerebras_model.py index 6e38f44..3d09067 100644 --- a/src/vapi/types/cerebras_model.py +++ b/src/vapi/types/cerebras_model.py @@ -1,14 +1,15 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .cerebras_model_model import CerebrasModelModel -from .cerebras_model_tools_item import CerebrasModelToolsItem from .create_custom_knowledge_base_dto import CreateCustomKnowledgeBaseDto from .open_ai_message import OpenAiMessage @@ -19,7 +20,7 @@ class CerebrasModel(UncheckedBaseModel): This is the starting state for the conversation. """ - tools: typing.Optional[typing.List[CerebrasModelToolsItem]] = pydantic.Field(default=None) + tools: typing.Optional[typing.List["CerebrasModelToolsItem"]] = pydantic.Field(default=None) """ These are the tools that the assistant can use during the call. To use existing tools, use `toolIds`. @@ -42,13 +43,6 @@ class CerebrasModel(UncheckedBaseModel): These are the options for the knowledge base. """ - knowledge_base_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="knowledgeBaseId")] = ( - pydantic.Field(default=None) - ) - """ - This is the ID of the knowledge base the model will use. - """ - model: CerebrasModelModel = pydantic.Field() """ This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b @@ -97,3 +91,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 +from .cerebras_model_tools_item import CerebrasModelToolsItem # noqa: E402, F401, I001 + +update_forward_refs(CerebrasModel) diff --git a/src/vapi/types/cerebras_model_tools_item.py b/src/vapi/types/cerebras_model_tools_item.py index 875e6b6..bd79d93 100644 --- a/src/vapi/types/cerebras_model_tools_item.py +++ b/src/vapi/types/cerebras_model_tools_item.py @@ -1,5 +1,7 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing from .create_api_request_tool_dto import CreateApiRequestToolDto @@ -22,6 +24,8 @@ from .create_text_editor_tool_dto import CreateTextEditorToolDto from .create_transfer_call_tool_dto import CreateTransferCallToolDto +if typing.TYPE_CHECKING: + from .create_handoff_tool_dto import CreateHandoffToolDto CerebrasModelToolsItem = typing.Union[ CreateApiRequestToolDto, CreateBashToolDto, @@ -36,6 +40,7 @@ CreateGoogleCalendarCheckAvailabilityToolDto, CreateGoogleCalendarCreateEventToolDto, CreateGoogleSheetsRowAppendToolDto, + "CreateHandoffToolDto", CreateMcpToolDto, CreateQueryToolDto, CreateSlackSendMessageToolDto, diff --git a/src/vapi/types/chat.py b/src/vapi/types/chat.py index 83a68bf..bdbd096 100644 --- a/src/vapi/types/chat.py +++ b/src/vapi/types/chat.py @@ -1,11 +1,13 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import datetime as dt import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .assistant_overrides import AssistantOverrides @@ -13,7 +15,6 @@ from .chat_input import ChatInput from .chat_messages_item import ChatMessagesItem from .chat_output_item import ChatOutputItem -from .create_assistant_dto import CreateAssistantDto class Chat(UncheckedBaseModel): @@ -24,7 +25,7 @@ class Chat(UncheckedBaseModel): This is the assistant that will be used for the chat. To use an existing assistant, use `assistantId` instead. """ - assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) """ This is the assistant that will be used for the chat. To use an existing assistant, use `assistantId` instead. """ @@ -120,3 +121,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(Chat) diff --git a/src/vapi/types/chat_paginated_response.py b/src/vapi/types/chat_paginated_response.py index f3dcb5d..c8e35f1 100644 --- a/src/vapi/types/chat_paginated_response.py +++ b/src/vapi/types/chat_paginated_response.py @@ -1,9 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .chat import Chat from .pagination_meta import PaginationMeta @@ -21,3 +23,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ChatPaginatedResponse) diff --git a/src/vapi/types/client_message.py b/src/vapi/types/client_message.py index c03253d..903ec55 100644 --- a/src/vapi/types/client_message.py +++ b/src/vapi/types/client_message.py @@ -1,9 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .client_message_message import ClientMessageMessage @@ -22,3 +24,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ClientMessage) diff --git a/src/vapi/types/client_message_chat_created.py b/src/vapi/types/client_message_chat_created.py new file mode 100644 index 0000000..5e43a07 --- /dev/null +++ b/src/vapi/types/client_message_chat_created.py @@ -0,0 +1,90 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel +from .call import Call +from .chat import Chat +from .client_message_chat_created_phone_number import ClientMessageChatCreatedPhoneNumber +from .create_customer_dto import CreateCustomerDto + + +class ClientMessageChatCreated(UncheckedBaseModel): + phone_number: typing_extensions.Annotated[ + typing.Optional[ClientMessageChatCreatedPhoneNumber], FieldMetadata(alias="phoneNumber") + ] = pydantic.Field(default=None) + """ + This is the phone number that the message is associated with. + """ + + type: typing.Literal["chat.created"] = pydantic.Field(default="chat.created") + """ + This is the type of the message. "chat.created" is sent when a new chat is created. + """ + + timestamp: typing.Optional[float] = pydantic.Field(default=None) + """ + This is the timestamp of the message. + """ + + call: typing.Optional[Call] = pydantic.Field(default=None) + """ + This is the call that the message is associated with. + """ + + customer: typing.Optional[CreateCustomerDto] = pydantic.Field(default=None) + """ + This is the customer that the message is associated with. + """ + + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) + """ + This is the assistant that the message is associated with. + """ + + chat: Chat = pydantic.Field() + """ + This is the chat that was created. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ClientMessageChatCreated) diff --git a/src/vapi/types/client_message_chat_created_phone_number.py b/src/vapi/types/client_message_chat_created_phone_number.py new file mode 100644 index 0000000..ff040dc --- /dev/null +++ b/src/vapi/types/client_message_chat_created_phone_number.py @@ -0,0 +1,17 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .create_byo_phone_number_dto import CreateByoPhoneNumberDto +from .create_telnyx_phone_number_dto import CreateTelnyxPhoneNumberDto +from .create_twilio_phone_number_dto import CreateTwilioPhoneNumberDto +from .create_vapi_phone_number_dto import CreateVapiPhoneNumberDto +from .create_vonage_phone_number_dto import CreateVonagePhoneNumberDto + +ClientMessageChatCreatedPhoneNumber = typing.Union[ + CreateByoPhoneNumberDto, + CreateTwilioPhoneNumberDto, + CreateVonagePhoneNumberDto, + CreateVapiPhoneNumberDto, + CreateTelnyxPhoneNumberDto, +] diff --git a/src/vapi/types/client_message_chat_deleted.py b/src/vapi/types/client_message_chat_deleted.py new file mode 100644 index 0000000..bfe84ff --- /dev/null +++ b/src/vapi/types/client_message_chat_deleted.py @@ -0,0 +1,90 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel +from .call import Call +from .chat import Chat +from .client_message_chat_deleted_phone_number import ClientMessageChatDeletedPhoneNumber +from .create_customer_dto import CreateCustomerDto + + +class ClientMessageChatDeleted(UncheckedBaseModel): + phone_number: typing_extensions.Annotated[ + typing.Optional[ClientMessageChatDeletedPhoneNumber], FieldMetadata(alias="phoneNumber") + ] = pydantic.Field(default=None) + """ + This is the phone number that the message is associated with. + """ + + type: typing.Literal["chat.deleted"] = pydantic.Field(default="chat.deleted") + """ + This is the type of the message. "chat.deleted" is sent when a chat is deleted. + """ + + timestamp: typing.Optional[float] = pydantic.Field(default=None) + """ + This is the timestamp of the message. + """ + + call: typing.Optional[Call] = pydantic.Field(default=None) + """ + This is the call that the message is associated with. + """ + + customer: typing.Optional[CreateCustomerDto] = pydantic.Field(default=None) + """ + This is the customer that the message is associated with. + """ + + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) + """ + This is the assistant that the message is associated with. + """ + + chat: Chat = pydantic.Field() + """ + This is the chat that was deleted. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ClientMessageChatDeleted) diff --git a/src/vapi/types/client_message_chat_deleted_phone_number.py b/src/vapi/types/client_message_chat_deleted_phone_number.py new file mode 100644 index 0000000..b081624 --- /dev/null +++ b/src/vapi/types/client_message_chat_deleted_phone_number.py @@ -0,0 +1,17 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .create_byo_phone_number_dto import CreateByoPhoneNumberDto +from .create_telnyx_phone_number_dto import CreateTelnyxPhoneNumberDto +from .create_twilio_phone_number_dto import CreateTwilioPhoneNumberDto +from .create_vapi_phone_number_dto import CreateVapiPhoneNumberDto +from .create_vonage_phone_number_dto import CreateVonagePhoneNumberDto + +ClientMessageChatDeletedPhoneNumber = typing.Union[ + CreateByoPhoneNumberDto, + CreateTwilioPhoneNumberDto, + CreateVonagePhoneNumberDto, + CreateVapiPhoneNumberDto, + CreateTelnyxPhoneNumberDto, +] diff --git a/src/vapi/types/client_message_conversation_update.py b/src/vapi/types/client_message_conversation_update.py index cc94aba..0045d91 100644 --- a/src/vapi/types/client_message_conversation_update.py +++ b/src/vapi/types/client_message_conversation_update.py @@ -1,16 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .call import Call from .client_message_conversation_update_messages_item import ClientMessageConversationUpdateMessagesItem from .client_message_conversation_update_phone_number import ClientMessageConversationUpdatePhoneNumber -from .create_assistant_dto import CreateAssistantDto from .create_customer_dto import CreateCustomerDto from .open_ai_message import OpenAiMessage @@ -55,7 +56,7 @@ class ClientMessageConversationUpdate(UncheckedBaseModel): This is the customer that the message is associated with. """ - assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) """ This is the assistant that the message is associated with. """ @@ -68,3 +69,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ClientMessageConversationUpdate) diff --git a/src/vapi/types/client_message_hang.py b/src/vapi/types/client_message_hang.py index 4f94979..ffa2f23 100644 --- a/src/vapi/types/client_message_hang.py +++ b/src/vapi/types/client_message_hang.py @@ -1,15 +1,16 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .call import Call from .client_message_hang_phone_number import ClientMessageHangPhoneNumber -from .create_assistant_dto import CreateAssistantDto from .create_customer_dto import CreateCustomerDto @@ -45,7 +46,7 @@ class ClientMessageHang(UncheckedBaseModel): This is the customer that the message is associated with. """ - assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) """ This is the assistant that the message is associated with. """ @@ -58,3 +59,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ClientMessageHang) diff --git a/src/vapi/types/client_message_language_change_detected.py b/src/vapi/types/client_message_language_change_detected.py index b4a2cca..3f4399e 100644 --- a/src/vapi/types/client_message_language_change_detected.py +++ b/src/vapi/types/client_message_language_change_detected.py @@ -1,15 +1,16 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .call import Call from .client_message_language_change_detected_phone_number import ClientMessageLanguageChangeDetectedPhoneNumber -from .create_assistant_dto import CreateAssistantDto from .create_customer_dto import CreateCustomerDto @@ -41,7 +42,7 @@ class ClientMessageLanguageChangeDetected(UncheckedBaseModel): This is the customer that the message is associated with. """ - assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) """ This is the assistant that the message is associated with. """ @@ -59,3 +60,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ClientMessageLanguageChangeDetected) diff --git a/src/vapi/types/client_message_message.py b/src/vapi/types/client_message_message.py index 2b68767..14026b5 100644 --- a/src/vapi/types/client_message_message.py +++ b/src/vapi/types/client_message_message.py @@ -2,11 +2,16 @@ import typing +from .client_message_chat_created import ClientMessageChatCreated +from .client_message_chat_deleted import ClientMessageChatDeleted from .client_message_conversation_update import ClientMessageConversationUpdate from .client_message_hang import ClientMessageHang from .client_message_language_change_detected import ClientMessageLanguageChangeDetected from .client_message_metadata import ClientMessageMetadata from .client_message_model_output import ClientMessageModelOutput +from .client_message_session_created import ClientMessageSessionCreated +from .client_message_session_deleted import ClientMessageSessionDeleted +from .client_message_session_updated import ClientMessageSessionUpdated from .client_message_speech_update import ClientMessageSpeechUpdate from .client_message_tool_calls import ClientMessageToolCalls from .client_message_tool_calls_result import ClientMessageToolCallsResult @@ -30,4 +35,9 @@ ClientMessageUserInterrupted, ClientMessageLanguageChangeDetected, ClientMessageVoiceInput, + ClientMessageChatCreated, + ClientMessageChatDeleted, + ClientMessageSessionCreated, + ClientMessageSessionUpdated, + ClientMessageSessionDeleted, ] diff --git a/src/vapi/types/client_message_metadata.py b/src/vapi/types/client_message_metadata.py index 6a8c48a..f34e4d3 100644 --- a/src/vapi/types/client_message_metadata.py +++ b/src/vapi/types/client_message_metadata.py @@ -1,15 +1,16 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .call import Call from .client_message_metadata_phone_number import ClientMessageMetadataPhoneNumber -from .create_assistant_dto import CreateAssistantDto from .create_customer_dto import CreateCustomerDto @@ -41,7 +42,7 @@ class ClientMessageMetadata(UncheckedBaseModel): This is the customer that the message is associated with. """ - assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) """ This is the assistant that the message is associated with. """ @@ -59,3 +60,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ClientMessageMetadata) diff --git a/src/vapi/types/client_message_model_output.py b/src/vapi/types/client_message_model_output.py index e49f86a..cfac9c0 100644 --- a/src/vapi/types/client_message_model_output.py +++ b/src/vapi/types/client_message_model_output.py @@ -1,15 +1,16 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .call import Call from .client_message_model_output_phone_number import ClientMessageModelOutputPhoneNumber -from .create_assistant_dto import CreateAssistantDto from .create_customer_dto import CreateCustomerDto @@ -41,7 +42,7 @@ class ClientMessageModelOutput(UncheckedBaseModel): This is the customer that the message is associated with. """ - assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) """ This is the assistant that the message is associated with. """ @@ -59,3 +60,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ClientMessageModelOutput) diff --git a/src/vapi/types/client_message_session_created.py b/src/vapi/types/client_message_session_created.py new file mode 100644 index 0000000..a8786d5 --- /dev/null +++ b/src/vapi/types/client_message_session_created.py @@ -0,0 +1,90 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel +from .call import Call +from .client_message_session_created_phone_number import ClientMessageSessionCreatedPhoneNumber +from .create_customer_dto import CreateCustomerDto +from .session import Session + + +class ClientMessageSessionCreated(UncheckedBaseModel): + phone_number: typing_extensions.Annotated[ + typing.Optional[ClientMessageSessionCreatedPhoneNumber], FieldMetadata(alias="phoneNumber") + ] = pydantic.Field(default=None) + """ + This is the phone number that the message is associated with. + """ + + type: typing.Literal["session.created"] = pydantic.Field(default="session.created") + """ + This is the type of the message. "session.created" is sent when a new session is created. + """ + + timestamp: typing.Optional[float] = pydantic.Field(default=None) + """ + This is the timestamp of the message. + """ + + call: typing.Optional[Call] = pydantic.Field(default=None) + """ + This is the call that the message is associated with. + """ + + customer: typing.Optional[CreateCustomerDto] = pydantic.Field(default=None) + """ + This is the customer that the message is associated with. + """ + + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) + """ + This is the assistant that the message is associated with. + """ + + session: Session = pydantic.Field() + """ + This is the session that was created. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ClientMessageSessionCreated) diff --git a/src/vapi/types/client_message_session_created_phone_number.py b/src/vapi/types/client_message_session_created_phone_number.py new file mode 100644 index 0000000..74209d8 --- /dev/null +++ b/src/vapi/types/client_message_session_created_phone_number.py @@ -0,0 +1,17 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .create_byo_phone_number_dto import CreateByoPhoneNumberDto +from .create_telnyx_phone_number_dto import CreateTelnyxPhoneNumberDto +from .create_twilio_phone_number_dto import CreateTwilioPhoneNumberDto +from .create_vapi_phone_number_dto import CreateVapiPhoneNumberDto +from .create_vonage_phone_number_dto import CreateVonagePhoneNumberDto + +ClientMessageSessionCreatedPhoneNumber = typing.Union[ + CreateByoPhoneNumberDto, + CreateTwilioPhoneNumberDto, + CreateVonagePhoneNumberDto, + CreateVapiPhoneNumberDto, + CreateTelnyxPhoneNumberDto, +] diff --git a/src/vapi/types/client_message_session_deleted.py b/src/vapi/types/client_message_session_deleted.py new file mode 100644 index 0000000..69da565 --- /dev/null +++ b/src/vapi/types/client_message_session_deleted.py @@ -0,0 +1,90 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel +from .call import Call +from .client_message_session_deleted_phone_number import ClientMessageSessionDeletedPhoneNumber +from .create_customer_dto import CreateCustomerDto +from .session import Session + + +class ClientMessageSessionDeleted(UncheckedBaseModel): + phone_number: typing_extensions.Annotated[ + typing.Optional[ClientMessageSessionDeletedPhoneNumber], FieldMetadata(alias="phoneNumber") + ] = pydantic.Field(default=None) + """ + This is the phone number that the message is associated with. + """ + + type: typing.Literal["session.deleted"] = pydantic.Field(default="session.deleted") + """ + This is the type of the message. "session.deleted" is sent when a session is deleted. + """ + + timestamp: typing.Optional[float] = pydantic.Field(default=None) + """ + This is the timestamp of the message. + """ + + call: typing.Optional[Call] = pydantic.Field(default=None) + """ + This is the call that the message is associated with. + """ + + customer: typing.Optional[CreateCustomerDto] = pydantic.Field(default=None) + """ + This is the customer that the message is associated with. + """ + + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) + """ + This is the assistant that the message is associated with. + """ + + session: Session = pydantic.Field() + """ + This is the session that was deleted. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ClientMessageSessionDeleted) diff --git a/src/vapi/types/client_message_session_deleted_phone_number.py b/src/vapi/types/client_message_session_deleted_phone_number.py new file mode 100644 index 0000000..0e44dce --- /dev/null +++ b/src/vapi/types/client_message_session_deleted_phone_number.py @@ -0,0 +1,17 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .create_byo_phone_number_dto import CreateByoPhoneNumberDto +from .create_telnyx_phone_number_dto import CreateTelnyxPhoneNumberDto +from .create_twilio_phone_number_dto import CreateTwilioPhoneNumberDto +from .create_vapi_phone_number_dto import CreateVapiPhoneNumberDto +from .create_vonage_phone_number_dto import CreateVonagePhoneNumberDto + +ClientMessageSessionDeletedPhoneNumber = typing.Union[ + CreateByoPhoneNumberDto, + CreateTwilioPhoneNumberDto, + CreateVonagePhoneNumberDto, + CreateVapiPhoneNumberDto, + CreateTelnyxPhoneNumberDto, +] diff --git a/src/vapi/types/client_message_session_updated.py b/src/vapi/types/client_message_session_updated.py new file mode 100644 index 0000000..da7ad3d --- /dev/null +++ b/src/vapi/types/client_message_session_updated.py @@ -0,0 +1,90 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel +from .call import Call +from .client_message_session_updated_phone_number import ClientMessageSessionUpdatedPhoneNumber +from .create_customer_dto import CreateCustomerDto +from .session import Session + + +class ClientMessageSessionUpdated(UncheckedBaseModel): + phone_number: typing_extensions.Annotated[ + typing.Optional[ClientMessageSessionUpdatedPhoneNumber], FieldMetadata(alias="phoneNumber") + ] = pydantic.Field(default=None) + """ + This is the phone number that the message is associated with. + """ + + type: typing.Literal["session.updated"] = pydantic.Field(default="session.updated") + """ + This is the type of the message. "session.updated" is sent when a session is updated. + """ + + timestamp: typing.Optional[float] = pydantic.Field(default=None) + """ + This is the timestamp of the message. + """ + + call: typing.Optional[Call] = pydantic.Field(default=None) + """ + This is the call that the message is associated with. + """ + + customer: typing.Optional[CreateCustomerDto] = pydantic.Field(default=None) + """ + This is the customer that the message is associated with. + """ + + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) + """ + This is the assistant that the message is associated with. + """ + + session: Session = pydantic.Field() + """ + This is the session that was updated. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ClientMessageSessionUpdated) diff --git a/src/vapi/types/client_message_session_updated_phone_number.py b/src/vapi/types/client_message_session_updated_phone_number.py new file mode 100644 index 0000000..aefe924 --- /dev/null +++ b/src/vapi/types/client_message_session_updated_phone_number.py @@ -0,0 +1,17 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .create_byo_phone_number_dto import CreateByoPhoneNumberDto +from .create_telnyx_phone_number_dto import CreateTelnyxPhoneNumberDto +from .create_twilio_phone_number_dto import CreateTwilioPhoneNumberDto +from .create_vapi_phone_number_dto import CreateVapiPhoneNumberDto +from .create_vonage_phone_number_dto import CreateVonagePhoneNumberDto + +ClientMessageSessionUpdatedPhoneNumber = typing.Union[ + CreateByoPhoneNumberDto, + CreateTwilioPhoneNumberDto, + CreateVonagePhoneNumberDto, + CreateVapiPhoneNumberDto, + CreateTelnyxPhoneNumberDto, +] diff --git a/src/vapi/types/client_message_speech_update.py b/src/vapi/types/client_message_speech_update.py index d7421e9..ca3f6d0 100644 --- a/src/vapi/types/client_message_speech_update.py +++ b/src/vapi/types/client_message_speech_update.py @@ -1,17 +1,18 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .call import Call from .client_message_speech_update_phone_number import ClientMessageSpeechUpdatePhoneNumber from .client_message_speech_update_role import ClientMessageSpeechUpdateRole from .client_message_speech_update_status import ClientMessageSpeechUpdateStatus -from .create_assistant_dto import CreateAssistantDto from .create_customer_dto import CreateCustomerDto @@ -58,7 +59,7 @@ class ClientMessageSpeechUpdate(UncheckedBaseModel): This is the customer that the message is associated with. """ - assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) """ This is the assistant that the message is associated with. """ @@ -71,3 +72,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ClientMessageSpeechUpdate) diff --git a/src/vapi/types/client_message_tool_calls.py b/src/vapi/types/client_message_tool_calls.py index dd33f0f..7487e36 100644 --- a/src/vapi/types/client_message_tool_calls.py +++ b/src/vapi/types/client_message_tool_calls.py @@ -1,16 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .call import Call from .client_message_tool_calls_phone_number import ClientMessageToolCallsPhoneNumber from .client_message_tool_calls_tool_with_tool_call_list_item import ClientMessageToolCallsToolWithToolCallListItem -from .create_assistant_dto import CreateAssistantDto from .create_customer_dto import CreateCustomerDto from .tool_call import ToolCall @@ -50,7 +51,7 @@ class ClientMessageToolCalls(UncheckedBaseModel): This is the customer that the message is associated with. """ - assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) """ This is the assistant that the message is associated with. """ @@ -70,3 +71,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ClientMessageToolCalls) diff --git a/src/vapi/types/client_message_tool_calls_result.py b/src/vapi/types/client_message_tool_calls_result.py index da11643..0ef18a3 100644 --- a/src/vapi/types/client_message_tool_calls_result.py +++ b/src/vapi/types/client_message_tool_calls_result.py @@ -1,15 +1,16 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .call import Call from .client_message_tool_calls_result_phone_number import ClientMessageToolCallsResultPhoneNumber -from .create_assistant_dto import CreateAssistantDto from .create_customer_dto import CreateCustomerDto @@ -41,7 +42,7 @@ class ClientMessageToolCallsResult(UncheckedBaseModel): This is the customer that the message is associated with. """ - assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) """ This is the assistant that the message is associated with. """ @@ -61,3 +62,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ClientMessageToolCallsResult) diff --git a/src/vapi/types/client_message_transcript.py b/src/vapi/types/client_message_transcript.py index bcf6030..7690cba 100644 --- a/src/vapi/types/client_message_transcript.py +++ b/src/vapi/types/client_message_transcript.py @@ -1,10 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .call import Call @@ -12,7 +14,6 @@ from .client_message_transcript_role import ClientMessageTranscriptRole from .client_message_transcript_transcript_type import ClientMessageTranscriptTranscriptType from .client_message_transcript_type import ClientMessageTranscriptType -from .create_assistant_dto import CreateAssistantDto from .create_customer_dto import CreateCustomerDto @@ -44,7 +45,7 @@ class ClientMessageTranscript(UncheckedBaseModel): This is the customer that the message is associated with. """ - assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) """ This is the assistant that the message is associated with. """ @@ -66,6 +67,27 @@ class ClientMessageTranscript(UncheckedBaseModel): This is the transcript content. """ + is_filtered: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="isFiltered")] = pydantic.Field( + default=None + ) + """ + Indicates if the transcript was filtered for security reasons. + """ + + detected_threats: typing_extensions.Annotated[ + typing.Optional[typing.List[str]], FieldMetadata(alias="detectedThreats") + ] = pydantic.Field(default=None) + """ + List of detected security threats if the transcript was filtered. + """ + + original_transcript: typing_extensions.Annotated[ + typing.Optional[str], FieldMetadata(alias="originalTranscript") + ] = pydantic.Field(default=None) + """ + The original transcript before filtering (only included if content was filtered). + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: @@ -74,3 +96,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ClientMessageTranscript) diff --git a/src/vapi/types/client_message_transcript_type.py b/src/vapi/types/client_message_transcript_type.py index fe47961..58f5ccc 100644 --- a/src/vapi/types/client_message_transcript_type.py +++ b/src/vapi/types/client_message_transcript_type.py @@ -2,6 +2,4 @@ import typing -ClientMessageTranscriptType = typing.Union[ - typing.Literal["transcript", 'transcript[transcriptType="final"]'], typing.Any -] +ClientMessageTranscriptType = typing.Union[typing.Literal["transcript[transcriptType='final']"], typing.Any] diff --git a/src/vapi/types/client_message_transfer_update.py b/src/vapi/types/client_message_transfer_update.py index 3a83d49..187d5a4 100644 --- a/src/vapi/types/client_message_transfer_update.py +++ b/src/vapi/types/client_message_transfer_update.py @@ -1,16 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .call import Call from .client_message_transfer_update_destination import ClientMessageTransferUpdateDestination from .client_message_transfer_update_phone_number import ClientMessageTransferUpdatePhoneNumber -from .create_assistant_dto import CreateAssistantDto from .create_customer_dto import CreateCustomerDto @@ -47,20 +48,20 @@ class ClientMessageTransferUpdate(UncheckedBaseModel): This is the customer that the message is associated with. """ - assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) """ This is the assistant that the message is associated with. """ to_assistant: typing_extensions.Annotated[ - typing.Optional[CreateAssistantDto], FieldMetadata(alias="toAssistant") + typing.Optional["CreateAssistantDto"], FieldMetadata(alias="toAssistant") ] = pydantic.Field(default=None) """ This is the assistant that the call is being transferred to. This is only sent if `destination.type` is "assistant". """ from_assistant: typing_extensions.Annotated[ - typing.Optional[CreateAssistantDto], FieldMetadata(alias="fromAssistant") + typing.Optional["CreateAssistantDto"], FieldMetadata(alias="fromAssistant") ] = pydantic.Field(default=None) """ This is the assistant that the call is being transferred from. This is only sent if `destination.type` is "assistant". @@ -88,3 +89,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ClientMessageTransferUpdate) diff --git a/src/vapi/types/client_message_user_interrupted.py b/src/vapi/types/client_message_user_interrupted.py index 480af7b..50633c0 100644 --- a/src/vapi/types/client_message_user_interrupted.py +++ b/src/vapi/types/client_message_user_interrupted.py @@ -1,15 +1,16 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .call import Call from .client_message_user_interrupted_phone_number import ClientMessageUserInterruptedPhoneNumber -from .create_assistant_dto import CreateAssistantDto from .create_customer_dto import CreateCustomerDto @@ -41,7 +42,7 @@ class ClientMessageUserInterrupted(UncheckedBaseModel): This is the customer that the message is associated with. """ - assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) """ This is the assistant that the message is associated with. """ @@ -54,3 +55,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ClientMessageUserInterrupted) diff --git a/src/vapi/types/client_message_voice_input.py b/src/vapi/types/client_message_voice_input.py index 805ac42..12723b0 100644 --- a/src/vapi/types/client_message_voice_input.py +++ b/src/vapi/types/client_message_voice_input.py @@ -1,15 +1,16 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .call import Call from .client_message_voice_input_phone_number import ClientMessageVoiceInputPhoneNumber -from .create_assistant_dto import CreateAssistantDto from .create_customer_dto import CreateCustomerDto @@ -41,7 +42,7 @@ class ClientMessageVoiceInput(UncheckedBaseModel): This is the customer that the message is associated with. """ - assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) """ This is the assistant that the message is associated with. """ @@ -59,3 +60,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ClientMessageVoiceInput) diff --git a/src/vapi/types/client_message_workflow_node_started.py b/src/vapi/types/client_message_workflow_node_started.py index ba8ee66..445ada4 100644 --- a/src/vapi/types/client_message_workflow_node_started.py +++ b/src/vapi/types/client_message_workflow_node_started.py @@ -1,15 +1,16 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .call import Call from .client_message_workflow_node_started_phone_number import ClientMessageWorkflowNodeStartedPhoneNumber -from .create_assistant_dto import CreateAssistantDto from .create_customer_dto import CreateCustomerDto @@ -41,7 +42,7 @@ class ClientMessageWorkflowNodeStarted(UncheckedBaseModel): This is the customer that the message is associated with. """ - assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) """ This is the assistant that the message is associated with. """ @@ -59,3 +60,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ClientMessageWorkflowNodeStarted) diff --git a/src/vapi/types/compliance_plan.py b/src/vapi/types/compliance_plan.py index adaa146..1ccc2e9 100644 --- a/src/vapi/types/compliance_plan.py +++ b/src/vapi/types/compliance_plan.py @@ -7,6 +7,7 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel +from .security_filter_plan import SecurityFilterPlan class CompliancePlan(UncheckedBaseModel): @@ -26,6 +27,13 @@ class CompliancePlan(UncheckedBaseModel): At the end of the call, you will receive an end-of-call-report message to store on your server. Defaults to false. """ + security_filter_plan: typing_extensions.Annotated[ + typing.Optional[SecurityFilterPlan], FieldMetadata(alias="securityFilterPlan") + ] = pydantic.Field(default=None) + """ + This is the security filter plan for the assistant. It allows filtering of transcripts for security threats before sending to LLM. + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/vapi/types/computer_tool.py b/src/vapi/types/computer_tool.py index 9a23562..57bcaf2 100644 --- a/src/vapi/types/computer_tool.py +++ b/src/vapi/types/computer_tool.py @@ -1,16 +1,18 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import datetime as dt import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .computer_tool_messages_item import ComputerToolMessagesItem -from .open_ai_function import OpenAiFunction from .server import Server +from .tool_rejection_plan import ToolRejectionPlan class ComputerTool(UncheckedBaseModel): @@ -62,13 +64,88 @@ class ComputerTool(UncheckedBaseModel): This is the ISO 8601 date-time string of when the tool was last updated. """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ name: typing.Literal["computer"] = pydantic.Field(default="computer") @@ -101,3 +178,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(ComputerTool) diff --git a/src/vapi/types/computer_tool_with_tool_call.py b/src/vapi/types/computer_tool_with_tool_call.py index 936e083..9b94be1 100644 --- a/src/vapi/types/computer_tool_with_tool_call.py +++ b/src/vapi/types/computer_tool_with_tool_call.py @@ -1,16 +1,18 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .computer_tool_with_tool_call_messages_item import ComputerToolWithToolCallMessagesItem -from .open_ai_function import OpenAiFunction from .server import Server from .tool_call import ToolCall +from .tool_rejection_plan import ToolRejectionPlan class ComputerToolWithToolCall(UncheckedBaseModel): @@ -69,13 +71,88 @@ class ComputerToolWithToolCall(UncheckedBaseModel): Optional display number """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -86,3 +163,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(ComputerToolWithToolCall) diff --git a/src/vapi/types/context_engineering_plan_all.py b/src/vapi/types/context_engineering_plan_all.py new file mode 100644 index 0000000..800a8d5 --- /dev/null +++ b/src/vapi/types/context_engineering_plan_all.py @@ -0,0 +1,20 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.unchecked_base_model import UncheckedBaseModel + + +class ContextEngineeringPlanAll(UncheckedBaseModel): + type: typing.Literal["all"] = "all" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/context_engineering_plan_last_n_messages.py b/src/vapi/types/context_engineering_plan_last_n_messages.py new file mode 100644 index 0000000..349e8f5 --- /dev/null +++ b/src/vapi/types/context_engineering_plan_last_n_messages.py @@ -0,0 +1,26 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel + + +class ContextEngineeringPlanLastNMessages(UncheckedBaseModel): + type: typing.Literal["lastNMessages"] = "lastNMessages" + max_messages: typing_extensions.Annotated[float, FieldMetadata(alias="maxMessages")] = pydantic.Field() + """ + This is the maximum number of messages to include in the context engineering plan. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/context_engineering_plan_none.py b/src/vapi/types/context_engineering_plan_none.py new file mode 100644 index 0000000..a4f930b --- /dev/null +++ b/src/vapi/types/context_engineering_plan_none.py @@ -0,0 +1,20 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.unchecked_base_model import UncheckedBaseModel + + +class ContextEngineeringPlanNone(UncheckedBaseModel): + type: typing.Literal["none"] = "none" + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/conversation_node.py b/src/vapi/types/conversation_node.py index 3178846..ebae3f2 100644 --- a/src/vapi/types/conversation_node.py +++ b/src/vapi/types/conversation_node.py @@ -1,13 +1,16 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .conversation_node_model import ConversationNodeModel +from .conversation_node_tools_item import ConversationNodeToolsItem from .conversation_node_transcriber import ConversationNodeTranscriber from .conversation_node_voice import ConversationNodeVoice from .global_node_plan import GlobalNodePlan @@ -48,6 +51,22 @@ class ConversationNode(UncheckedBaseModel): This overrides `workflow.voice`. """ + tools: typing.Optional[typing.List[ConversationNodeToolsItem]] = pydantic.Field(default=None) + """ + These are the tools that the conversation node can use during the call. To use existing tools, use `toolIds`. + + Both `tools` and `toolIds` can be used together. + """ + + tool_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="toolIds")] = ( + pydantic.Field(default=None) + ) + """ + These are the tools that the conversation node can use during the call. To use transient tools, use `tools`. + + Both `tools` and `toolIds` can be used together. + """ + prompt: typing.Optional[str] = None global_node_plan: typing_extensions.Annotated[ typing.Optional[GlobalNodePlan], FieldMetadata(alias="globalNodePlan") @@ -130,3 +149,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ConversationNode) diff --git a/src/vapi/types/conversation_node_tools_item.py b/src/vapi/types/conversation_node_tools_item.py new file mode 100644 index 0000000..7700f8a --- /dev/null +++ b/src/vapi/types/conversation_node_tools_item.py @@ -0,0 +1,47 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .create_api_request_tool_dto import CreateApiRequestToolDto +from .create_bash_tool_dto import CreateBashToolDto +from .create_computer_tool_dto import CreateComputerToolDto +from .create_dtmf_tool_dto import CreateDtmfToolDto +from .create_end_call_tool_dto import CreateEndCallToolDto +from .create_function_tool_dto import CreateFunctionToolDto +from .create_go_high_level_calendar_availability_tool_dto import CreateGoHighLevelCalendarAvailabilityToolDto +from .create_go_high_level_calendar_event_create_tool_dto import CreateGoHighLevelCalendarEventCreateToolDto +from .create_go_high_level_contact_create_tool_dto import CreateGoHighLevelContactCreateToolDto +from .create_go_high_level_contact_get_tool_dto import CreateGoHighLevelContactGetToolDto +from .create_google_calendar_check_availability_tool_dto import CreateGoogleCalendarCheckAvailabilityToolDto +from .create_google_calendar_create_event_tool_dto import CreateGoogleCalendarCreateEventToolDto +from .create_google_sheets_row_append_tool_dto import CreateGoogleSheetsRowAppendToolDto +from .create_handoff_tool_dto import CreateHandoffToolDto +from .create_mcp_tool_dto import CreateMcpToolDto +from .create_query_tool_dto import CreateQueryToolDto +from .create_slack_send_message_tool_dto import CreateSlackSendMessageToolDto +from .create_sms_tool_dto import CreateSmsToolDto +from .create_text_editor_tool_dto import CreateTextEditorToolDto +from .create_transfer_call_tool_dto import CreateTransferCallToolDto + +ConversationNodeToolsItem = typing.Union[ + CreateApiRequestToolDto, + CreateBashToolDto, + CreateComputerToolDto, + CreateDtmfToolDto, + CreateEndCallToolDto, + CreateFunctionToolDto, + CreateGoHighLevelCalendarAvailabilityToolDto, + CreateGoHighLevelCalendarEventCreateToolDto, + CreateGoHighLevelContactCreateToolDto, + CreateGoHighLevelContactGetToolDto, + CreateGoogleCalendarCheckAvailabilityToolDto, + CreateGoogleCalendarCreateEventToolDto, + CreateGoogleSheetsRowAppendToolDto, + CreateHandoffToolDto, + CreateMcpToolDto, + CreateQueryToolDto, + CreateSlackSendMessageToolDto, + CreateSmsToolDto, + CreateTextEditorToolDto, + CreateTransferCallToolDto, +] diff --git a/src/vapi/types/conversation_node_voice.py b/src/vapi/types/conversation_node_voice.py index 09e0539..f02b3dd 100644 --- a/src/vapi/types/conversation_node_voice.py +++ b/src/vapi/types/conversation_node_voice.py @@ -10,6 +10,7 @@ from .hume_voice import HumeVoice from .inworld_voice import InworldVoice from .lmnt_voice import LmntVoice +from .minimax_voice import MinimaxVoice from .neuphonic_voice import NeuphonicVoice from .open_ai_voice import OpenAiVoice from .play_ht_voice import PlayHtVoice @@ -36,4 +37,5 @@ VapiVoice, SesameVoice, InworldVoice, + MinimaxVoice, ] diff --git a/src/vapi/types/create_api_request_tool_dto.py b/src/vapi/types/create_api_request_tool_dto.py index 653a1b7..c71eafa 100644 --- a/src/vapi/types/create_api_request_tool_dto.py +++ b/src/vapi/types/create_api_request_tool_dto.py @@ -1,17 +1,19 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .backoff_plan import BackoffPlan from .create_api_request_tool_dto_messages_item import CreateApiRequestToolDtoMessagesItem from .create_api_request_tool_dto_method import CreateApiRequestToolDtoMethod from .json_schema import JsonSchema -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan from .variable_extraction_plan import VariableExtractionPlan @@ -34,6 +36,13 @@ class CreateApiRequestToolDto(UncheckedBaseModel): @default 20 """ + credential_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="credentialId")] = ( + pydantic.Field(default=None) + ) + """ + The credential ID for API request authentication + """ + name: typing.Optional[str] = pydantic.Field(default=None) """ This is the name of the tool. This will be passed to the model. @@ -58,7 +67,7 @@ class CreateApiRequestToolDto(UncheckedBaseModel): headers: typing.Optional[JsonSchema] = pydantic.Field(default=None) """ - These are the headers to send in the request. + These are the headers to send with the request. """ backoff_plan: typing_extensions.Annotated[typing.Optional[BackoffPlan], FieldMetadata(alias="backoffPlan")] = ( @@ -153,33 +162,9 @@ class CreateApiRequestToolDto(UncheckedBaseModel): } } ``` - - 4.2. If you hit example.com and it returns `{"name": {"first": "John", "last": "Doe"}}`, then you can specify the schema as: - - ```json - { - "schema": { - "type": "object", - "properties": { - "name": { - "type": "object", - "properties": { - "first": { - "type": "string" - }, - "last": { - "type": "string" - } - } - } - } - } - } - ``` - These will be extracted as `{{ name }}` and `{{ age }}` respectively. To emphasize, object properties are extracted as direct global variables. - 4.3. If you hit example.com and it returns `{"name": {"first": "John", "last": "Doe"}}`, then you can specify the schema as: + 4.2. If you hit example.com and it returns `{"name": {"first": "John", "last": "Doe"}}`, then you can specify the schema as: ```json { @@ -204,7 +189,7 @@ class CreateApiRequestToolDto(UncheckedBaseModel): These will be extracted as `{{ name }}`. And, `{{ name.first }}` and `{{ name.last }}` will be accessible. - 4.4. If you hit example.com and it returns `["94123", "94124"]`, then you can specify the schema as: + 4.3. If you hit example.com and it returns `["94123", "94124"]`, then you can specify the schema as: ```json { @@ -220,7 +205,7 @@ class CreateApiRequestToolDto(UncheckedBaseModel): This will be extracted as `{{ zipCodes }}`. To access the array items, you can use `{{ zipCodes[0] }}` and `{{ zipCodes[1] }}`. - 4.5. If you hit example.com and it returns `[{"name": "John", "age": 30, "zipCodes": ["94123", "94124"]}, {"name": "Jane", "age": 25, "zipCodes": ["94125", "94126"]}]`, then you can specify the schema as: + 4.4. If you hit example.com and it returns `[{"name": "John", "age": 30, "zipCodes": ["94123", "94124"]}, {"name": "Jane", "age": 25, "zipCodes": ["94125", "94126"]}]`, then you can specify the schema as: ```json { @@ -253,13 +238,88 @@ class CreateApiRequestToolDto(UncheckedBaseModel): Note: Both `aliases` and `schema` can be used together. """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -270,3 +330,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(CreateApiRequestToolDto) diff --git a/src/vapi/types/create_api_request_tool_dto_method.py b/src/vapi/types/create_api_request_tool_dto_method.py index 106226f..666b73d 100644 --- a/src/vapi/types/create_api_request_tool_dto_method.py +++ b/src/vapi/types/create_api_request_tool_dto_method.py @@ -2,4 +2,4 @@ import typing -CreateApiRequestToolDtoMethod = typing.Union[typing.Literal["POST", "GET"], typing.Any] +CreateApiRequestToolDtoMethod = typing.Union[typing.Literal["POST", "GET", "PUT", "PATCH", "DELETE"], typing.Any] diff --git a/src/vapi/types/create_assistant_dto.py b/src/vapi/types/create_assistant_dto.py index 0d23c3a..7c07f69 100644 --- a/src/vapi/types/create_assistant_dto.py +++ b/src/vapi/types/create_assistant_dto.py @@ -1,10 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .analysis_plan import AnalysisPlan @@ -15,15 +17,12 @@ from .create_assistant_dto_client_messages_item import CreateAssistantDtoClientMessagesItem from .create_assistant_dto_credentials_item import CreateAssistantDtoCredentialsItem from .create_assistant_dto_first_message_mode import CreateAssistantDtoFirstMessageMode -from .create_assistant_dto_hooks_item import CreateAssistantDtoHooksItem -from .create_assistant_dto_model import CreateAssistantDtoModel from .create_assistant_dto_server_messages_item import CreateAssistantDtoServerMessagesItem from .create_assistant_dto_transcriber import CreateAssistantDtoTranscriber from .create_assistant_dto_voice import CreateAssistantDtoVoice from .create_assistant_dto_voicemail_detection import CreateAssistantDtoVoicemailDetection from .keypad_input_plan import KeypadInputPlan from .langfuse_observability_plan import LangfuseObservabilityPlan -from .message_plan import MessagePlan from .monitor_plan import MonitorPlan from .server import Server from .start_speaking_plan import StartSpeakingPlan @@ -37,7 +36,7 @@ class CreateAssistantDto(UncheckedBaseModel): These are the options for the assistant's transcriber. """ - model: typing.Optional[CreateAssistantDtoModel] = pydantic.Field(default=None) + model: typing.Optional["CreateAssistantDtoModel"] = pydantic.Field(default=None) """ These are the options for the assistant's LLM. """ @@ -93,16 +92,7 @@ class CreateAssistantDto(UncheckedBaseModel): typing.Optional[typing.List[CreateAssistantDtoServerMessagesItem]], FieldMetadata(alias="serverMessages") ] = pydantic.Field(default=None) """ - These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema. - """ - - silence_timeout_seconds: typing_extensions.Annotated[ - typing.Optional[float], FieldMetadata(alias="silenceTimeoutSeconds") - ] = pydantic.Field(default=None) - """ - How many seconds of silence to wait before ending the call. Defaults to 30. - - @default 30 + These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,handoff-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema. """ max_duration_seconds: typing_extensions.Annotated[ @@ -122,17 +112,6 @@ class CreateAssistantDto(UncheckedBaseModel): You can also provide a custom sound by providing a URL to an audio file. """ - background_denoising_enabled: typing_extensions.Annotated[ - typing.Optional[bool], FieldMetadata(alias="backgroundDenoisingEnabled") - ] = pydantic.Field(default=None) - """ - This enables filtering of noise and background speech while the user is talking. - - Default `false` while in beta. - - @default false - """ - model_output_in_messages_enabled: typing_extensions.Annotated[ typing.Optional[bool], FieldMetadata(alias="modelOutputInMessagesEnabled") ] = pydantic.Field(default=None) @@ -165,7 +144,7 @@ class CreateAssistantDto(UncheckedBaseModel): These are dynamic credentials that will be used for the assistant calls. By default, all the credentials are available for use in the call but you can supplement an additional credentials using this. Dynamic credentials override existing credentials. """ - hooks: typing.Optional[typing.List[CreateAssistantDtoHooksItem]] = pydantic.Field(default=None) + hooks: typing.Optional[typing.List["CreateAssistantDtoHooksItem"]] = pydantic.Field(default=None) """ This is a set of actions that will be performed on certain events. """ @@ -241,15 +220,6 @@ class CreateAssistantDto(UncheckedBaseModel): This is the plan for artifacts generated during assistant's calls. Stored in `call.artifact`. """ - message_plan: typing_extensions.Annotated[typing.Optional[MessagePlan], FieldMetadata(alias="messagePlan")] = ( - pydantic.Field(default=None) - ) - """ - This is the plan for static predefined messages that can be spoken by the assistant during the call, like `idleMessages`. - - Note: `firstMessage`, `voicemailMessage`, and `endCallMessage` are currently at the root level. They will be moved to `messagePlan` in the future, but will remain backwards compatible. - """ - start_speaking_plan: typing_extensions.Annotated[ typing.Optional[StartSpeakingPlan], FieldMetadata(alias="startSpeakingPlan") ] = pydantic.Field(default=None) @@ -317,3 +287,31 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 +from .create_assistant_dto_model import CreateAssistantDtoModel # noqa: E402, F401, I001 +from .create_assistant_dto_hooks_item import CreateAssistantDtoHooksItem # noqa: E402, F401, I001 + +update_forward_refs(CreateAssistantDto) diff --git a/src/vapi/types/create_assistant_dto_credentials_item.py b/src/vapi/types/create_assistant_dto_credentials_item.py index 0ca499c..63cbdcc 100644 --- a/src/vapi/types/create_assistant_dto_credentials_item.py +++ b/src/vapi/types/create_assistant_dto_credentials_item.py @@ -11,6 +11,7 @@ from .create_cartesia_credential_dto import CreateCartesiaCredentialDto from .create_cerebras_credential_dto import CreateCerebrasCredentialDto from .create_cloudflare_credential_dto import CreateCloudflareCredentialDto +from .create_custom_credential_dto import CreateCustomCredentialDto from .create_custom_llm_credential_dto import CreateCustomLlmCredentialDto from .create_deep_infra_credential_dto import CreateDeepInfraCredentialDto from .create_deep_seek_credential_dto import CreateDeepSeekCredentialDto @@ -31,9 +32,11 @@ from .create_groq_credential_dto import CreateGroqCredentialDto from .create_hume_credential_dto import CreateHumeCredentialDto from .create_inflection_ai_credential_dto import CreateInflectionAiCredentialDto +from .create_inworld_credential_dto import CreateInworldCredentialDto from .create_langfuse_credential_dto import CreateLangfuseCredentialDto from .create_lmnt_credential_dto import CreateLmntCredentialDto from .create_make_credential_dto import CreateMakeCredentialDto +from .create_minimax_credential_dto import CreateMinimaxCredentialDto from .create_mistral_credential_dto import CreateMistralCredentialDto from .create_neuphonic_credential_dto import CreateNeuphonicCredentialDto from .create_open_ai_credential_dto import CreateOpenAiCredentialDto @@ -93,6 +96,7 @@ CreateTwilioCredentialDto, CreateVonageCredentialDto, CreateWebhookCredentialDto, + CreateCustomCredentialDto, CreateXAiCredentialDto, CreateNeuphonicCredentialDto, CreateHumeCredentialDto, @@ -104,5 +108,6 @@ CreateGoogleSheetsOAuth2AuthorizationCredentialDto, CreateSlackOAuth2AuthorizationCredentialDto, CreateGoHighLevelMcpCredentialDto, - typing.Optional[typing.Any], + CreateInworldCredentialDto, + CreateMinimaxCredentialDto, ] diff --git a/src/vapi/types/create_assistant_dto_hooks_item.py b/src/vapi/types/create_assistant_dto_hooks_item.py index 400f3f5..e6e7721 100644 --- a/src/vapi/types/create_assistant_dto_hooks_item.py +++ b/src/vapi/types/create_assistant_dto_hooks_item.py @@ -1,11 +1,17 @@ # This file was auto-generated by Fern from our API Definition. -import typing +from __future__ import annotations -from .assistant_hook_assistant_speech_interrupted import AssistantHookAssistantSpeechInterrupted -from .assistant_hook_call_ending import AssistantHookCallEnding -from .assistant_hook_customer_speech_interrupted import AssistantHookCustomerSpeechInterrupted +import typing +if typing.TYPE_CHECKING: + from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted + from .call_hook_call_ending import CallHookCallEnding + from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted + from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout CreateAssistantDtoHooksItem = typing.Union[ - AssistantHookCallEnding, AssistantHookAssistantSpeechInterrupted, AssistantHookCustomerSpeechInterrupted + "CallHookCallEnding", + "CallHookAssistantSpeechInterrupted", + "CallHookCustomerSpeechInterrupted", + "CallHookCustomerSpeechTimeout", ] diff --git a/src/vapi/types/create_assistant_dto_model.py b/src/vapi/types/create_assistant_dto_model.py index 05c87a2..789d86a 100644 --- a/src/vapi/types/create_assistant_dto_model.py +++ b/src/vapi/types/create_assistant_dto_model.py @@ -1,35 +1,37 @@ # This file was auto-generated by Fern from our API Definition. -import typing +from __future__ import annotations -from .anthropic_model import AnthropicModel -from .anyscale_model import AnyscaleModel -from .cerebras_model import CerebrasModel -from .custom_llm_model import CustomLlmModel -from .deep_infra_model import DeepInfraModel -from .deep_seek_model import DeepSeekModel -from .google_model import GoogleModel -from .groq_model import GroqModel -from .inflection_ai_model import InflectionAiModel -from .open_ai_model import OpenAiModel -from .open_router_model import OpenRouterModel -from .perplexity_ai_model import PerplexityAiModel -from .together_ai_model import TogetherAiModel -from .xai_model import XaiModel +import typing +if typing.TYPE_CHECKING: + from .anthropic_model import AnthropicModel + from .anyscale_model import AnyscaleModel + from .cerebras_model import CerebrasModel + from .custom_llm_model import CustomLlmModel + from .deep_infra_model import DeepInfraModel + from .deep_seek_model import DeepSeekModel + from .google_model import GoogleModel + from .groq_model import GroqModel + from .inflection_ai_model import InflectionAiModel + from .open_ai_model import OpenAiModel + from .open_router_model import OpenRouterModel + from .perplexity_ai_model import PerplexityAiModel + from .together_ai_model import TogetherAiModel + from .xai_model import XaiModel CreateAssistantDtoModel = typing.Union[ - AnthropicModel, - AnyscaleModel, - CerebrasModel, - CustomLlmModel, - DeepInfraModel, - DeepSeekModel, - GoogleModel, - GroqModel, - InflectionAiModel, - OpenAiModel, - OpenRouterModel, - PerplexityAiModel, - TogetherAiModel, - XaiModel, + "AnthropicModel", + "AnyscaleModel", + "CerebrasModel", + "CustomLlmModel", + "DeepInfraModel", + "DeepSeekModel", + "GoogleModel", + "GroqModel", + "InflectionAiModel", + "OpenAiModel", + "OpenRouterModel", + "PerplexityAiModel", + "TogetherAiModel", + "XaiModel", ] diff --git a/src/vapi/types/create_assistant_dto_voice.py b/src/vapi/types/create_assistant_dto_voice.py index 9ee35f0..72bee4c 100644 --- a/src/vapi/types/create_assistant_dto_voice.py +++ b/src/vapi/types/create_assistant_dto_voice.py @@ -10,6 +10,7 @@ from .hume_voice import HumeVoice from .inworld_voice import InworldVoice from .lmnt_voice import LmntVoice +from .minimax_voice import MinimaxVoice from .neuphonic_voice import NeuphonicVoice from .open_ai_voice import OpenAiVoice from .play_ht_voice import PlayHtVoice @@ -36,4 +37,5 @@ VapiVoice, SesameVoice, InworldVoice, + MinimaxVoice, ] diff --git a/src/vapi/types/create_azure_open_ai_credential_dto_models_item.py b/src/vapi/types/create_azure_open_ai_credential_dto_models_item.py index a29429e..09cff95 100644 --- a/src/vapi/types/create_azure_open_ai_credential_dto_models_item.py +++ b/src/vapi/types/create_azure_open_ai_credential_dto_models_item.py @@ -4,6 +4,9 @@ CreateAzureOpenAiCredentialDtoModelsItem = typing.Union[ typing.Literal[ + "gpt-5", + "gpt-5-mini", + "gpt-5-nano", "gpt-4.1-2025-04-14", "gpt-4.1-mini-2025-04-14", "gpt-4.1-nano-2025-04-14", diff --git a/src/vapi/types/create_bash_tool_dto.py b/src/vapi/types/create_bash_tool_dto.py index 83a9268..a851f5c 100644 --- a/src/vapi/types/create_bash_tool_dto.py +++ b/src/vapi/types/create_bash_tool_dto.py @@ -1,15 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .create_bash_tool_dto_messages_item import CreateBashToolDtoMessagesItem -from .open_ai_function import OpenAiFunction from .server import Server +from .tool_rejection_plan import ToolRejectionPlan class CreateBashToolDto(UncheckedBaseModel): @@ -46,13 +48,88 @@ class CreateBashToolDto(UncheckedBaseModel): The name of the tool, fixed to 'bash' """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -63,3 +140,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(CreateBashToolDto) diff --git a/src/vapi/types/create_byo_phone_number_dto.py b/src/vapi/types/create_byo_phone_number_dto.py index 19c3315..ed41a98 100644 --- a/src/vapi/types/create_byo_phone_number_dto.py +++ b/src/vapi/types/create_byo_phone_number_dto.py @@ -8,7 +8,7 @@ from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .create_byo_phone_number_dto_fallback_destination import CreateByoPhoneNumberDtoFallbackDestination -from .phone_number_hook_call_ringing import PhoneNumberHookCallRinging +from .create_byo_phone_number_dto_hooks_item import CreateByoPhoneNumberDtoHooksItem from .server import Server @@ -25,7 +25,7 @@ class CreateByoPhoneNumberDto(UncheckedBaseModel): If this is not set and above conditions are met, the inbound call is hung up with an error message. """ - hooks: typing.Optional[typing.List[PhoneNumberHookCallRinging]] = pydantic.Field(default=None) + hooks: typing.Optional[typing.List[CreateByoPhoneNumberDtoHooksItem]] = pydantic.Field(default=None) """ This is the hooks that will be used for incoming calls to this phone number. """ diff --git a/src/vapi/types/create_byo_phone_number_dto_hooks_item.py b/src/vapi/types/create_byo_phone_number_dto_hooks_item.py new file mode 100644 index 0000000..337ec38 --- /dev/null +++ b/src/vapi/types/create_byo_phone_number_dto_hooks_item.py @@ -0,0 +1,8 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .phone_number_hook_call_ending import PhoneNumberHookCallEnding +from .phone_number_hook_call_ringing import PhoneNumberHookCallRinging + +CreateByoPhoneNumberDtoHooksItem = typing.Union[PhoneNumberHookCallRinging, PhoneNumberHookCallEnding] diff --git a/src/vapi/types/create_computer_tool_dto.py b/src/vapi/types/create_computer_tool_dto.py index 6d8f4e0..7f74b54 100644 --- a/src/vapi/types/create_computer_tool_dto.py +++ b/src/vapi/types/create_computer_tool_dto.py @@ -1,15 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .create_computer_tool_dto_messages_item import CreateComputerToolDtoMessagesItem -from .open_ai_function import OpenAiFunction from .server import Server +from .tool_rejection_plan import ToolRejectionPlan class CreateComputerToolDto(UncheckedBaseModel): @@ -63,13 +65,88 @@ class CreateComputerToolDto(UncheckedBaseModel): Optional display number """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -80,3 +157,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(CreateComputerToolDto) diff --git a/src/vapi/types/create_custom_credential_dto.py b/src/vapi/types/create_custom_credential_dto.py new file mode 100644 index 0000000..b2555f0 --- /dev/null +++ b/src/vapi/types/create_custom_credential_dto.py @@ -0,0 +1,34 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel +from .create_custom_credential_dto_authentication_plan import CreateCustomCredentialDtoAuthenticationPlan + + +class CreateCustomCredentialDto(UncheckedBaseModel): + provider: typing.Literal["custom-credential"] = "custom-credential" + authentication_plan: typing_extensions.Annotated[ + CreateCustomCredentialDtoAuthenticationPlan, FieldMetadata(alias="authenticationPlan") + ] = pydantic.Field() + """ + This is the authentication plan. Supports OAuth2 RFC 6749, HMAC signing, and Bearer authentication. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of credential. This is just for your reference. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_custom_credential_dto_authentication_plan.py b/src/vapi/types/create_custom_credential_dto_authentication_plan.py new file mode 100644 index 0000000..8ac2dcf --- /dev/null +++ b/src/vapi/types/create_custom_credential_dto_authentication_plan.py @@ -0,0 +1,11 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .bearer_authentication_plan import BearerAuthenticationPlan +from .hmac_authentication_plan import HmacAuthenticationPlan +from .o_auth_2_authentication_plan import OAuth2AuthenticationPlan + +CreateCustomCredentialDtoAuthenticationPlan = typing.Union[ + OAuth2AuthenticationPlan, HmacAuthenticationPlan, BearerAuthenticationPlan +] diff --git a/src/vapi/types/create_custom_knowledge_base_dto.py b/src/vapi/types/create_custom_knowledge_base_dto.py index f264af6..f1696f2 100644 --- a/src/vapi/types/create_custom_knowledge_base_dto.py +++ b/src/vapi/types/create_custom_knowledge_base_dto.py @@ -9,7 +9,11 @@ class CreateCustomKnowledgeBaseDto(UncheckedBaseModel): - provider: typing.Literal["custom-knowledge-base"] = "custom-knowledge-base" + provider: typing.Literal["custom-knowledge-base"] = pydantic.Field(default="custom-knowledge-base") + """ + This knowledge base is bring your own knowledge base implementation. + """ + server: Server = pydantic.Field() """ This is where the knowledge base request will be sent. diff --git a/src/vapi/types/create_customer_dto.py b/src/vapi/types/create_customer_dto.py index c414208..759f76b 100644 --- a/src/vapi/types/create_customer_dto.py +++ b/src/vapi/types/create_customer_dto.py @@ -1,10 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .assistant_overrides import AssistantOverrides @@ -78,3 +80,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(CreateCustomerDto) diff --git a/src/vapi/types/create_dtmf_tool_dto.py b/src/vapi/types/create_dtmf_tool_dto.py index d908e73..9f20792 100644 --- a/src/vapi/types/create_dtmf_tool_dto.py +++ b/src/vapi/types/create_dtmf_tool_dto.py @@ -1,12 +1,16 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .create_dtmf_tool_dto_messages_item import CreateDtmfToolDtoMessagesItem -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan class CreateDtmfToolDto(UncheckedBaseModel): @@ -18,13 +22,88 @@ class CreateDtmfToolDto(UncheckedBaseModel): """ type: typing.Literal["dtmf"] = "dtmf" - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -35,3 +114,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(CreateDtmfToolDto) diff --git a/src/vapi/types/create_end_call_tool_dto.py b/src/vapi/types/create_end_call_tool_dto.py index 977fdee..d8fb74d 100644 --- a/src/vapi/types/create_end_call_tool_dto.py +++ b/src/vapi/types/create_end_call_tool_dto.py @@ -1,12 +1,16 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .create_end_call_tool_dto_messages_item import CreateEndCallToolDtoMessagesItem -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan class CreateEndCallToolDto(UncheckedBaseModel): @@ -18,13 +22,88 @@ class CreateEndCallToolDto(UncheckedBaseModel): """ type: typing.Literal["endCall"] = "endCall" - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -35,3 +114,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(CreateEndCallToolDto) diff --git a/src/vapi/types/create_function_tool_dto.py b/src/vapi/types/create_function_tool_dto.py index 7584554..63d0523 100644 --- a/src/vapi/types/create_function_tool_dto.py +++ b/src/vapi/types/create_function_tool_dto.py @@ -1,15 +1,18 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .create_function_tool_dto_messages_item import CreateFunctionToolDtoMessagesItem from .open_ai_function import OpenAiFunction from .server import Server +from .tool_rejection_plan import ToolRejectionPlan class CreateFunctionToolDto(UncheckedBaseModel): @@ -50,10 +53,90 @@ class CreateFunctionToolDto(UncheckedBaseModel): function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) """ This is the function definition of the tool. + """ + + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) + """ + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` + + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -64,3 +147,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(CreateFunctionToolDto) diff --git a/src/vapi/types/create_ghl_tool_dto.py b/src/vapi/types/create_ghl_tool_dto.py index eb34a10..b860f05 100644 --- a/src/vapi/types/create_ghl_tool_dto.py +++ b/src/vapi/types/create_ghl_tool_dto.py @@ -1,13 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .create_ghl_tool_dto_messages_item import CreateGhlToolDtoMessagesItem from .ghl_tool_metadata import GhlToolMetadata -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan class CreateGhlToolDto(UncheckedBaseModel): @@ -18,15 +22,94 @@ class CreateGhlToolDto(UncheckedBaseModel): For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. """ - type: typing.Literal["ghl"] = "ghl" + type: typing.Literal["ghl"] = pydantic.Field(default="ghl") + """ + The type of tool. "ghl" for GHL tool. + """ + metadata: GhlToolMetadata - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` + + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -37,3 +120,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(CreateGhlToolDto) diff --git a/src/vapi/types/create_go_high_level_calendar_availability_tool_dto.py b/src/vapi/types/create_go_high_level_calendar_availability_tool_dto.py index 9b6283a..bf6f4df 100644 --- a/src/vapi/types/create_go_high_level_calendar_availability_tool_dto.py +++ b/src/vapi/types/create_go_high_level_calendar_availability_tool_dto.py @@ -1,14 +1,18 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .create_go_high_level_calendar_availability_tool_dto_messages_item import ( CreateGoHighLevelCalendarAvailabilityToolDtoMessagesItem, ) -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan class CreateGoHighLevelCalendarAvailabilityToolDto(UncheckedBaseModel): @@ -22,13 +26,88 @@ class CreateGoHighLevelCalendarAvailabilityToolDto(UncheckedBaseModel): """ type: typing.Literal["gohighlevel.calendar.availability.check"] = "gohighlevel.calendar.availability.check" - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -39,3 +118,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(CreateGoHighLevelCalendarAvailabilityToolDto) diff --git a/src/vapi/types/create_go_high_level_calendar_event_create_tool_dto.py b/src/vapi/types/create_go_high_level_calendar_event_create_tool_dto.py index 5c58605..306cbe4 100644 --- a/src/vapi/types/create_go_high_level_calendar_event_create_tool_dto.py +++ b/src/vapi/types/create_go_high_level_calendar_event_create_tool_dto.py @@ -1,14 +1,18 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .create_go_high_level_calendar_event_create_tool_dto_messages_item import ( CreateGoHighLevelCalendarEventCreateToolDtoMessagesItem, ) -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan class CreateGoHighLevelCalendarEventCreateToolDto(UncheckedBaseModel): @@ -22,13 +26,88 @@ class CreateGoHighLevelCalendarEventCreateToolDto(UncheckedBaseModel): """ type: typing.Literal["gohighlevel.calendar.event.create"] = "gohighlevel.calendar.event.create" - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -39,3 +118,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(CreateGoHighLevelCalendarEventCreateToolDto) diff --git a/src/vapi/types/create_go_high_level_contact_create_tool_dto.py b/src/vapi/types/create_go_high_level_contact_create_tool_dto.py index f22d44c..4312cd7 100644 --- a/src/vapi/types/create_go_high_level_contact_create_tool_dto.py +++ b/src/vapi/types/create_go_high_level_contact_create_tool_dto.py @@ -1,14 +1,18 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .create_go_high_level_contact_create_tool_dto_messages_item import ( CreateGoHighLevelContactCreateToolDtoMessagesItem, ) -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan class CreateGoHighLevelContactCreateToolDto(UncheckedBaseModel): @@ -22,13 +26,88 @@ class CreateGoHighLevelContactCreateToolDto(UncheckedBaseModel): """ type: typing.Literal["gohighlevel.contact.create"] = "gohighlevel.contact.create" - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -39,3 +118,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(CreateGoHighLevelContactCreateToolDto) diff --git a/src/vapi/types/create_go_high_level_contact_get_tool_dto.py b/src/vapi/types/create_go_high_level_contact_get_tool_dto.py index ae416c0..957879c 100644 --- a/src/vapi/types/create_go_high_level_contact_get_tool_dto.py +++ b/src/vapi/types/create_go_high_level_contact_get_tool_dto.py @@ -1,12 +1,16 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .create_go_high_level_contact_get_tool_dto_messages_item import CreateGoHighLevelContactGetToolDtoMessagesItem -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan class CreateGoHighLevelContactGetToolDto(UncheckedBaseModel): @@ -20,13 +24,88 @@ class CreateGoHighLevelContactGetToolDto(UncheckedBaseModel): """ type: typing.Literal["gohighlevel.contact.get"] = "gohighlevel.contact.get" - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -37,3 +116,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(CreateGoHighLevelContactGetToolDto) diff --git a/src/vapi/types/create_google_calendar_check_availability_tool_dto.py b/src/vapi/types/create_google_calendar_check_availability_tool_dto.py index 9558555..8ac1182 100644 --- a/src/vapi/types/create_google_calendar_check_availability_tool_dto.py +++ b/src/vapi/types/create_google_calendar_check_availability_tool_dto.py @@ -1,14 +1,18 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .create_google_calendar_check_availability_tool_dto_messages_item import ( CreateGoogleCalendarCheckAvailabilityToolDtoMessagesItem, ) -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan class CreateGoogleCalendarCheckAvailabilityToolDto(UncheckedBaseModel): @@ -22,13 +26,88 @@ class CreateGoogleCalendarCheckAvailabilityToolDto(UncheckedBaseModel): """ type: typing.Literal["google.calendar.availability.check"] = "google.calendar.availability.check" - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -39,3 +118,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(CreateGoogleCalendarCheckAvailabilityToolDto) diff --git a/src/vapi/types/create_google_calendar_create_event_tool_dto.py b/src/vapi/types/create_google_calendar_create_event_tool_dto.py index 8efbbaa..f5d1dfb 100644 --- a/src/vapi/types/create_google_calendar_create_event_tool_dto.py +++ b/src/vapi/types/create_google_calendar_create_event_tool_dto.py @@ -1,14 +1,18 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .create_google_calendar_create_event_tool_dto_messages_item import ( CreateGoogleCalendarCreateEventToolDtoMessagesItem, ) -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan class CreateGoogleCalendarCreateEventToolDto(UncheckedBaseModel): @@ -22,13 +26,88 @@ class CreateGoogleCalendarCreateEventToolDto(UncheckedBaseModel): """ type: typing.Literal["google.calendar.event.create"] = "google.calendar.event.create" - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -39,3 +118,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(CreateGoogleCalendarCreateEventToolDto) diff --git a/src/vapi/types/create_google_sheets_row_append_tool_dto.py b/src/vapi/types/create_google_sheets_row_append_tool_dto.py index 5888a6d..1c64bce 100644 --- a/src/vapi/types/create_google_sheets_row_append_tool_dto.py +++ b/src/vapi/types/create_google_sheets_row_append_tool_dto.py @@ -1,12 +1,16 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .create_google_sheets_row_append_tool_dto_messages_item import CreateGoogleSheetsRowAppendToolDtoMessagesItem -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan class CreateGoogleSheetsRowAppendToolDto(UncheckedBaseModel): @@ -20,13 +24,88 @@ class CreateGoogleSheetsRowAppendToolDto(UncheckedBaseModel): """ type: typing.Literal["google.sheets.row.append"] = "google.sheets.row.append" - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -37,3 +116,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(CreateGoogleSheetsRowAppendToolDto) diff --git a/src/vapi/types/create_handoff_tool_dto.py b/src/vapi/types/create_handoff_tool_dto.py new file mode 100644 index 0000000..34a38ab --- /dev/null +++ b/src/vapi/types/create_handoff_tool_dto.py @@ -0,0 +1,314 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel +from .create_handoff_tool_dto_messages_item import CreateHandoffToolDtoMessagesItem +from .tool_rejection_plan import ToolRejectionPlan + + +class CreateHandoffToolDto(UncheckedBaseModel): + messages: typing.Optional[typing.List[CreateHandoffToolDtoMessagesItem]] = pydantic.Field(default=None) + """ + These are the messages that will be spoken to the user as the tool is running. + + For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + """ + + type: typing.Literal["handoff"] = "handoff" + destinations: typing.Optional[typing.List["CreateHandoffToolDtoDestinationsItem"]] = pydantic.Field(default=None) + """ + These are the destinations that the call can be handed off to. + + Usage: + 1. Single destination + + Use `assistantId` to handoff the call to a saved assistant, or `assistantName` to handoff the call to an assistant in the same squad. + + ```json + { + "tools": [ + { + "type": "handoff", + "destinations": [ + { + "type": "assistant", + "assistantId": "assistant-123", // or "assistantName": "Assistant123" + "description": "customer wants to be handed off to assistant-123", + "contextEngineeringPlan": { + "type": "all" + } + } + ], + } + ] + } + ``` + + 2. Multiple destinations + + 2.1. Multiple Tools, Each With One Destination (OpenAI recommended) + + ```json + { + "tools": [ + { + "type": "handoff", + "destinations": [ + { + "type": "assistant", + "assistantId": "assistant-123", + "description": "customer wants to be handed off to assistant-123", + "contextEngineeringPlan": { + "type": "all" + } + }, + ], + }, + { + "type": "handoff", + "destinations": [ + { + "type": "assistant", + "assistantId": "assistant-456", + "description": "customer wants to be handed off to assistant-456", + "contextEngineeringPlan": { + "type": "all" + } + } + ], + } + ] + } + ``` + + 2.2. One Tool, Multiple Destinations (Anthropic recommended) + + ```json + { + "tools": [ + { + "type": "handoff", + "destinations": [ + { + "type": "assistant", + "assistantId": "assistant-123", + "description": "customer wants to be handed off to assistant-123", + "contextEngineeringPlan": { + "type": "all" + } + }, + { + "type": "assistant", + "assistantId": "assistant-456", + "description": "customer wants to be handed off to assistant-456", + "contextEngineeringPlan": { + "type": "all" + } + } + ], + } + ] + } + ``` + + 3. Dynamic destination + + 3.1 To determine the destination dynamically, supply a `dynamic` handoff destination type and a `server` object. + VAPI will send a handoff-destination-request webhook to the `server.url`. + The response from the server will be used as the destination (if valid). + + ```json + { + "tools": [ + { + "type": "handoff", + "destinations": [ + { + "type": "dynamic", + "server": { + "url": "https://example.com" + } + } + ], + } + ] + } + ``` + + 3.2. To pass custom parameters to the server, you can use the `function` object. + + ```json + { + "tools": [ + { + "type": "handoff", + "destinations": [ + { + "type": "dynamic", + "server": { + "url": "https://example.com" + }, + } + ], + "function": { + "name": "handoff", + "description": "Call this function when the customer is ready to be handed off to the next assistant", + "parameters": { + "type": "object", + "properties": { + "destination": { + "type": "string", + "description": "Use dynamic when customer is ready to be handed off to the next assistant", + "enum": ["dynamic"] + }, + "customerAreaCode": { + "type": "number", + "description": "Area code of the customer" + }, + "customerIntent": { + "type": "string", + "enum": ["new-customer", "existing-customer"], + "description": "Use new-customer when customer is a new customer, existing-customer when customer is an existing customer" + }, + "customerSentiment": { + "type": "string", + "enum": ["positive", "negative", "neutral"], + "description": "Use positive when customer is happy, negative when customer is unhappy, neutral when customer is neutral" + } + } + } + } + } + ] + } + ``` + + The properties `customerAreaCode`, `customerIntent`, and `customerSentiment` will be passed to the server in the webhook request body. + """ + + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) + """ + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` + + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` + + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 +from .create_handoff_tool_dto_destinations_item import CreateHandoffToolDtoDestinationsItem # noqa: E402, F401, I001 + +update_forward_refs(CreateHandoffToolDto) diff --git a/src/vapi/types/create_handoff_tool_dto_destinations_item.py b/src/vapi/types/create_handoff_tool_dto_destinations_item.py new file mode 100644 index 0000000..dd69b25 --- /dev/null +++ b/src/vapi/types/create_handoff_tool_dto_destinations_item.py @@ -0,0 +1,11 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +from .handoff_destination_dynamic import HandoffDestinationDynamic + +if typing.TYPE_CHECKING: + from .handoff_destination_assistant import HandoffDestinationAssistant +CreateHandoffToolDtoDestinationsItem = typing.Union["HandoffDestinationAssistant", HandoffDestinationDynamic] diff --git a/src/vapi/types/function_call_assistant_hook_action_messages_item.py b/src/vapi/types/create_handoff_tool_dto_messages_item.py similarity index 86% rename from src/vapi/types/function_call_assistant_hook_action_messages_item.py rename to src/vapi/types/create_handoff_tool_dto_messages_item.py index 5ce3527..aa35b54 100644 --- a/src/vapi/types/function_call_assistant_hook_action_messages_item.py +++ b/src/vapi/types/create_handoff_tool_dto_messages_item.py @@ -7,6 +7,6 @@ from .tool_message_failed import ToolMessageFailed from .tool_message_start import ToolMessageStart -FunctionCallAssistantHookActionMessagesItem = typing.Union[ +CreateHandoffToolDtoMessagesItem = typing.Union[ ToolMessageStart, ToolMessageComplete, ToolMessageFailed, ToolMessageDelayed ] diff --git a/src/vapi/types/org_plan.py b/src/vapi/types/create_inworld_credential_dto.py similarity index 53% rename from src/vapi/types/org_plan.py rename to src/vapi/types/create_inworld_credential_dto.py index 70e0168..2e2eb1b 100644 --- a/src/vapi/types/org_plan.py +++ b/src/vapi/types/create_inworld_credential_dto.py @@ -9,15 +9,17 @@ from ..core.unchecked_base_model import UncheckedBaseModel -class OrgPlan(UncheckedBaseModel): - included_providers: typing_extensions.Annotated[ - typing.Optional[typing.List[typing.Dict[str, typing.Optional[typing.Any]]]], - FieldMetadata(alias="includedProviders"), - ] = None - included_minutes: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="includedMinutes")] = None - cost_per_overage_minute: typing_extensions.Annotated[ - typing.Optional[float], FieldMetadata(alias="costPerOverageMinute") - ] = None +class CreateInworldCredentialDto(UncheckedBaseModel): + provider: typing.Literal["inworld"] = "inworld" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is the Inworld Basic (Base64) authentication token. This is not returned in the API. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of credential. This is just for your reference. + """ if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/vapi/types/create_make_tool_dto.py b/src/vapi/types/create_make_tool_dto.py index 92a9ddd..823e963 100644 --- a/src/vapi/types/create_make_tool_dto.py +++ b/src/vapi/types/create_make_tool_dto.py @@ -1,13 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .create_make_tool_dto_messages_item import CreateMakeToolDtoMessagesItem from .make_tool_metadata import MakeToolMetadata -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan class CreateMakeToolDto(UncheckedBaseModel): @@ -18,15 +22,94 @@ class CreateMakeToolDto(UncheckedBaseModel): For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. """ - type: typing.Literal["make"] = "make" + type: typing.Literal["make"] = pydantic.Field(default="make") + """ + The type of tool. "make" for Make tool. + """ + metadata: MakeToolMetadata - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` + + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -37,3 +120,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(CreateMakeToolDto) diff --git a/src/vapi/types/create_mcp_tool_dto.py b/src/vapi/types/create_mcp_tool_dto.py index 1e33239..4fcc5e0 100644 --- a/src/vapi/types/create_mcp_tool_dto.py +++ b/src/vapi/types/create_mcp_tool_dto.py @@ -1,14 +1,18 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .create_mcp_tool_dto_messages_item import CreateMcpToolDtoMessagesItem from .mcp_tool_metadata import McpToolMetadata -from .open_ai_function import OpenAiFunction from .server import Server +from .tool_rejection_plan import ToolRejectionPlan class CreateMcpToolDto(UncheckedBaseModel): @@ -34,13 +38,88 @@ class CreateMcpToolDto(UncheckedBaseModel): """ metadata: typing.Optional[McpToolMetadata] = None - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -51,3 +130,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(CreateMcpToolDto) diff --git a/src/vapi/types/create_minimax_credential_dto.py b/src/vapi/types/create_minimax_credential_dto.py new file mode 100644 index 0000000..34b09d9 --- /dev/null +++ b/src/vapi/types/create_minimax_credential_dto.py @@ -0,0 +1,36 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel + + +class CreateMinimaxCredentialDto(UncheckedBaseModel): + provider: typing.Literal["minimax"] = "minimax" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is not returned in the API. + """ + + group_id: typing_extensions.Annotated[str, FieldMetadata(alias="groupId")] = pydantic.Field() + """ + This is the Minimax Group ID. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of credential. This is just for your reference. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_outbound_call_dto.py b/src/vapi/types/create_outbound_call_dto.py index 94e1217..bb4d212 100644 --- a/src/vapi/types/create_outbound_call_dto.py +++ b/src/vapi/types/create_outbound_call_dto.py @@ -1,14 +1,15 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .assistant_overrides import AssistantOverrides -from .create_assistant_dto import CreateAssistantDto from .create_customer_dto import CreateCustomerDto from .create_squad_dto import CreateSquadDto from .create_workflow_dto import CreateWorkflowDto @@ -54,7 +55,7 @@ class CreateOutboundCallDto(UncheckedBaseModel): - Workflow, use `workflowId` or `workflow` """ - assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) """ This is the assistant that will be used for the call. To use an existing assistant, use `assistantId` instead. @@ -164,3 +165,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(CreateOutboundCallDto) diff --git a/src/vapi/types/create_output_tool_dto.py b/src/vapi/types/create_output_tool_dto.py index cead07b..8ce3b7b 100644 --- a/src/vapi/types/create_output_tool_dto.py +++ b/src/vapi/types/create_output_tool_dto.py @@ -1,12 +1,16 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .create_output_tool_dto_messages_item import CreateOutputToolDtoMessagesItem -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan class CreateOutputToolDto(UncheckedBaseModel): @@ -17,14 +21,93 @@ class CreateOutputToolDto(UncheckedBaseModel): For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. """ - type: typing.Literal["output"] = "output" - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + type: typing.Literal["output"] = pydantic.Field(default="output") + """ + The type of tool. "output" for Output tool. """ - This is the function definition of the tool. + + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) + """ + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` + + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -35,3 +118,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(CreateOutputToolDto) diff --git a/src/vapi/types/create_query_tool_dto.py b/src/vapi/types/create_query_tool_dto.py index 4852dcd..ed2390f 100644 --- a/src/vapi/types/create_query_tool_dto.py +++ b/src/vapi/types/create_query_tool_dto.py @@ -1,15 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .create_query_tool_dto_messages_item import CreateQueryToolDtoMessagesItem from .knowledge_base import KnowledgeBase -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan class CreateQueryToolDto(UncheckedBaseModel): @@ -28,13 +30,88 @@ class CreateQueryToolDto(UncheckedBaseModel): The knowledge bases to query """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -45,3 +122,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(CreateQueryToolDto) diff --git a/src/vapi/types/create_slack_send_message_tool_dto.py b/src/vapi/types/create_slack_send_message_tool_dto.py index d7ccd92..85b883e 100644 --- a/src/vapi/types/create_slack_send_message_tool_dto.py +++ b/src/vapi/types/create_slack_send_message_tool_dto.py @@ -1,12 +1,16 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .create_slack_send_message_tool_dto_messages_item import CreateSlackSendMessageToolDtoMessagesItem -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan class CreateSlackSendMessageToolDto(UncheckedBaseModel): @@ -18,13 +22,88 @@ class CreateSlackSendMessageToolDto(UncheckedBaseModel): """ type: typing.Literal["slack.message.send"] = "slack.message.send" - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -35,3 +114,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(CreateSlackSendMessageToolDto) diff --git a/src/vapi/types/create_sms_tool_dto.py b/src/vapi/types/create_sms_tool_dto.py index ccf742e..0092e70 100644 --- a/src/vapi/types/create_sms_tool_dto.py +++ b/src/vapi/types/create_sms_tool_dto.py @@ -1,12 +1,16 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .create_sms_tool_dto_messages_item import CreateSmsToolDtoMessagesItem -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan class CreateSmsToolDto(UncheckedBaseModel): @@ -18,13 +22,88 @@ class CreateSmsToolDto(UncheckedBaseModel): """ type: typing.Literal["sms"] = "sms" - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -35,3 +114,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(CreateSmsToolDto) diff --git a/src/vapi/types/create_squad_dto.py b/src/vapi/types/create_squad_dto.py index 01fae84..1a545db 100644 --- a/src/vapi/types/create_squad_dto.py +++ b/src/vapi/types/create_squad_dto.py @@ -1,10 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .assistant_overrides import AssistantOverrides @@ -41,3 +43,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(CreateSquadDto) diff --git a/src/vapi/types/create_telnyx_phone_number_dto.py b/src/vapi/types/create_telnyx_phone_number_dto.py index f5af78f..c41c8db 100644 --- a/src/vapi/types/create_telnyx_phone_number_dto.py +++ b/src/vapi/types/create_telnyx_phone_number_dto.py @@ -8,7 +8,7 @@ from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .create_telnyx_phone_number_dto_fallback_destination import CreateTelnyxPhoneNumberDtoFallbackDestination -from .phone_number_hook_call_ringing import PhoneNumberHookCallRinging +from .create_telnyx_phone_number_dto_hooks_item import CreateTelnyxPhoneNumberDtoHooksItem from .server import Server @@ -25,7 +25,7 @@ class CreateTelnyxPhoneNumberDto(UncheckedBaseModel): If this is not set and above conditions are met, the inbound call is hung up with an error message. """ - hooks: typing.Optional[typing.List[PhoneNumberHookCallRinging]] = pydantic.Field(default=None) + hooks: typing.Optional[typing.List[CreateTelnyxPhoneNumberDtoHooksItem]] = pydantic.Field(default=None) """ This is the hooks that will be used for incoming calls to this phone number. """ diff --git a/src/vapi/types/create_telnyx_phone_number_dto_hooks_item.py b/src/vapi/types/create_telnyx_phone_number_dto_hooks_item.py new file mode 100644 index 0000000..5aa6610 --- /dev/null +++ b/src/vapi/types/create_telnyx_phone_number_dto_hooks_item.py @@ -0,0 +1,8 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .phone_number_hook_call_ending import PhoneNumberHookCallEnding +from .phone_number_hook_call_ringing import PhoneNumberHookCallRinging + +CreateTelnyxPhoneNumberDtoHooksItem = typing.Union[PhoneNumberHookCallRinging, PhoneNumberHookCallEnding] diff --git a/src/vapi/types/create_test_suite_dto.py b/src/vapi/types/create_test_suite_dto.py new file mode 100644 index 0000000..734341d --- /dev/null +++ b/src/vapi/types/create_test_suite_dto.py @@ -0,0 +1,79 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel +from .target_plan import TargetPlan +from .tester_plan import TesterPlan + + +class CreateTestSuiteDto(UncheckedBaseModel): + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of the test suite. + """ + + phone_number_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="phoneNumberId")] = ( + pydantic.Field(default=None) + ) + """ + This is the phone number ID associated with this test suite. + """ + + tester_plan: typing_extensions.Annotated[typing.Optional[TesterPlan], FieldMetadata(alias="testerPlan")] = ( + pydantic.Field(default=None) + ) + """ + Override the default tester plan by providing custom assistant configuration for the test agent. + + We recommend only using this if you are confident, as we have already set sensible defaults on the tester plan. + """ + + target_plan: typing_extensions.Annotated[typing.Optional[TargetPlan], FieldMetadata(alias="targetPlan")] = ( + pydantic.Field(default=None) + ) + """ + These are the configuration for the assistant / phone number that is being tested. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(CreateTestSuiteDto) diff --git a/src/vapi/types/create_test_suite_run_dto.py b/src/vapi/types/create_test_suite_run_dto.py new file mode 100644 index 0000000..3b2a83a --- /dev/null +++ b/src/vapi/types/create_test_suite_run_dto.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.unchecked_base_model import UncheckedBaseModel + + +class CreateTestSuiteRunDto(UncheckedBaseModel): + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of the test suite run. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/create_test_suite_test_chat_dto.py b/src/vapi/types/create_test_suite_test_chat_dto.py index 39d6f02..1c22e08 100644 --- a/src/vapi/types/create_test_suite_test_chat_dto.py +++ b/src/vapi/types/create_test_suite_test_chat_dto.py @@ -16,7 +16,11 @@ class CreateTestSuiteTestChatDto(UncheckedBaseModel): These are the scorers used to evaluate the test. """ - type: typing.Literal["chat"] = "chat" + type: typing.Literal["chat"] = pydantic.Field(default="chat") + """ + This is the type of the test, which must be chat. + """ + script: str = pydantic.Field() """ This is the script to be used for the chat test. diff --git a/src/vapi/types/create_test_suite_test_voice_dto.py b/src/vapi/types/create_test_suite_test_voice_dto.py index 4e398ff..5f56df4 100644 --- a/src/vapi/types/create_test_suite_test_voice_dto.py +++ b/src/vapi/types/create_test_suite_test_voice_dto.py @@ -16,7 +16,11 @@ class CreateTestSuiteTestVoiceDto(UncheckedBaseModel): These are the scorers used to evaluate the test. """ - type: typing.Literal["voice"] = "voice" + type: typing.Literal["voice"] = pydantic.Field(default="voice") + """ + This is the type of the test, which must be voice. + """ + script: str = pydantic.Field() """ This is the script to be used for the voice test. diff --git a/src/vapi/types/create_text_editor_tool_dto.py b/src/vapi/types/create_text_editor_tool_dto.py index a1148f5..1995691 100644 --- a/src/vapi/types/create_text_editor_tool_dto.py +++ b/src/vapi/types/create_text_editor_tool_dto.py @@ -1,15 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .create_text_editor_tool_dto_messages_item import CreateTextEditorToolDtoMessagesItem -from .open_ai_function import OpenAiFunction from .server import Server +from .tool_rejection_plan import ToolRejectionPlan class CreateTextEditorToolDto(UncheckedBaseModel): @@ -46,13 +48,88 @@ class CreateTextEditorToolDto(UncheckedBaseModel): The name of the tool, fixed to 'str_replace_editor' """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -63,3 +140,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(CreateTextEditorToolDto) diff --git a/src/vapi/types/create_tool_template_dto.py b/src/vapi/types/create_tool_template_dto.py index d9eadc8..eb3b5b7 100644 --- a/src/vapi/types/create_tool_template_dto.py +++ b/src/vapi/types/create_tool_template_dto.py @@ -1,10 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .create_tool_template_dto_details import CreateToolTemplateDtoDetails @@ -37,3 +39,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(CreateToolTemplateDto) diff --git a/src/vapi/types/create_tool_template_dto_details.py b/src/vapi/types/create_tool_template_dto_details.py index 720de41..d7f008a 100644 --- a/src/vapi/types/create_tool_template_dto_details.py +++ b/src/vapi/types/create_tool_template_dto_details.py @@ -15,6 +15,7 @@ from .create_google_calendar_check_availability_tool_dto import CreateGoogleCalendarCheckAvailabilityToolDto from .create_google_calendar_create_event_tool_dto import CreateGoogleCalendarCreateEventToolDto from .create_google_sheets_row_append_tool_dto import CreateGoogleSheetsRowAppendToolDto +from .create_handoff_tool_dto import CreateHandoffToolDto from .create_mcp_tool_dto import CreateMcpToolDto from .create_query_tool_dto import CreateQueryToolDto from .create_slack_send_message_tool_dto import CreateSlackSendMessageToolDto @@ -36,6 +37,7 @@ CreateGoogleCalendarCheckAvailabilityToolDto, CreateGoogleCalendarCreateEventToolDto, CreateGoogleSheetsRowAppendToolDto, + CreateHandoffToolDto, CreateMcpToolDto, CreateQueryToolDto, CreateSlackSendMessageToolDto, diff --git a/src/vapi/types/create_transfer_call_tool_dto.py b/src/vapi/types/create_transfer_call_tool_dto.py index ee96863..7676ce3 100644 --- a/src/vapi/types/create_transfer_call_tool_dto.py +++ b/src/vapi/types/create_transfer_call_tool_dto.py @@ -1,13 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .create_transfer_call_tool_dto_destinations_item import CreateTransferCallToolDtoDestinationsItem from .create_transfer_call_tool_dto_messages_item import CreateTransferCallToolDtoMessagesItem -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan class CreateTransferCallToolDto(UncheckedBaseModel): @@ -24,13 +28,88 @@ class CreateTransferCallToolDto(UncheckedBaseModel): These are the destinations that the call can be transferred to. If no destinations are provided, server.url will be used to get the transfer destination once the tool is called. """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -41,3 +120,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(CreateTransferCallToolDto) diff --git a/src/vapi/types/create_trieve_knowledge_base_dto.py b/src/vapi/types/create_trieve_knowledge_base_dto.py index 3639f25..f7741c9 100644 --- a/src/vapi/types/create_trieve_knowledge_base_dto.py +++ b/src/vapi/types/create_trieve_knowledge_base_dto.py @@ -12,7 +12,13 @@ class CreateTrieveKnowledgeBaseDto(UncheckedBaseModel): - provider: typing.Literal["trieve"] = "trieve" + provider: typing.Literal["trieve"] = pydantic.Field(default="trieve") + """ + This knowledge base is provided by Trieve. + + To learn more about Trieve, visit https://trieve.ai. + """ + name: typing.Optional[str] = pydantic.Field(default=None) """ This is the name of the knowledge base. diff --git a/src/vapi/types/create_twilio_phone_number_dto.py b/src/vapi/types/create_twilio_phone_number_dto.py index 83f6b09..2fb5240 100644 --- a/src/vapi/types/create_twilio_phone_number_dto.py +++ b/src/vapi/types/create_twilio_phone_number_dto.py @@ -8,7 +8,7 @@ from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .create_twilio_phone_number_dto_fallback_destination import CreateTwilioPhoneNumberDtoFallbackDestination -from .phone_number_hook_call_ringing import PhoneNumberHookCallRinging +from .create_twilio_phone_number_dto_hooks_item import CreateTwilioPhoneNumberDtoHooksItem from .server import Server @@ -25,7 +25,7 @@ class CreateTwilioPhoneNumberDto(UncheckedBaseModel): If this is not set and above conditions are met, the inbound call is hung up with an error message. """ - hooks: typing.Optional[typing.List[PhoneNumberHookCallRinging]] = pydantic.Field(default=None) + hooks: typing.Optional[typing.List[CreateTwilioPhoneNumberDtoHooksItem]] = pydantic.Field(default=None) """ This is the hooks that will be used for incoming calls to this phone number. """ diff --git a/src/vapi/types/create_twilio_phone_number_dto_hooks_item.py b/src/vapi/types/create_twilio_phone_number_dto_hooks_item.py new file mode 100644 index 0000000..b03d141 --- /dev/null +++ b/src/vapi/types/create_twilio_phone_number_dto_hooks_item.py @@ -0,0 +1,8 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .phone_number_hook_call_ending import PhoneNumberHookCallEnding +from .phone_number_hook_call_ringing import PhoneNumberHookCallRinging + +CreateTwilioPhoneNumberDtoHooksItem = typing.Union[PhoneNumberHookCallRinging, PhoneNumberHookCallEnding] diff --git a/src/vapi/types/create_vapi_phone_number_dto.py b/src/vapi/types/create_vapi_phone_number_dto.py index 9dc79d8..cfa8e6d 100644 --- a/src/vapi/types/create_vapi_phone_number_dto.py +++ b/src/vapi/types/create_vapi_phone_number_dto.py @@ -8,7 +8,7 @@ from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .create_vapi_phone_number_dto_fallback_destination import CreateVapiPhoneNumberDtoFallbackDestination -from .phone_number_hook_call_ringing import PhoneNumberHookCallRinging +from .create_vapi_phone_number_dto_hooks_item import CreateVapiPhoneNumberDtoHooksItem from .server import Server from .sip_authentication import SipAuthentication @@ -26,7 +26,7 @@ class CreateVapiPhoneNumberDto(UncheckedBaseModel): If this is not set and above conditions are met, the inbound call is hung up with an error message. """ - hooks: typing.Optional[typing.List[PhoneNumberHookCallRinging]] = pydantic.Field(default=None) + hooks: typing.Optional[typing.List[CreateVapiPhoneNumberDtoHooksItem]] = pydantic.Field(default=None) """ This is the hooks that will be used for incoming calls to this phone number. """ diff --git a/src/vapi/types/create_vapi_phone_number_dto_hooks_item.py b/src/vapi/types/create_vapi_phone_number_dto_hooks_item.py new file mode 100644 index 0000000..cb333ed --- /dev/null +++ b/src/vapi/types/create_vapi_phone_number_dto_hooks_item.py @@ -0,0 +1,8 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .phone_number_hook_call_ending import PhoneNumberHookCallEnding +from .phone_number_hook_call_ringing import PhoneNumberHookCallRinging + +CreateVapiPhoneNumberDtoHooksItem = typing.Union[PhoneNumberHookCallRinging, PhoneNumberHookCallEnding] diff --git a/src/vapi/types/create_voicemail_tool_dto.py b/src/vapi/types/create_voicemail_tool_dto.py index 70939f4..c3db7ce 100644 --- a/src/vapi/types/create_voicemail_tool_dto.py +++ b/src/vapi/types/create_voicemail_tool_dto.py @@ -1,12 +1,16 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .create_voicemail_tool_dto_messages_item import CreateVoicemailToolDtoMessagesItem -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan class CreateVoicemailToolDto(UncheckedBaseModel): @@ -19,16 +23,91 @@ class CreateVoicemailToolDto(UncheckedBaseModel): type: typing.Literal["voicemail"] = pydantic.Field(default="voicemail") """ - The type of tool. "voicemail". This uses the model itself to determine if a voicemil was reached. Can be used alternatively/alongside with TwilioVoicemailDetection + The type of tool. "voicemail" for Voicemail tool. """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -39,3 +118,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(CreateVoicemailToolDto) diff --git a/src/vapi/types/create_vonage_phone_number_dto.py b/src/vapi/types/create_vonage_phone_number_dto.py index 73f905f..ddff5db 100644 --- a/src/vapi/types/create_vonage_phone_number_dto.py +++ b/src/vapi/types/create_vonage_phone_number_dto.py @@ -8,7 +8,7 @@ from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .create_vonage_phone_number_dto_fallback_destination import CreateVonagePhoneNumberDtoFallbackDestination -from .phone_number_hook_call_ringing import PhoneNumberHookCallRinging +from .create_vonage_phone_number_dto_hooks_item import CreateVonagePhoneNumberDtoHooksItem from .server import Server @@ -25,7 +25,7 @@ class CreateVonagePhoneNumberDto(UncheckedBaseModel): If this is not set and above conditions are met, the inbound call is hung up with an error message. """ - hooks: typing.Optional[typing.List[PhoneNumberHookCallRinging]] = pydantic.Field(default=None) + hooks: typing.Optional[typing.List[CreateVonagePhoneNumberDtoHooksItem]] = pydantic.Field(default=None) """ This is the hooks that will be used for incoming calls to this phone number. """ diff --git a/src/vapi/types/create_vonage_phone_number_dto_hooks_item.py b/src/vapi/types/create_vonage_phone_number_dto_hooks_item.py new file mode 100644 index 0000000..965bd2b --- /dev/null +++ b/src/vapi/types/create_vonage_phone_number_dto_hooks_item.py @@ -0,0 +1,8 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .phone_number_hook_call_ending import PhoneNumberHookCallEnding +from .phone_number_hook_call_ringing import PhoneNumberHookCallRinging + +CreateVonagePhoneNumberDtoHooksItem = typing.Union[PhoneNumberHookCallRinging, PhoneNumberHookCallEnding] diff --git a/src/vapi/types/create_web_call_dto.py b/src/vapi/types/create_web_call_dto.py index 5334f7e..b0808e4 100644 --- a/src/vapi/types/create_web_call_dto.py +++ b/src/vapi/types/create_web_call_dto.py @@ -1,14 +1,15 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .assistant_overrides import AssistantOverrides -from .create_assistant_dto import CreateAssistantDto from .create_squad_dto import CreateSquadDto from .create_workflow_dto import CreateWorkflowDto from .workflow_overrides import WorkflowOverrides @@ -27,7 +28,7 @@ class CreateWebCallDto(UncheckedBaseModel): - Workflow, use `workflowId` or `workflow` """ - assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) """ This is the assistant that will be used for the call. To use an existing assistant, use `assistantId` instead. @@ -103,3 +104,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(CreateWebCallDto) diff --git a/src/vapi/types/create_webhook_credential_dto.py b/src/vapi/types/create_webhook_credential_dto.py index b3a3d20..4c9f42a 100644 --- a/src/vapi/types/create_webhook_credential_dto.py +++ b/src/vapi/types/create_webhook_credential_dto.py @@ -16,7 +16,7 @@ class CreateWebhookCredentialDto(UncheckedBaseModel): CreateWebhookCredentialDtoAuthenticationPlan, FieldMetadata(alias="authenticationPlan") ] = pydantic.Field() """ - This is the authentication plan. Supports OAuth2 RFC 6749 and HMAC signing. + This is the authentication plan. Supports OAuth2 RFC 6749, HMAC signing, and Bearer authentication. """ name: typing.Optional[str] = pydantic.Field(default=None) diff --git a/src/vapi/types/create_webhook_credential_dto_authentication_plan.py b/src/vapi/types/create_webhook_credential_dto_authentication_plan.py index 80772e1..2830cca 100644 --- a/src/vapi/types/create_webhook_credential_dto_authentication_plan.py +++ b/src/vapi/types/create_webhook_credential_dto_authentication_plan.py @@ -2,7 +2,10 @@ import typing +from .bearer_authentication_plan import BearerAuthenticationPlan from .hmac_authentication_plan import HmacAuthenticationPlan from .o_auth_2_authentication_plan import OAuth2AuthenticationPlan -CreateWebhookCredentialDtoAuthenticationPlan = typing.Union[OAuth2AuthenticationPlan, HmacAuthenticationPlan] +CreateWebhookCredentialDtoAuthenticationPlan = typing.Union[ + OAuth2AuthenticationPlan, HmacAuthenticationPlan, BearerAuthenticationPlan +] diff --git a/src/vapi/types/create_workflow_dto.py b/src/vapi/types/create_workflow_dto.py index 5a83d9e..367232d 100644 --- a/src/vapi/types/create_workflow_dto.py +++ b/src/vapi/types/create_workflow_dto.py @@ -1,10 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .analysis_plan import AnalysisPlan @@ -13,10 +15,13 @@ from .compliance_plan import CompliancePlan from .create_workflow_dto_background_sound import CreateWorkflowDtoBackgroundSound from .create_workflow_dto_credentials_item import CreateWorkflowDtoCredentialsItem +from .create_workflow_dto_hooks_item import CreateWorkflowDtoHooksItem +from .create_workflow_dto_model import CreateWorkflowDtoModel from .create_workflow_dto_nodes_item import CreateWorkflowDtoNodesItem from .create_workflow_dto_transcriber import CreateWorkflowDtoTranscriber from .create_workflow_dto_voice import CreateWorkflowDtoVoice from .edge import Edge +from .keypad_input_plan import KeypadInputPlan from .langfuse_observability_plan import LangfuseObservabilityPlan from .monitor_plan import MonitorPlan from .server import Server @@ -26,6 +31,13 @@ class CreateWorkflowDto(UncheckedBaseModel): nodes: typing.List[CreateWorkflowDtoNodesItem] + model: typing.Optional[CreateWorkflowDtoModel] = pydantic.Field(default=None) + """ + This is the model for the workflow. + + This can be overridden at node level using `nodes[n].model`. + """ + transcriber: typing.Optional[CreateWorkflowDtoTranscriber] = pydantic.Field(default=None) """ This is the transcriber for the workflow. @@ -57,6 +69,11 @@ class CreateWorkflowDto(UncheckedBaseModel): You can also provide a custom sound by providing a URL to an audio file. """ + hooks: typing.Optional[typing.List[CreateWorkflowDtoHooksItem]] = pydantic.Field(default=None) + """ + This is a set of actions that will be performed on certain events. + """ + credentials: typing.Optional[typing.List[CreateWorkflowDtoCredentialsItem]] = pydantic.Field(default=None) """ These are dynamic credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can supplement an additional credentials using this. Dynamic credentials override existing credentials. @@ -157,6 +174,13 @@ class CreateWorkflowDto(UncheckedBaseModel): These are the credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can provide a subset using this. """ + keypad_input_plan: typing_extensions.Annotated[ + typing.Optional[KeypadInputPlan], FieldMetadata(alias="keypadInputPlan") + ] = pydantic.Field(default=None) + """ + This is the plan for keypad input handling during workflow calls. + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: @@ -165,3 +189,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(CreateWorkflowDto) diff --git a/src/vapi/types/create_workflow_dto_credentials_item.py b/src/vapi/types/create_workflow_dto_credentials_item.py index 8ffea03..6f28935 100644 --- a/src/vapi/types/create_workflow_dto_credentials_item.py +++ b/src/vapi/types/create_workflow_dto_credentials_item.py @@ -11,6 +11,7 @@ from .create_cartesia_credential_dto import CreateCartesiaCredentialDto from .create_cerebras_credential_dto import CreateCerebrasCredentialDto from .create_cloudflare_credential_dto import CreateCloudflareCredentialDto +from .create_custom_credential_dto import CreateCustomCredentialDto from .create_custom_llm_credential_dto import CreateCustomLlmCredentialDto from .create_deep_infra_credential_dto import CreateDeepInfraCredentialDto from .create_deep_seek_credential_dto import CreateDeepSeekCredentialDto @@ -31,9 +32,11 @@ from .create_groq_credential_dto import CreateGroqCredentialDto from .create_hume_credential_dto import CreateHumeCredentialDto from .create_inflection_ai_credential_dto import CreateInflectionAiCredentialDto +from .create_inworld_credential_dto import CreateInworldCredentialDto from .create_langfuse_credential_dto import CreateLangfuseCredentialDto from .create_lmnt_credential_dto import CreateLmntCredentialDto from .create_make_credential_dto import CreateMakeCredentialDto +from .create_minimax_credential_dto import CreateMinimaxCredentialDto from .create_mistral_credential_dto import CreateMistralCredentialDto from .create_neuphonic_credential_dto import CreateNeuphonicCredentialDto from .create_open_ai_credential_dto import CreateOpenAiCredentialDto @@ -93,6 +96,7 @@ CreateTwilioCredentialDto, CreateVonageCredentialDto, CreateWebhookCredentialDto, + CreateCustomCredentialDto, CreateXAiCredentialDto, CreateNeuphonicCredentialDto, CreateHumeCredentialDto, @@ -104,5 +108,6 @@ CreateGoogleSheetsOAuth2AuthorizationCredentialDto, CreateSlackOAuth2AuthorizationCredentialDto, CreateGoHighLevelMcpCredentialDto, - typing.Optional[typing.Any], + CreateInworldCredentialDto, + CreateMinimaxCredentialDto, ] diff --git a/src/vapi/types/create_workflow_dto_hooks_item.py b/src/vapi/types/create_workflow_dto_hooks_item.py new file mode 100644 index 0000000..d20ba10 --- /dev/null +++ b/src/vapi/types/create_workflow_dto_hooks_item.py @@ -0,0 +1,15 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted +from .call_hook_call_ending import CallHookCallEnding +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout + +CreateWorkflowDtoHooksItem = typing.Union[ + CallHookCallEnding, + CallHookAssistantSpeechInterrupted, + CallHookCustomerSpeechInterrupted, + CallHookCustomerSpeechTimeout, +] diff --git a/src/vapi/types/create_workflow_dto_model.py b/src/vapi/types/create_workflow_dto_model.py new file mode 100644 index 0000000..40793fa --- /dev/null +++ b/src/vapi/types/create_workflow_dto_model.py @@ -0,0 +1,12 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .workflow_anthropic_model import WorkflowAnthropicModel +from .workflow_custom_model import WorkflowCustomModel +from .workflow_google_model import WorkflowGoogleModel +from .workflow_open_ai_model import WorkflowOpenAiModel + +CreateWorkflowDtoModel = typing.Union[ + WorkflowOpenAiModel, WorkflowAnthropicModel, WorkflowGoogleModel, WorkflowCustomModel +] diff --git a/src/vapi/types/create_workflow_dto_voice.py b/src/vapi/types/create_workflow_dto_voice.py index b3bb127..3358433 100644 --- a/src/vapi/types/create_workflow_dto_voice.py +++ b/src/vapi/types/create_workflow_dto_voice.py @@ -10,6 +10,7 @@ from .hume_voice import HumeVoice from .inworld_voice import InworldVoice from .lmnt_voice import LmntVoice +from .minimax_voice import MinimaxVoice from .neuphonic_voice import NeuphonicVoice from .open_ai_voice import OpenAiVoice from .play_ht_voice import PlayHtVoice @@ -36,4 +37,5 @@ VapiVoice, SesameVoice, InworldVoice, + MinimaxVoice, ] diff --git a/src/vapi/types/custom_credential.py b/src/vapi/types/custom_credential.py new file mode 100644 index 0000000..43a659a --- /dev/null +++ b/src/vapi/types/custom_credential.py @@ -0,0 +1,63 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel +from .custom_credential_authentication_plan import CustomCredentialAuthenticationPlan +from .oauth_2_authentication_session import Oauth2AuthenticationSession + + +class CustomCredential(UncheckedBaseModel): + provider: typing.Literal["custom-credential"] = "custom-credential" + authentication_plan: typing_extensions.Annotated[ + CustomCredentialAuthenticationPlan, FieldMetadata(alias="authenticationPlan") + ] = pydantic.Field() + """ + This is the authentication plan. Supports OAuth2 RFC 6749, HMAC signing, and Bearer authentication. + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the credential. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the org that this credential belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the credential was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the assistant was last updated. + """ + + authentication_session: typing_extensions.Annotated[ + Oauth2AuthenticationSession, FieldMetadata(alias="authenticationSession") + ] = pydantic.Field() + """ + This is the authentication session for the credential. Available for credentials that have an authentication plan. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of credential. This is just for your reference. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/custom_credential_authentication_plan.py b/src/vapi/types/custom_credential_authentication_plan.py new file mode 100644 index 0000000..aed3741 --- /dev/null +++ b/src/vapi/types/custom_credential_authentication_plan.py @@ -0,0 +1,11 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .bearer_authentication_plan import BearerAuthenticationPlan +from .hmac_authentication_plan import HmacAuthenticationPlan +from .o_auth_2_authentication_plan import OAuth2AuthenticationPlan + +CustomCredentialAuthenticationPlan = typing.Union[ + OAuth2AuthenticationPlan, HmacAuthenticationPlan, BearerAuthenticationPlan +] diff --git a/src/vapi/types/custom_knowledge_base.py b/src/vapi/types/custom_knowledge_base.py index f96b6e6..2da206c 100644 --- a/src/vapi/types/custom_knowledge_base.py +++ b/src/vapi/types/custom_knowledge_base.py @@ -11,7 +11,11 @@ class CustomKnowledgeBase(UncheckedBaseModel): - provider: typing.Literal["custom-knowledge-base"] = "custom-knowledge-base" + provider: typing.Literal["custom-knowledge-base"] = pydantic.Field(default="custom-knowledge-base") + """ + This knowledge base is bring your own knowledge base implementation. + """ + server: Server = pydantic.Field() """ This is where the knowledge base request will be sent. diff --git a/src/vapi/types/custom_llm_model.py b/src/vapi/types/custom_llm_model.py index c7965c2..cd1042d 100644 --- a/src/vapi/types/custom_llm_model.py +++ b/src/vapi/types/custom_llm_model.py @@ -1,15 +1,16 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .create_custom_knowledge_base_dto import CreateCustomKnowledgeBaseDto from .custom_llm_model_metadata_send_mode import CustomLlmModelMetadataSendMode -from .custom_llm_model_tools_item import CustomLlmModelToolsItem from .open_ai_message import OpenAiMessage @@ -19,7 +20,7 @@ class CustomLlmModel(UncheckedBaseModel): This is the starting state for the conversation. """ - tools: typing.Optional[typing.List[CustomLlmModelToolsItem]] = pydantic.Field(default=None) + tools: typing.Optional[typing.List["CustomLlmModelToolsItem"]] = pydantic.Field(default=None) """ These are the tools that the assistant can use during the call. To use existing tools, use `toolIds`. @@ -42,13 +43,6 @@ class CustomLlmModel(UncheckedBaseModel): These are the options for the knowledge base. """ - knowledge_base_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="knowledgeBaseId")] = ( - pydantic.Field(default=None) - ) - """ - This is the ID of the knowledge base the model will use. - """ - provider: typing.Literal["custom-llm"] = pydantic.Field(default="custom-llm") """ This is the provider that will be used for the model. Any service, including your own server, that is compatible with the OpenAI API can be used. @@ -69,6 +63,11 @@ class CustomLlmModel(UncheckedBaseModel): Default is `variable`. """ + headers: typing.Optional[typing.Dict[str, str]] = pydantic.Field(default=None) + """ + Custom headers to send with requests. These headers can override default OpenAI headers except for Authorization (which should be specified using a custom-llm credential). + """ + url: str = pydantic.Field() """ These is the URL we'll use for the OpenAI client's `baseURL`. Ex. https://openrouter.ai/api/v1 @@ -128,3 +127,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 +from .custom_llm_model_tools_item import CustomLlmModelToolsItem # noqa: E402, F401, I001 + +update_forward_refs(CustomLlmModel) diff --git a/src/vapi/types/custom_llm_model_tools_item.py b/src/vapi/types/custom_llm_model_tools_item.py index 72d5107..d67898c 100644 --- a/src/vapi/types/custom_llm_model_tools_item.py +++ b/src/vapi/types/custom_llm_model_tools_item.py @@ -1,5 +1,7 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing from .create_api_request_tool_dto import CreateApiRequestToolDto @@ -22,6 +24,8 @@ from .create_text_editor_tool_dto import CreateTextEditorToolDto from .create_transfer_call_tool_dto import CreateTransferCallToolDto +if typing.TYPE_CHECKING: + from .create_handoff_tool_dto import CreateHandoffToolDto CustomLlmModelToolsItem = typing.Union[ CreateApiRequestToolDto, CreateBashToolDto, @@ -36,6 +40,7 @@ CreateGoogleCalendarCheckAvailabilityToolDto, CreateGoogleCalendarCreateEventToolDto, CreateGoogleSheetsRowAppendToolDto, + "CreateHandoffToolDto", CreateMcpToolDto, CreateQueryToolDto, CreateSlackSendMessageToolDto, diff --git a/src/vapi/types/customer_speech_timeout_options.py b/src/vapi/types/customer_speech_timeout_options.py new file mode 100644 index 0000000..ce5c27c --- /dev/null +++ b/src/vapi/types/customer_speech_timeout_options.py @@ -0,0 +1,46 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel + + +class CustomerSpeechTimeoutOptions(UncheckedBaseModel): + timeout_seconds: typing_extensions.Annotated[float, FieldMetadata(alias="timeoutSeconds")] = pydantic.Field() + """ + This is the timeout in seconds before action is triggered. + The clock starts when the assistant finishes speaking and remains active until the user speaks. + + @default 7.5 + """ + + trigger_max_count: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="triggerMaxCount")] = ( + pydantic.Field(default=None) + ) + """ + This is the maximum number of times the hook will trigger in a call. + + @default 3 + """ + + trigger_reset_mode: typing_extensions.Annotated[ + typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]], FieldMetadata(alias="triggerResetMode") + ] = pydantic.Field(default=None) + """ + This is whether the counter for hook trigger resets the user speaks. + + @default never + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/deep_infra_model.py b/src/vapi/types/deep_infra_model.py index 205dc64..b4405e8 100644 --- a/src/vapi/types/deep_infra_model.py +++ b/src/vapi/types/deep_infra_model.py @@ -1,14 +1,15 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .create_custom_knowledge_base_dto import CreateCustomKnowledgeBaseDto -from .deep_infra_model_tools_item import DeepInfraModelToolsItem from .open_ai_message import OpenAiMessage @@ -18,7 +19,7 @@ class DeepInfraModel(UncheckedBaseModel): This is the starting state for the conversation. """ - tools: typing.Optional[typing.List[DeepInfraModelToolsItem]] = pydantic.Field(default=None) + tools: typing.Optional[typing.List["DeepInfraModelToolsItem"]] = pydantic.Field(default=None) """ These are the tools that the assistant can use during the call. To use existing tools, use `toolIds`. @@ -41,13 +42,6 @@ class DeepInfraModel(UncheckedBaseModel): These are the options for the knowledge base. """ - knowledge_base_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="knowledgeBaseId")] = ( - pydantic.Field(default=None) - ) - """ - This is the ID of the knowledge base the model will use. - """ - provider: typing.Literal["deepinfra"] = "deepinfra" model: str = pydantic.Field() """ @@ -96,3 +90,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 +from .deep_infra_model_tools_item import DeepInfraModelToolsItem # noqa: E402, F401, I001 + +update_forward_refs(DeepInfraModel) diff --git a/src/vapi/types/deep_infra_model_tools_item.py b/src/vapi/types/deep_infra_model_tools_item.py index a06711e..f1abd8d 100644 --- a/src/vapi/types/deep_infra_model_tools_item.py +++ b/src/vapi/types/deep_infra_model_tools_item.py @@ -1,5 +1,7 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing from .create_api_request_tool_dto import CreateApiRequestToolDto @@ -22,6 +24,8 @@ from .create_text_editor_tool_dto import CreateTextEditorToolDto from .create_transfer_call_tool_dto import CreateTransferCallToolDto +if typing.TYPE_CHECKING: + from .create_handoff_tool_dto import CreateHandoffToolDto DeepInfraModelToolsItem = typing.Union[ CreateApiRequestToolDto, CreateBashToolDto, @@ -36,6 +40,7 @@ CreateGoogleCalendarCheckAvailabilityToolDto, CreateGoogleCalendarCreateEventToolDto, CreateGoogleSheetsRowAppendToolDto, + "CreateHandoffToolDto", CreateMcpToolDto, CreateQueryToolDto, CreateSlackSendMessageToolDto, diff --git a/src/vapi/types/deep_seek_model.py b/src/vapi/types/deep_seek_model.py index a5f6c1b..c0f83c0 100644 --- a/src/vapi/types/deep_seek_model.py +++ b/src/vapi/types/deep_seek_model.py @@ -1,15 +1,16 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .create_custom_knowledge_base_dto import CreateCustomKnowledgeBaseDto from .deep_seek_model_model import DeepSeekModelModel -from .deep_seek_model_tools_item import DeepSeekModelToolsItem from .open_ai_message import OpenAiMessage @@ -19,7 +20,7 @@ class DeepSeekModel(UncheckedBaseModel): This is the starting state for the conversation. """ - tools: typing.Optional[typing.List[DeepSeekModelToolsItem]] = pydantic.Field(default=None) + tools: typing.Optional[typing.List["DeepSeekModelToolsItem"]] = pydantic.Field(default=None) """ These are the tools that the assistant can use during the call. To use existing tools, use `toolIds`. @@ -42,13 +43,6 @@ class DeepSeekModel(UncheckedBaseModel): These are the options for the knowledge base. """ - knowledge_base_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="knowledgeBaseId")] = ( - pydantic.Field(default=None) - ) - """ - This is the ID of the knowledge base the model will use. - """ - model: DeepSeekModelModel = pydantic.Field() """ This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b @@ -97,3 +91,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 +from .deep_seek_model_tools_item import DeepSeekModelToolsItem # noqa: E402, F401, I001 + +update_forward_refs(DeepSeekModel) diff --git a/src/vapi/types/deep_seek_model_tools_item.py b/src/vapi/types/deep_seek_model_tools_item.py index adb64ea..3302e1d 100644 --- a/src/vapi/types/deep_seek_model_tools_item.py +++ b/src/vapi/types/deep_seek_model_tools_item.py @@ -1,5 +1,7 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing from .create_api_request_tool_dto import CreateApiRequestToolDto @@ -22,6 +24,8 @@ from .create_text_editor_tool_dto import CreateTextEditorToolDto from .create_transfer_call_tool_dto import CreateTransferCallToolDto +if typing.TYPE_CHECKING: + from .create_handoff_tool_dto import CreateHandoffToolDto DeepSeekModelToolsItem = typing.Union[ CreateApiRequestToolDto, CreateBashToolDto, @@ -36,6 +40,7 @@ CreateGoogleCalendarCheckAvailabilityToolDto, CreateGoogleCalendarCreateEventToolDto, CreateGoogleSheetsRowAppendToolDto, + "CreateHandoffToolDto", CreateMcpToolDto, CreateQueryToolDto, CreateSlackSendMessageToolDto, diff --git a/src/vapi/types/developer_message.py b/src/vapi/types/developer_message.py index 282e6c9..84084b7 100644 --- a/src/vapi/types/developer_message.py +++ b/src/vapi/types/developer_message.py @@ -23,6 +23,11 @@ class DeveloperMessage(UncheckedBaseModel): This is an optional name for the participant """ + metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None) + """ + This is an optional metadata for the message + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/vapi/types/dtmf_tool.py b/src/vapi/types/dtmf_tool.py index c4ba454..6c14379 100644 --- a/src/vapi/types/dtmf_tool.py +++ b/src/vapi/types/dtmf_tool.py @@ -1,15 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import datetime as dt import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .dtmf_tool_messages_item import DtmfToolMessagesItem -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan class DtmfTool(UncheckedBaseModel): @@ -41,13 +43,88 @@ class DtmfTool(UncheckedBaseModel): This is the ISO 8601 date-time string of when the tool was last updated. """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -58,3 +135,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(DtmfTool) diff --git a/src/vapi/types/eleven_labs_pronunciation_dictionary.py b/src/vapi/types/eleven_labs_pronunciation_dictionary.py new file mode 100644 index 0000000..f82020a --- /dev/null +++ b/src/vapi/types/eleven_labs_pronunciation_dictionary.py @@ -0,0 +1,68 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel +from .eleven_labs_pronunciation_dictionary_permission_on_resource import ( + ElevenLabsPronunciationDictionaryPermissionOnResource, +) + + +class ElevenLabsPronunciationDictionary(UncheckedBaseModel): + pronunciation_dictionary_id: typing_extensions.Annotated[str, FieldMetadata(alias="pronunciationDictionaryId")] = ( + pydantic.Field() + ) + """ + The ID of the pronunciation dictionary + """ + + dictionary_name: typing_extensions.Annotated[str, FieldMetadata(alias="dictionaryName")] = pydantic.Field() + """ + The name of the pronunciation dictionary + """ + + created_by: typing_extensions.Annotated[str, FieldMetadata(alias="createdBy")] = pydantic.Field() + """ + The user ID of the creator + """ + + creation_time_unix: typing_extensions.Annotated[float, FieldMetadata(alias="creationTimeUnix")] = pydantic.Field() + """ + The creation time in Unix timestamp + """ + + version_id: typing_extensions.Annotated[str, FieldMetadata(alias="versionId")] = pydantic.Field() + """ + The version ID of the pronunciation dictionary + """ + + version_rules_num: typing_extensions.Annotated[float, FieldMetadata(alias="versionRulesNum")] = pydantic.Field() + """ + The number of rules in this version + """ + + permission_on_resource: typing_extensions.Annotated[ + typing.Optional[ElevenLabsPronunciationDictionaryPermissionOnResource], + FieldMetadata(alias="permissionOnResource"), + ] = pydantic.Field(default=None) + """ + The permission level on this resource + """ + + description: typing.Optional[str] = pydantic.Field(default=None) + """ + The description of the pronunciation dictionary + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/eleven_labs_pronunciation_dictionary_locator.py b/src/vapi/types/eleven_labs_pronunciation_dictionary_locator.py new file mode 100644 index 0000000..1d9544c --- /dev/null +++ b/src/vapi/types/eleven_labs_pronunciation_dictionary_locator.py @@ -0,0 +1,32 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel + + +class ElevenLabsPronunciationDictionaryLocator(UncheckedBaseModel): + pronunciation_dictionary_id: typing_extensions.Annotated[str, FieldMetadata(alias="pronunciationDictionaryId")] = ( + pydantic.Field() + ) + """ + This is the ID of the pronunciation dictionary to use. + """ + + version_id: typing_extensions.Annotated[str, FieldMetadata(alias="versionId")] = pydantic.Field() + """ + This is the version ID of the pronunciation dictionary to use. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/eleven_labs_pronunciation_dictionary_permission_on_resource.py b/src/vapi/types/eleven_labs_pronunciation_dictionary_permission_on_resource.py new file mode 100644 index 0000000..33e7685 --- /dev/null +++ b/src/vapi/types/eleven_labs_pronunciation_dictionary_permission_on_resource.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +ElevenLabsPronunciationDictionaryPermissionOnResource = typing.Union[ + typing.Literal["admin", "editor", "viewer"], typing.Any +] diff --git a/src/vapi/types/eleven_labs_voice.py b/src/vapi/types/eleven_labs_voice.py index 44685a7..fc643d8 100644 --- a/src/vapi/types/eleven_labs_voice.py +++ b/src/vapi/types/eleven_labs_voice.py @@ -8,6 +8,7 @@ from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .chunk_plan import ChunkPlan +from .eleven_labs_pronunciation_dictionary_locator import ElevenLabsPronunciationDictionaryLocator from .eleven_labs_voice_id import ElevenLabsVoiceId from .eleven_labs_voice_model import ElevenLabsVoiceModel from .fallback_plan import FallbackPlan @@ -88,6 +89,11 @@ class ElevenLabsVoice(UncheckedBaseModel): This is the model that will be used. Defaults to 'eleven_turbo_v2' if not specified. """ + language: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the language (ISO 639-1) that is enforced for the model. Currently only Turbo v2.5 supports language enforcement. For other models, an error will be returned if language code is provided. + """ + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = ( pydantic.Field(default=None) ) @@ -95,9 +101,12 @@ class ElevenLabsVoice(UncheckedBaseModel): This is the plan for chunking the model output before it is sent to the voice provider. """ - language: typing.Optional[str] = pydantic.Field(default=None) + pronunciation_dictionary_locators: typing_extensions.Annotated[ + typing.Optional[typing.List[ElevenLabsPronunciationDictionaryLocator]], + FieldMetadata(alias="pronunciationDictionaryLocators"), + ] = pydantic.Field(default=None) """ - This is the language (ISO 639-1) that is enforced for the model. Currently only Turbo v2.5 supports language enforcement. For other models, an error will be returned if language code is provided. + This is the pronunciation dictionary locators to use. """ fallback_plan: typing_extensions.Annotated[typing.Optional[FallbackPlan], FieldMetadata(alias="fallbackPlan")] = ( diff --git a/src/vapi/types/end_call_tool.py b/src/vapi/types/end_call_tool.py index cae92ed..be2d715 100644 --- a/src/vapi/types/end_call_tool.py +++ b/src/vapi/types/end_call_tool.py @@ -1,15 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import datetime as dt import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .end_call_tool_messages_item import EndCallToolMessagesItem -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan class EndCallTool(UncheckedBaseModel): @@ -41,13 +43,88 @@ class EndCallTool(UncheckedBaseModel): This is the ISO 8601 date-time string of when the tool was last updated. """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -58,3 +135,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(EndCallTool) diff --git a/src/vapi/types/fallback_assembly_ai_transcriber.py b/src/vapi/types/fallback_assembly_ai_transcriber.py index 9087743..7cbc080 100644 --- a/src/vapi/types/fallback_assembly_ai_transcriber.py +++ b/src/vapi/types/fallback_assembly_ai_transcriber.py @@ -29,30 +29,23 @@ class FallbackAssemblyAiTranscriber(UncheckedBaseModel): @default 0.4 """ - enable_universal_streaming_api: typing_extensions.Annotated[ - typing.Optional[bool], FieldMetadata(alias="enableUniversalStreamingApi") - ] = pydantic.Field(default=None) - """ - Uses Assembly AI's new Universal Streaming API. See: https://www.assemblyai.com/docs/speech-to-text/universal-streaming - - @default false - """ - format_turns: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="formatTurns")] = ( pydantic.Field(default=None) ) """ - This enables formatting of transcripts. Only used when `enableUniversalStreamingApi` is true. + This enables formatting of transcripts. - @default false + @default true """ end_of_turn_confidence_threshold: typing_extensions.Annotated[ typing.Optional[float], FieldMetadata(alias="endOfTurnConfidenceThreshold") ] = pydantic.Field(default=None) """ - The confidence threshold to use when determining if the end of a turn has been reached. Only used when `enableUniversalStreamingApi` is true. + This is the end of turn confidence threshold. The minimum confidence that the end of turn is detected. + @min 0 + @max 1 @default 0.7 """ @@ -60,7 +53,7 @@ class FallbackAssemblyAiTranscriber(UncheckedBaseModel): typing.Optional[float], FieldMetadata(alias="minEndOfTurnSilenceWhenConfident") ] = pydantic.Field(default=None) """ - The minimum amount of silence in milliseconds required to detect end of turn when confident. Only used when `enableUniversalStreamingApi` is true. + This is the minimum end of turn silence when confident in milliseconds. @default 160 """ @@ -69,7 +62,7 @@ class FallbackAssemblyAiTranscriber(UncheckedBaseModel): typing.Optional[float], FieldMetadata(alias="wordFinalizationMaxWaitTime") ] = pydantic.Field(default=None) """ - The maximum wait time for word finalization. Only used when `enableUniversalStreamingApi` is true. + This is the maximum wait time for word finalization in milliseconds. @default 160 """ @@ -78,7 +71,7 @@ class FallbackAssemblyAiTranscriber(UncheckedBaseModel): pydantic.Field(default=None) ) """ - The maximum amount of silence in milliseconds allowed in a turn before end of turn is triggered. Only used when `enableUniversalStreamingApi` is true. + This is the maximum turn silence time in milliseconds. @default 400 """ diff --git a/src/vapi/types/fallback_azure_speech_transcriber.py b/src/vapi/types/fallback_azure_speech_transcriber.py index 8bd080f..f7d0321 100644 --- a/src/vapi/types/fallback_azure_speech_transcriber.py +++ b/src/vapi/types/fallback_azure_speech_transcriber.py @@ -3,9 +3,12 @@ import typing import pydantic +import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .fallback_azure_speech_transcriber_language import FallbackAzureSpeechTranscriberLanguage +from .fallback_azure_speech_transcriber_segmentation_strategy import FallbackAzureSpeechTranscriberSegmentationStrategy class FallbackAzureSpeechTranscriber(UncheckedBaseModel): @@ -19,6 +22,27 @@ class FallbackAzureSpeechTranscriber(UncheckedBaseModel): This is the language that will be set for the transcription. The list of languages Azure supports can be found here: https://learn.microsoft.com/en-us/azure/ai-services/speech-service/language-support?tabs=stt """ + segmentation_strategy: typing_extensions.Annotated[ + typing.Optional[FallbackAzureSpeechTranscriberSegmentationStrategy], FieldMetadata(alias="segmentationStrategy") + ] = pydantic.Field(default=None) + """ + Controls how phrase boundaries are detected, enabling either simple time/silence heuristics or more advanced semantic segmentation. + """ + + segmentation_silence_timeout_ms: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="segmentationSilenceTimeoutMs") + ] = pydantic.Field(default=None) + """ + Duration of detected silence after which the service finalizes a phrase. Configure to adjust sensitivity to pauses in speech. + """ + + segmentation_maximum_time_ms: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="segmentationMaximumTimeMs") + ] = pydantic.Field(default=None) + """ + Maximum duration a segment can reach before being cut off when using time-based segmentation. + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/vapi/types/fallback_azure_speech_transcriber_segmentation_strategy.py b/src/vapi/types/fallback_azure_speech_transcriber_segmentation_strategy.py new file mode 100644 index 0000000..e920316 --- /dev/null +++ b/src/vapi/types/fallback_azure_speech_transcriber_segmentation_strategy.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +FallbackAzureSpeechTranscriberSegmentationStrategy = typing.Union[ + typing.Literal["Default", "Time", "Semantic"], typing.Any +] diff --git a/src/vapi/types/fallback_eleven_labs_voice.py b/src/vapi/types/fallback_eleven_labs_voice.py index 4e0f605..c342ad1 100644 --- a/src/vapi/types/fallback_eleven_labs_voice.py +++ b/src/vapi/types/fallback_eleven_labs_voice.py @@ -8,6 +8,7 @@ from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .chunk_plan import ChunkPlan +from .eleven_labs_pronunciation_dictionary_locator import ElevenLabsPronunciationDictionaryLocator from .fallback_eleven_labs_voice_id import FallbackElevenLabsVoiceId from .fallback_eleven_labs_voice_model import FallbackElevenLabsVoiceModel @@ -92,6 +93,14 @@ class FallbackElevenLabsVoice(UncheckedBaseModel): This is the language (ISO 639-1) that is enforced for the model. Currently only Turbo v2.5 supports language enforcement. For other models, an error will be returned if language code is provided. """ + pronunciation_dictionary_locators: typing_extensions.Annotated[ + typing.Optional[typing.List[ElevenLabsPronunciationDictionaryLocator]], + FieldMetadata(alias="pronunciationDictionaryLocators"), + ] = pydantic.Field(default=None) + """ + This is the pronunciation dictionary locators to use. + """ + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = ( pydantic.Field(default=None) ) diff --git a/src/vapi/types/fallback_gladia_transcriber.py b/src/vapi/types/fallback_gladia_transcriber.py index e8950a3..022cecd 100644 --- a/src/vapi/types/fallback_gladia_transcriber.py +++ b/src/vapi/types/fallback_gladia_transcriber.py @@ -11,6 +11,7 @@ from .fallback_gladia_transcriber_language_behaviour import FallbackGladiaTranscriberLanguageBehaviour from .fallback_gladia_transcriber_languages import FallbackGladiaTranscriberLanguages from .fallback_gladia_transcriber_model import FallbackGladiaTranscriberModel +from .gladia_custom_vocabulary_config_dto import GladiaCustomVocabularyConfigDto class FallbackGladiaTranscriber(UncheckedBaseModel): @@ -62,6 +63,32 @@ class FallbackGladiaTranscriber(UncheckedBaseModel): @default 0.4 """ + endpointing: typing.Optional[float] = pydantic.Field(default=None) + """ + Endpointing time in seconds - time to wait before considering speech ended + """ + + speech_threshold: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="speechThreshold")] = ( + pydantic.Field(default=None) + ) + """ + Speech threshold - sensitivity configuration for speech detection (0.0 to 1.0) + """ + + custom_vocabulary_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="customVocabularyEnabled") + ] = pydantic.Field(default=None) + """ + Enable custom vocabulary for improved accuracy + """ + + custom_vocabulary_config: typing_extensions.Annotated[ + typing.Optional[GladiaCustomVocabularyConfigDto], FieldMetadata(alias="customVocabularyConfig") + ] = pydantic.Field(default=None) + """ + Custom vocabulary configuration + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/vapi/types/fallback_google_transcriber_model.py b/src/vapi/types/fallback_google_transcriber_model.py index 3eea2a1..7088343 100644 --- a/src/vapi/types/fallback_google_transcriber_model.py +++ b/src/vapi/types/fallback_google_transcriber_model.py @@ -7,14 +7,10 @@ "gemini-2.5-pro", "gemini-2.5-flash", "gemini-2.5-flash-lite", - "gemini-2.5-pro-preview-05-06", - "gemini-2.5-flash-preview-05-20", - "gemini-2.5-flash-preview-04-17", "gemini-2.0-flash-thinking-exp", "gemini-2.0-pro-exp-02-05", "gemini-2.0-flash", "gemini-2.0-flash-lite", - "gemini-2.0-flash-lite-preview-02-05", "gemini-2.0-flash-exp", "gemini-2.0-flash-realtime-exp", "gemini-1.5-flash", diff --git a/src/vapi/types/fallback_minimax_voice.py b/src/vapi/types/fallback_minimax_voice.py new file mode 100644 index 0000000..d08bc12 --- /dev/null +++ b/src/vapi/types/fallback_minimax_voice.py @@ -0,0 +1,85 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel +from .chunk_plan import ChunkPlan +from .fallback_minimax_voice_model import FallbackMinimaxVoiceModel +from .fallback_minimax_voice_region import FallbackMinimaxVoiceRegion + + +class FallbackMinimaxVoice(UncheckedBaseModel): + caching_enabled: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="cachingEnabled")] = ( + pydantic.Field(default=None) + ) + """ + This is the flag to toggle voice caching for the assistant. + """ + + provider: typing.Literal["minimax"] = pydantic.Field(default="minimax") + """ + This is the voice provider that will be used. + """ + + voice_id: typing_extensions.Annotated[str, FieldMetadata(alias="voiceId")] = pydantic.Field() + """ + This is the provider-specific ID that will be used. Use a voice from MINIMAX_PREDEFINED_VOICES or a custom cloned voice ID. + """ + + model: typing.Optional[FallbackMinimaxVoiceModel] = pydantic.Field(default=None) + """ + This is the model that will be used. Options are 'speech-02-hd' and 'speech-02-turbo'. + speech-02-hd is optimized for high-fidelity applications like voiceovers and audiobooks. + speech-02-turbo is designed for real-time applications with low latency. + + @default "speech-02-turbo" + """ + + emotion: typing.Optional[str] = pydantic.Field(default=None) + """ + The emotion to use for the voice. If not provided, will use auto-detect mode. + Options include: 'happy', 'sad', 'angry', 'fearful', 'surprised', 'disgusted', 'neutral' + """ + + pitch: typing.Optional[float] = pydantic.Field(default=None) + """ + Voice pitch adjustment. Range from -12 to 12 semitones. + @default 0 + """ + + speed: typing.Optional[float] = pydantic.Field(default=None) + """ + Voice speed adjustment. Range from 0.5 to 2.0. + @default 1.0 + """ + + volume: typing.Optional[float] = pydantic.Field(default=None) + """ + Voice volume adjustment. Range from 0.5 to 2.0. + @default 1.0 + """ + + region: typing.Optional[FallbackMinimaxVoiceRegion] = pydantic.Field(default=None) + """ + The region for Minimax API. Defaults to "worldwide". + """ + + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = ( + pydantic.Field(default=None) + ) + """ + This is the plan for chunking the model output before it is sent to the voice provider. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/fallback_minimax_voice_model.py b/src/vapi/types/fallback_minimax_voice_model.py new file mode 100644 index 0000000..e91eb63 --- /dev/null +++ b/src/vapi/types/fallback_minimax_voice_model.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +FallbackMinimaxVoiceModel = typing.Union[typing.Literal["speech-02-hd", "speech-02-turbo"], typing.Any] diff --git a/src/vapi/types/fallback_minimax_voice_region.py b/src/vapi/types/fallback_minimax_voice_region.py new file mode 100644 index 0000000..39b6a58 --- /dev/null +++ b/src/vapi/types/fallback_minimax_voice_region.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +FallbackMinimaxVoiceRegion = typing.Union[typing.Literal["worldwide", "china"], typing.Any] diff --git a/src/vapi/types/fallback_open_ai_voice_id_enum.py b/src/vapi/types/fallback_open_ai_voice_id_enum.py index 2e47bda..ef163bb 100644 --- a/src/vapi/types/fallback_open_ai_voice_id_enum.py +++ b/src/vapi/types/fallback_open_ai_voice_id_enum.py @@ -3,5 +3,5 @@ import typing FallbackOpenAiVoiceIdEnum = typing.Union[ - typing.Literal["alloy", "echo", "fable", "onyx", "nova", "shimmer"], typing.Any + typing.Literal["alloy", "echo", "fable", "onyx", "nova", "shimmer", "marin", "cedar"], typing.Any ] diff --git a/src/vapi/types/fallback_rime_ai_voice.py b/src/vapi/types/fallback_rime_ai_voice.py index af11012..0ed0f84 100644 --- a/src/vapi/types/fallback_rime_ai_voice.py +++ b/src/vapi/types/fallback_rime_ai_voice.py @@ -32,7 +32,7 @@ class FallbackRimeAiVoice(UncheckedBaseModel): model: typing.Optional[FallbackRimeAiVoiceModel] = pydantic.Field(default=None) """ - This is the model that will be used. Defaults to 'mistv2' when not specified. + This is the model that will be used. Defaults to 'arcana' when not specified. """ speed: typing.Optional[float] = pydantic.Field(default=None) diff --git a/src/vapi/types/fallback_rime_ai_voice_model.py b/src/vapi/types/fallback_rime_ai_voice_model.py index 3631a20..727c1eb 100644 --- a/src/vapi/types/fallback_rime_ai_voice_model.py +++ b/src/vapi/types/fallback_rime_ai_voice_model.py @@ -2,4 +2,4 @@ import typing -FallbackRimeAiVoiceModel = typing.Union[typing.Literal["mist", "mistv2", "arcana"], typing.Any] +FallbackRimeAiVoiceModel = typing.Union[typing.Literal["arcana", "mistv2", "mist"], typing.Any] diff --git a/src/vapi/types/function_call_assistant_hook_action.py b/src/vapi/types/function_call_assistant_hook_action.py index 51b3b38..6b14203 100644 --- a/src/vapi/types/function_call_assistant_hook_action.py +++ b/src/vapi/types/function_call_assistant_hook_action.py @@ -2,69 +2,4 @@ import typing -import pydantic -import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.serialization import FieldMetadata -from ..core.unchecked_base_model import UncheckedBaseModel -from .function_call_assistant_hook_action_messages_item import FunctionCallAssistantHookActionMessagesItem -from .open_ai_function import OpenAiFunction -from .server import Server - - -class FunctionCallAssistantHookAction(UncheckedBaseModel): - messages: typing.Optional[typing.List[FunctionCallAssistantHookActionMessagesItem]] = pydantic.Field(default=None) - """ - These are the messages that will be spoken to the user as the tool is running. - - For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. - """ - - type: typing.Literal["function"] = pydantic.Field(default="function") - """ - The type of tool. "function" for Function tool. - """ - - async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = pydantic.Field( - default=None - ) - """ - This determines if the tool is async. - - If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. - - If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. - - Defaults to synchronous (`false`). - """ - - server: typing.Optional[Server] = pydantic.Field(default=None) - """ - - This is the server where a `tool-calls` webhook will be sent. - - Notes: - - Webhook is sent to this server when a tool call is made. - - Webhook contains the call, assistant, and phone number objects. - - Webhook contains the variables set on the assistant. - - Webhook is sent to the first available URL in this order: {{tool.server.url}}, {{assistant.server.url}}, {{phoneNumber.server.url}}, {{org.server.url}}. - - Webhook expects a response with tool call result. - """ - - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) - """ - This is the function definition of the tool. - - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. - - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow +FunctionCallAssistantHookAction = typing.Optional[typing.Any] diff --git a/src/vapi/types/function_call_hook_action.py b/src/vapi/types/function_call_hook_action.py new file mode 100644 index 0000000..0ffc66e --- /dev/null +++ b/src/vapi/types/function_call_hook_action.py @@ -0,0 +1,158 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel +from .function_call_hook_action_messages_item import FunctionCallHookActionMessagesItem +from .open_ai_function import OpenAiFunction +from .server import Server +from .tool_rejection_plan import ToolRejectionPlan + + +class FunctionCallHookAction(UncheckedBaseModel): + messages: typing.Optional[typing.List[FunctionCallHookActionMessagesItem]] = pydantic.Field(default=None) + """ + These are the messages that will be spoken to the user as the tool is running. + + For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + """ + + type: typing.Literal["function"] = pydantic.Field(default="function") + """ + The type of tool. "function" for Function tool. + """ + + async_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="async")] = pydantic.Field( + default=None + ) + """ + This determines if the tool is async. + + If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server. + + If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server. + + Defaults to synchronous (`false`). + """ + + server: typing.Optional[Server] = pydantic.Field(default=None) + """ + + This is the server where a `tool-calls` webhook will be sent. + + Notes: + - Webhook is sent to this server when a tool call is made. + - Webhook contains the call, assistant, and phone number objects. + - Webhook contains the variables set on the assistant. + - Webhook is sent to the first available URL in this order: {{tool.server.url}}, {{assistant.server.url}}, {{phoneNumber.server.url}}, {{org.server.url}}. + - Webhook expects a response with tool call result. + """ + + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) + """ + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` + + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` + + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` + """ + + function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + """ + This is the function definition of the tool. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(FunctionCallHookAction) diff --git a/src/vapi/types/function_call_hook_action_messages_item.py b/src/vapi/types/function_call_hook_action_messages_item.py new file mode 100644 index 0000000..a3804ff --- /dev/null +++ b/src/vapi/types/function_call_hook_action_messages_item.py @@ -0,0 +1,12 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .tool_message_complete import ToolMessageComplete +from .tool_message_delayed import ToolMessageDelayed +from .tool_message_failed import ToolMessageFailed +from .tool_message_start import ToolMessageStart + +FunctionCallHookActionMessagesItem = typing.Union[ + ToolMessageStart, ToolMessageComplete, ToolMessageFailed, ToolMessageDelayed +] diff --git a/src/vapi/types/function_tool.py b/src/vapi/types/function_tool.py index f96a06b..99c155a 100644 --- a/src/vapi/types/function_tool.py +++ b/src/vapi/types/function_tool.py @@ -1,16 +1,19 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import datetime as dt import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .function_tool_messages_item import FunctionToolMessagesItem from .open_ai_function import OpenAiFunction from .server import Server +from .tool_rejection_plan import ToolRejectionPlan class FunctionTool(UncheckedBaseModel): @@ -68,13 +71,93 @@ class FunctionTool(UncheckedBaseModel): This is the ISO 8601 date-time string of when the tool was last updated. """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` + + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` + """ + + function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + """ + This is the function definition of the tool. """ if IS_PYDANTIC_V2: @@ -85,3 +168,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(FunctionTool) diff --git a/src/vapi/types/function_tool_with_tool_call.py b/src/vapi/types/function_tool_with_tool_call.py index 4ad8eae..751c84c 100644 --- a/src/vapi/types/function_tool_with_tool_call.py +++ b/src/vapi/types/function_tool_with_tool_call.py @@ -1,16 +1,19 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .function_tool_with_tool_call_messages_item import FunctionToolWithToolCallMessagesItem from .open_ai_function import OpenAiFunction from .server import Server from .tool_call import ToolCall +from .tool_rejection_plan import ToolRejectionPlan class FunctionToolWithToolCall(UncheckedBaseModel): @@ -56,10 +59,90 @@ class FunctionToolWithToolCall(UncheckedBaseModel): function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) """ This is the function definition of the tool. + """ + + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) + """ + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` + + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -70,3 +153,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(FunctionToolWithToolCall) diff --git a/src/vapi/types/ghl_tool.py b/src/vapi/types/ghl_tool.py index c49381c..d1d6e2d 100644 --- a/src/vapi/types/ghl_tool.py +++ b/src/vapi/types/ghl_tool.py @@ -1,16 +1,18 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import datetime as dt import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .ghl_tool_messages_item import GhlToolMessagesItem from .ghl_tool_metadata import GhlToolMetadata -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan class GhlTool(UncheckedBaseModel): @@ -21,7 +23,11 @@ class GhlTool(UncheckedBaseModel): For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. """ - type: typing.Literal["ghl"] = "ghl" + type: typing.Literal["ghl"] = pydantic.Field(default="ghl") + """ + The type of tool. "ghl" for GHL tool. + """ + id: str = pydantic.Field() """ This is the unique identifier for the tool. @@ -42,13 +48,88 @@ class GhlTool(UncheckedBaseModel): This is the ISO 8601 date-time string of when the tool was last updated. """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` + + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ metadata: GhlToolMetadata @@ -61,3 +142,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(GhlTool) diff --git a/src/vapi/types/ghl_tool_with_tool_call.py b/src/vapi/types/ghl_tool_with_tool_call.py index caf51c9..65184a4 100644 --- a/src/vapi/types/ghl_tool_with_tool_call.py +++ b/src/vapi/types/ghl_tool_with_tool_call.py @@ -1,16 +1,18 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .ghl_tool_metadata import GhlToolMetadata from .ghl_tool_with_tool_call_messages_item import GhlToolWithToolCallMessagesItem -from .open_ai_function import OpenAiFunction from .tool_call import ToolCall +from .tool_rejection_plan import ToolRejectionPlan class GhlToolWithToolCall(UncheckedBaseModel): @@ -28,13 +30,88 @@ class GhlToolWithToolCall(UncheckedBaseModel): tool_call: typing_extensions.Annotated[ToolCall, FieldMetadata(alias="toolCall")] metadata: GhlToolMetadata - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -45,3 +122,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(GhlToolWithToolCall) diff --git a/src/vapi/types/gladia_custom_vocabulary_config_dto.py b/src/vapi/types/gladia_custom_vocabulary_config_dto.py new file mode 100644 index 0000000..bb90463 --- /dev/null +++ b/src/vapi/types/gladia_custom_vocabulary_config_dto.py @@ -0,0 +1,33 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel +from .gladia_custom_vocabulary_config_dto_vocabulary_item import GladiaCustomVocabularyConfigDtoVocabularyItem + + +class GladiaCustomVocabularyConfigDto(UncheckedBaseModel): + vocabulary: typing.List[GladiaCustomVocabularyConfigDtoVocabularyItem] = pydantic.Field() + """ + Array of vocabulary items (strings or objects with value, pronunciations, intensity, language) + """ + + default_intensity: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="defaultIntensity")] = ( + pydantic.Field(default=None) + ) + """ + Default intensity for vocabulary items (0.0 to 1.0) + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/gladia_custom_vocabulary_config_dto_vocabulary_item.py b/src/vapi/types/gladia_custom_vocabulary_config_dto_vocabulary_item.py new file mode 100644 index 0000000..28473a8 --- /dev/null +++ b/src/vapi/types/gladia_custom_vocabulary_config_dto_vocabulary_item.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .gladia_vocabulary_item_dto import GladiaVocabularyItemDto + +GladiaCustomVocabularyConfigDtoVocabularyItem = typing.Union[str, GladiaVocabularyItemDto] diff --git a/src/vapi/types/gladia_transcriber.py b/src/vapi/types/gladia_transcriber.py index c008552..d87e755 100644 --- a/src/vapi/types/gladia_transcriber.py +++ b/src/vapi/types/gladia_transcriber.py @@ -8,6 +8,7 @@ from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .fallback_transcriber_plan import FallbackTranscriberPlan +from .gladia_custom_vocabulary_config_dto import GladiaCustomVocabularyConfigDto from .gladia_transcriber_language import GladiaTranscriberLanguage from .gladia_transcriber_language_behaviour import GladiaTranscriberLanguageBehaviour from .gladia_transcriber_languages import GladiaTranscriberLanguages @@ -63,6 +64,32 @@ class GladiaTranscriber(UncheckedBaseModel): @default 0.4 """ + endpointing: typing.Optional[float] = pydantic.Field(default=None) + """ + Endpointing time in seconds - time to wait before considering speech ended + """ + + speech_threshold: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="speechThreshold")] = ( + pydantic.Field(default=None) + ) + """ + Speech threshold - sensitivity configuration for speech detection (0.0 to 1.0) + """ + + custom_vocabulary_enabled: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="customVocabularyEnabled") + ] = pydantic.Field(default=None) + """ + Enable custom vocabulary for improved accuracy + """ + + custom_vocabulary_config: typing_extensions.Annotated[ + typing.Optional[GladiaCustomVocabularyConfigDto], FieldMetadata(alias="customVocabularyConfig") + ] = pydantic.Field(default=None) + """ + Custom vocabulary configuration + """ + fallback_plan: typing_extensions.Annotated[ typing.Optional[FallbackTranscriberPlan], FieldMetadata(alias="fallbackPlan") ] = pydantic.Field(default=None) diff --git a/src/vapi/types/gladia_vocabulary_item_dto.py b/src/vapi/types/gladia_vocabulary_item_dto.py new file mode 100644 index 0000000..b39a742 --- /dev/null +++ b/src/vapi/types/gladia_vocabulary_item_dto.py @@ -0,0 +1,38 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.unchecked_base_model import UncheckedBaseModel + + +class GladiaVocabularyItemDto(UncheckedBaseModel): + value: str = pydantic.Field() + """ + The vocabulary word or phrase + """ + + pronunciations: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + Alternative pronunciations for the vocabulary item + """ + + intensity: typing.Optional[float] = pydantic.Field(default=None) + """ + Intensity for this specific vocabulary item (0.0 to 1.0) + """ + + language: typing.Optional[str] = pydantic.Field(default=None) + """ + Language code for this vocabulary item (ISO 639-1) + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/go_high_level_calendar_availability_tool.py b/src/vapi/types/go_high_level_calendar_availability_tool.py index 2f3c194..1e33c93 100644 --- a/src/vapi/types/go_high_level_calendar_availability_tool.py +++ b/src/vapi/types/go_high_level_calendar_availability_tool.py @@ -1,15 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import datetime as dt import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .go_high_level_calendar_availability_tool_messages_item import GoHighLevelCalendarAvailabilityToolMessagesItem -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan class GoHighLevelCalendarAvailabilityTool(UncheckedBaseModel): @@ -43,13 +45,88 @@ class GoHighLevelCalendarAvailabilityTool(UncheckedBaseModel): This is the ISO 8601 date-time string of when the tool was last updated. """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -60,3 +137,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(GoHighLevelCalendarAvailabilityTool) diff --git a/src/vapi/types/go_high_level_calendar_availability_tool_with_tool_call.py b/src/vapi/types/go_high_level_calendar_availability_tool_with_tool_call.py index 3930ea7..667e872 100644 --- a/src/vapi/types/go_high_level_calendar_availability_tool_with_tool_call.py +++ b/src/vapi/types/go_high_level_calendar_availability_tool_with_tool_call.py @@ -1,17 +1,19 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .go_high_level_calendar_availability_tool_with_tool_call_messages_item import ( GoHighLevelCalendarAvailabilityToolWithToolCallMessagesItem, ) -from .open_ai_function import OpenAiFunction from .tool_call import ToolCall +from .tool_rejection_plan import ToolRejectionPlan class GoHighLevelCalendarAvailabilityToolWithToolCall(UncheckedBaseModel): @@ -28,17 +30,92 @@ class GoHighLevelCalendarAvailabilityToolWithToolCall(UncheckedBaseModel): default="gohighlevel.calendar.availability.check" ) """ - The type of tool. "gohighlevel.calendar.availability.check" for GoHighLevel Calendar availability check tool. + The type of tool. "gohighlevel.calendar.availability.check" for GoHighLevel Calendar Availability Check tool. """ tool_call: typing_extensions.Annotated[ToolCall, FieldMetadata(alias="toolCall")] - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -49,3 +126,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(GoHighLevelCalendarAvailabilityToolWithToolCall) diff --git a/src/vapi/types/go_high_level_calendar_event_create_tool.py b/src/vapi/types/go_high_level_calendar_event_create_tool.py index c301f8f..2ab7d81 100644 --- a/src/vapi/types/go_high_level_calendar_event_create_tool.py +++ b/src/vapi/types/go_high_level_calendar_event_create_tool.py @@ -1,15 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import datetime as dt import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .go_high_level_calendar_event_create_tool_messages_item import GoHighLevelCalendarEventCreateToolMessagesItem -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan class GoHighLevelCalendarEventCreateTool(UncheckedBaseModel): @@ -43,13 +45,88 @@ class GoHighLevelCalendarEventCreateTool(UncheckedBaseModel): This is the ISO 8601 date-time string of when the tool was last updated. """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -60,3 +137,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(GoHighLevelCalendarEventCreateTool) diff --git a/src/vapi/types/go_high_level_calendar_event_create_tool_with_tool_call.py b/src/vapi/types/go_high_level_calendar_event_create_tool_with_tool_call.py index d4bd307..8237a40 100644 --- a/src/vapi/types/go_high_level_calendar_event_create_tool_with_tool_call.py +++ b/src/vapi/types/go_high_level_calendar_event_create_tool_with_tool_call.py @@ -1,17 +1,19 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .go_high_level_calendar_event_create_tool_with_tool_call_messages_item import ( GoHighLevelCalendarEventCreateToolWithToolCallMessagesItem, ) -from .open_ai_function import OpenAiFunction from .tool_call import ToolCall +from .tool_rejection_plan import ToolRejectionPlan class GoHighLevelCalendarEventCreateToolWithToolCall(UncheckedBaseModel): @@ -28,17 +30,92 @@ class GoHighLevelCalendarEventCreateToolWithToolCall(UncheckedBaseModel): default="gohighlevel.calendar.event.create" ) """ - The type of tool. "gohighlevel.calendar.event.create" for GoHighLevel Calendar event create tool. + The type of tool. "gohighlevel.calendar.event.create" for GoHighLevel Calendar Event Create tool. """ tool_call: typing_extensions.Annotated[ToolCall, FieldMetadata(alias="toolCall")] - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -49,3 +126,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(GoHighLevelCalendarEventCreateToolWithToolCall) diff --git a/src/vapi/types/go_high_level_contact_create_tool.py b/src/vapi/types/go_high_level_contact_create_tool.py index cc3a86a..de28008 100644 --- a/src/vapi/types/go_high_level_contact_create_tool.py +++ b/src/vapi/types/go_high_level_contact_create_tool.py @@ -1,15 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import datetime as dt import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .go_high_level_contact_create_tool_messages_item import GoHighLevelContactCreateToolMessagesItem -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan class GoHighLevelContactCreateTool(UncheckedBaseModel): @@ -41,13 +43,88 @@ class GoHighLevelContactCreateTool(UncheckedBaseModel): This is the ISO 8601 date-time string of when the tool was last updated. """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -58,3 +135,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(GoHighLevelContactCreateTool) diff --git a/src/vapi/types/go_high_level_contact_create_tool_with_tool_call.py b/src/vapi/types/go_high_level_contact_create_tool_with_tool_call.py index 3d444a7..c0c7a88 100644 --- a/src/vapi/types/go_high_level_contact_create_tool_with_tool_call.py +++ b/src/vapi/types/go_high_level_contact_create_tool_with_tool_call.py @@ -1,17 +1,19 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .go_high_level_contact_create_tool_with_tool_call_messages_item import ( GoHighLevelContactCreateToolWithToolCallMessagesItem, ) -from .open_ai_function import OpenAiFunction from .tool_call import ToolCall +from .tool_rejection_plan import ToolRejectionPlan class GoHighLevelContactCreateToolWithToolCall(UncheckedBaseModel): @@ -26,17 +28,92 @@ class GoHighLevelContactCreateToolWithToolCall(UncheckedBaseModel): type: typing.Literal["gohighlevel.contact.create"] = pydantic.Field(default="gohighlevel.contact.create") """ - The type of tool. "gohighlevel.contact.create" for GoHighLevel contact create tool. + The type of tool. "gohighlevel.contact.create" for GoHighLevel Contact Create tool. """ tool_call: typing_extensions.Annotated[ToolCall, FieldMetadata(alias="toolCall")] - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -47,3 +124,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(GoHighLevelContactCreateToolWithToolCall) diff --git a/src/vapi/types/go_high_level_contact_get_tool.py b/src/vapi/types/go_high_level_contact_get_tool.py index 75373fb..84c61c4 100644 --- a/src/vapi/types/go_high_level_contact_get_tool.py +++ b/src/vapi/types/go_high_level_contact_get_tool.py @@ -1,15 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import datetime as dt import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .go_high_level_contact_get_tool_messages_item import GoHighLevelContactGetToolMessagesItem -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan class GoHighLevelContactGetTool(UncheckedBaseModel): @@ -41,13 +43,88 @@ class GoHighLevelContactGetTool(UncheckedBaseModel): This is the ISO 8601 date-time string of when the tool was last updated. """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -58,3 +135,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(GoHighLevelContactGetTool) diff --git a/src/vapi/types/go_high_level_contact_get_tool_with_tool_call.py b/src/vapi/types/go_high_level_contact_get_tool_with_tool_call.py index a662776..a866d2f 100644 --- a/src/vapi/types/go_high_level_contact_get_tool_with_tool_call.py +++ b/src/vapi/types/go_high_level_contact_get_tool_with_tool_call.py @@ -1,17 +1,19 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .go_high_level_contact_get_tool_with_tool_call_messages_item import ( GoHighLevelContactGetToolWithToolCallMessagesItem, ) -from .open_ai_function import OpenAiFunction from .tool_call import ToolCall +from .tool_rejection_plan import ToolRejectionPlan class GoHighLevelContactGetToolWithToolCall(UncheckedBaseModel): @@ -26,17 +28,92 @@ class GoHighLevelContactGetToolWithToolCall(UncheckedBaseModel): type: typing.Literal["gohighlevel.contact.get"] = pydantic.Field(default="gohighlevel.contact.get") """ - The type of tool. "gohighlevel.contact.get" for GoHighLevel contact get tool. + The type of tool. "gohighlevel.contact.get" for GoHighLevel Contact Get tool. """ tool_call: typing_extensions.Annotated[ToolCall, FieldMetadata(alias="toolCall")] - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -47,3 +124,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(GoHighLevelContactGetToolWithToolCall) diff --git a/src/vapi/types/google_calendar_check_availability_tool.py b/src/vapi/types/google_calendar_check_availability_tool.py index 8eccbf4..a825b1b 100644 --- a/src/vapi/types/google_calendar_check_availability_tool.py +++ b/src/vapi/types/google_calendar_check_availability_tool.py @@ -1,15 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import datetime as dt import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .google_calendar_check_availability_tool_messages_item import GoogleCalendarCheckAvailabilityToolMessagesItem -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan class GoogleCalendarCheckAvailabilityTool(UncheckedBaseModel): @@ -43,13 +45,88 @@ class GoogleCalendarCheckAvailabilityTool(UncheckedBaseModel): This is the ISO 8601 date-time string of when the tool was last updated. """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -60,3 +137,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(GoogleCalendarCheckAvailabilityTool) diff --git a/src/vapi/types/google_calendar_create_event_tool.py b/src/vapi/types/google_calendar_create_event_tool.py index 8cd8f6e..b2b8d34 100644 --- a/src/vapi/types/google_calendar_create_event_tool.py +++ b/src/vapi/types/google_calendar_create_event_tool.py @@ -1,15 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import datetime as dt import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .google_calendar_create_event_tool_messages_item import GoogleCalendarCreateEventToolMessagesItem -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan class GoogleCalendarCreateEventTool(UncheckedBaseModel): @@ -41,13 +43,88 @@ class GoogleCalendarCreateEventTool(UncheckedBaseModel): This is the ISO 8601 date-time string of when the tool was last updated. """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -58,3 +135,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(GoogleCalendarCreateEventTool) diff --git a/src/vapi/types/google_calendar_create_event_tool_with_tool_call.py b/src/vapi/types/google_calendar_create_event_tool_with_tool_call.py index 239db6f..098ac66 100644 --- a/src/vapi/types/google_calendar_create_event_tool_with_tool_call.py +++ b/src/vapi/types/google_calendar_create_event_tool_with_tool_call.py @@ -1,17 +1,19 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .google_calendar_create_event_tool_with_tool_call_messages_item import ( GoogleCalendarCreateEventToolWithToolCallMessagesItem, ) -from .open_ai_function import OpenAiFunction from .tool_call import ToolCall +from .tool_rejection_plan import ToolRejectionPlan class GoogleCalendarCreateEventToolWithToolCall(UncheckedBaseModel): @@ -26,17 +28,92 @@ class GoogleCalendarCreateEventToolWithToolCall(UncheckedBaseModel): type: typing.Literal["google.calendar.event.create"] = pydantic.Field(default="google.calendar.event.create") """ - The type of tool. "google.calendar.event.create" for Google Calendar tool. + The type of tool. "google.calendar.event.create" for Google Calendar Create Event tool. """ tool_call: typing_extensions.Annotated[ToolCall, FieldMetadata(alias="toolCall")] - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -47,3 +124,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(GoogleCalendarCreateEventToolWithToolCall) diff --git a/src/vapi/types/google_model.py b/src/vapi/types/google_model.py index 2af8045..2063a2f 100644 --- a/src/vapi/types/google_model.py +++ b/src/vapi/types/google_model.py @@ -1,15 +1,16 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .create_custom_knowledge_base_dto import CreateCustomKnowledgeBaseDto from .google_model_model import GoogleModelModel -from .google_model_tools_item import GoogleModelToolsItem from .google_realtime_config import GoogleRealtimeConfig from .open_ai_message import OpenAiMessage @@ -20,7 +21,7 @@ class GoogleModel(UncheckedBaseModel): This is the starting state for the conversation. """ - tools: typing.Optional[typing.List[GoogleModelToolsItem]] = pydantic.Field(default=None) + tools: typing.Optional[typing.List["GoogleModelToolsItem"]] = pydantic.Field(default=None) """ These are the tools that the assistant can use during the call. To use existing tools, use `toolIds`. @@ -43,13 +44,6 @@ class GoogleModel(UncheckedBaseModel): These are the options for the knowledge base. """ - knowledge_base_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="knowledgeBaseId")] = ( - pydantic.Field(default=None) - ) - """ - This is the ID of the knowledge base the model will use. - """ - model: GoogleModelModel = pydantic.Field() """ This is the Google model that will be used. @@ -106,3 +100,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 +from .google_model_tools_item import GoogleModelToolsItem # noqa: E402, F401, I001 + +update_forward_refs(GoogleModel) diff --git a/src/vapi/types/google_model_model.py b/src/vapi/types/google_model_model.py index 54ab7bf..2d7de1d 100644 --- a/src/vapi/types/google_model_model.py +++ b/src/vapi/types/google_model_model.py @@ -7,14 +7,10 @@ "gemini-2.5-pro", "gemini-2.5-flash", "gemini-2.5-flash-lite", - "gemini-2.5-pro-preview-05-06", - "gemini-2.5-flash-preview-05-20", - "gemini-2.5-flash-preview-04-17", "gemini-2.0-flash-thinking-exp", "gemini-2.0-pro-exp-02-05", "gemini-2.0-flash", "gemini-2.0-flash-lite", - "gemini-2.0-flash-lite-preview-02-05", "gemini-2.0-flash-exp", "gemini-2.0-flash-realtime-exp", "gemini-1.5-flash", diff --git a/src/vapi/types/google_model_tools_item.py b/src/vapi/types/google_model_tools_item.py index 610587b..71afbe7 100644 --- a/src/vapi/types/google_model_tools_item.py +++ b/src/vapi/types/google_model_tools_item.py @@ -1,5 +1,7 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing from .create_api_request_tool_dto import CreateApiRequestToolDto @@ -22,6 +24,8 @@ from .create_text_editor_tool_dto import CreateTextEditorToolDto from .create_transfer_call_tool_dto import CreateTransferCallToolDto +if typing.TYPE_CHECKING: + from .create_handoff_tool_dto import CreateHandoffToolDto GoogleModelToolsItem = typing.Union[ CreateApiRequestToolDto, CreateBashToolDto, @@ -36,6 +40,7 @@ CreateGoogleCalendarCheckAvailabilityToolDto, CreateGoogleCalendarCreateEventToolDto, CreateGoogleSheetsRowAppendToolDto, + "CreateHandoffToolDto", CreateMcpToolDto, CreateQueryToolDto, CreateSlackSendMessageToolDto, diff --git a/src/vapi/types/google_sheets_row_append_tool.py b/src/vapi/types/google_sheets_row_append_tool.py index 298ffb8..4fc58fe 100644 --- a/src/vapi/types/google_sheets_row_append_tool.py +++ b/src/vapi/types/google_sheets_row_append_tool.py @@ -1,15 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import datetime as dt import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .google_sheets_row_append_tool_messages_item import GoogleSheetsRowAppendToolMessagesItem -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan class GoogleSheetsRowAppendTool(UncheckedBaseModel): @@ -41,13 +43,88 @@ class GoogleSheetsRowAppendTool(UncheckedBaseModel): This is the ISO 8601 date-time string of when the tool was last updated. """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -58,3 +135,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(GoogleSheetsRowAppendTool) diff --git a/src/vapi/types/google_sheets_row_append_tool_with_tool_call.py b/src/vapi/types/google_sheets_row_append_tool_with_tool_call.py index 287f5a8..282335d 100644 --- a/src/vapi/types/google_sheets_row_append_tool_with_tool_call.py +++ b/src/vapi/types/google_sheets_row_append_tool_with_tool_call.py @@ -1,17 +1,19 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .google_sheets_row_append_tool_with_tool_call_messages_item import ( GoogleSheetsRowAppendToolWithToolCallMessagesItem, ) -from .open_ai_function import OpenAiFunction from .tool_call import ToolCall +from .tool_rejection_plan import ToolRejectionPlan class GoogleSheetsRowAppendToolWithToolCall(UncheckedBaseModel): @@ -26,17 +28,92 @@ class GoogleSheetsRowAppendToolWithToolCall(UncheckedBaseModel): type: typing.Literal["google.sheets.row.append"] = pydantic.Field(default="google.sheets.row.append") """ - The type of tool. "google.sheets.row.append" for Google Sheets tool. + The type of tool. "google.sheets.row.append" for Google Sheets Row Append tool. """ tool_call: typing_extensions.Annotated[ToolCall, FieldMetadata(alias="toolCall")] - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -47,3 +124,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(GoogleSheetsRowAppendToolWithToolCall) diff --git a/src/vapi/types/google_transcriber_model.py b/src/vapi/types/google_transcriber_model.py index f44d8a3..a77595c 100644 --- a/src/vapi/types/google_transcriber_model.py +++ b/src/vapi/types/google_transcriber_model.py @@ -7,14 +7,10 @@ "gemini-2.5-pro", "gemini-2.5-flash", "gemini-2.5-flash-lite", - "gemini-2.5-pro-preview-05-06", - "gemini-2.5-flash-preview-05-20", - "gemini-2.5-flash-preview-04-17", "gemini-2.0-flash-thinking-exp", "gemini-2.0-pro-exp-02-05", "gemini-2.0-flash", "gemini-2.0-flash-lite", - "gemini-2.0-flash-lite-preview-02-05", "gemini-2.0-flash-exp", "gemini-2.0-flash-realtime-exp", "gemini-1.5-flash", diff --git a/src/vapi/types/google_voicemail_detection_plan.py b/src/vapi/types/google_voicemail_detection_plan.py index 07b8bc8..cadc0ff 100644 --- a/src/vapi/types/google_voicemail_detection_plan.py +++ b/src/vapi/types/google_voicemail_detection_plan.py @@ -7,6 +7,7 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel +from .google_voicemail_detection_plan_type import GoogleVoicemailDetectionPlanType from .voicemail_detection_backoff_plan import VoicemailDetectionBackoffPlan @@ -38,6 +39,14 @@ class GoogleVoicemailDetectionPlan(UncheckedBaseModel): This is the backoff plan for the voicemail detection. """ + type: typing.Optional[GoogleVoicemailDetectionPlanType] = pydantic.Field(default=None) + """ + This is the detection type to use for voicemail detection. + - 'audio': Uses native audio models (default) + - 'transcript': Uses ASR/transcript-based detection + @default 'audio' (audio detection) + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/vapi/types/google_voicemail_detection_plan_type.py b/src/vapi/types/google_voicemail_detection_plan_type.py new file mode 100644 index 0000000..cf64658 --- /dev/null +++ b/src/vapi/types/google_voicemail_detection_plan_type.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +GoogleVoicemailDetectionPlanType = typing.Union[typing.Literal["audio", "transcript"], typing.Any] diff --git a/src/vapi/types/groq_model.py b/src/vapi/types/groq_model.py index 23adc73..47e10b2 100644 --- a/src/vapi/types/groq_model.py +++ b/src/vapi/types/groq_model.py @@ -1,15 +1,16 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .create_custom_knowledge_base_dto import CreateCustomKnowledgeBaseDto from .groq_model_model import GroqModelModel -from .groq_model_tools_item import GroqModelToolsItem from .open_ai_message import OpenAiMessage @@ -19,7 +20,7 @@ class GroqModel(UncheckedBaseModel): This is the starting state for the conversation. """ - tools: typing.Optional[typing.List[GroqModelToolsItem]] = pydantic.Field(default=None) + tools: typing.Optional[typing.List["GroqModelToolsItem"]] = pydantic.Field(default=None) """ These are the tools that the assistant can use during the call. To use existing tools, use `toolIds`. @@ -42,13 +43,6 @@ class GroqModel(UncheckedBaseModel): These are the options for the knowledge base. """ - knowledge_base_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="knowledgeBaseId")] = ( - pydantic.Field(default=None) - ) - """ - This is the ID of the knowledge base the model will use. - """ - model: GroqModelModel = pydantic.Field() """ This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b @@ -97,3 +91,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 +from .groq_model_tools_item import GroqModelToolsItem # noqa: E402, F401, I001 + +update_forward_refs(GroqModel) diff --git a/src/vapi/types/groq_model_model.py b/src/vapi/types/groq_model_model.py index 27f92ba..e5da271 100644 --- a/src/vapi/types/groq_model_model.py +++ b/src/vapi/types/groq_model_model.py @@ -4,6 +4,8 @@ GroqModelModel = typing.Union[ typing.Literal[ + "openai/gpt-oss-20b", + "openai/gpt-oss-120b", "deepseek-r1-distill-llama-70b", "llama-3.3-70b-versatile", "llama-3.1-405b-reasoning", diff --git a/src/vapi/types/groq_model_tools_item.py b/src/vapi/types/groq_model_tools_item.py index 0dd6d44..ccbae81 100644 --- a/src/vapi/types/groq_model_tools_item.py +++ b/src/vapi/types/groq_model_tools_item.py @@ -1,5 +1,7 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing from .create_api_request_tool_dto import CreateApiRequestToolDto @@ -22,6 +24,8 @@ from .create_text_editor_tool_dto import CreateTextEditorToolDto from .create_transfer_call_tool_dto import CreateTransferCallToolDto +if typing.TYPE_CHECKING: + from .create_handoff_tool_dto import CreateHandoffToolDto GroqModelToolsItem = typing.Union[ CreateApiRequestToolDto, CreateBashToolDto, @@ -36,6 +40,7 @@ CreateGoogleCalendarCheckAvailabilityToolDto, CreateGoogleCalendarCreateEventToolDto, CreateGoogleSheetsRowAppendToolDto, + "CreateHandoffToolDto", CreateMcpToolDto, CreateQueryToolDto, CreateSlackSendMessageToolDto, diff --git a/src/vapi/types/group_condition.py b/src/vapi/types/group_condition.py new file mode 100644 index 0000000..789057c --- /dev/null +++ b/src/vapi/types/group_condition.py @@ -0,0 +1,42 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.unchecked_base_model import UncheckedBaseModel +from .group_condition_operator import GroupConditionOperator + + +class GroupCondition(UncheckedBaseModel): + type: typing.Literal["group"] = pydantic.Field(default="group") + """ + This is the type discriminator for group condition + """ + + operator: GroupConditionOperator = pydantic.Field() + """ + This is the logical operator for combining conditions in this group + """ + + conditions: typing.List["GroupConditionConditionsItem"] = pydantic.Field() + """ + This is the list of nested conditions to evaluate. + Supports recursive nesting of groups for complex logic. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .group_condition_conditions_item import GroupConditionConditionsItem # noqa: E402, F401, I001 + +update_forward_refs(GroupCondition) diff --git a/src/vapi/types/group_condition_conditions_item.py b/src/vapi/types/group_condition_conditions_item.py new file mode 100644 index 0000000..7405729 --- /dev/null +++ b/src/vapi/types/group_condition_conditions_item.py @@ -0,0 +1,12 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +from .liquid_condition import LiquidCondition +from .regex_condition import RegexCondition + +if typing.TYPE_CHECKING: + from .group_condition import GroupCondition +GroupConditionConditionsItem = typing.Union[RegexCondition, LiquidCondition, "GroupCondition"] diff --git a/src/vapi/types/group_condition_operator.py b/src/vapi/types/group_condition_operator.py new file mode 100644 index 0000000..d5d13a9 --- /dev/null +++ b/src/vapi/types/group_condition_operator.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +GroupConditionOperator = typing.Union[typing.Literal["AND", "OR"], typing.Any] diff --git a/src/vapi/types/handoff_destination_assistant.py b/src/vapi/types/handoff_destination_assistant.py new file mode 100644 index 0000000..fd9da19 --- /dev/null +++ b/src/vapi/types/handoff_destination_assistant.py @@ -0,0 +1,90 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel +from .handoff_destination_assistant_context_engineering_plan import HandoffDestinationAssistantContextEngineeringPlan +from .variable_extraction_plan import VariableExtractionPlan + + +class HandoffDestinationAssistant(UncheckedBaseModel): + type: typing.Literal["assistant"] = "assistant" + context_engineering_plan: typing_extensions.Annotated[ + typing.Optional[HandoffDestinationAssistantContextEngineeringPlan], + FieldMetadata(alias="contextEngineeringPlan"), + ] = pydantic.Field(default=None) + """ + This is the plan for manipulating the message context before handing off the call to the next assistant. + """ + + assistant_name: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantName")] = ( + pydantic.Field(default=None) + ) + """ + This is the assistant to transfer the call to. You must provide either assistantName or assistantId. + """ + + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = ( + pydantic.Field(default=None) + ) + """ + This is the assistant id to transfer the call to. You must provide either assistantName or assistantId. + """ + + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) + """ + This is a transient assistant to transfer the call to. You may provide a transient assistant in the response `handoff-destination-request` in a dynamic handoff. + """ + + variable_extraction_plan: typing_extensions.Annotated[ + typing.Optional[VariableExtractionPlan], FieldMetadata(alias="variableExtractionPlan") + ] = pydantic.Field(default=None) + """ + This is the variable extraction plan for the handoff tool. + """ + + description: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the description of the destination, used by the AI to choose when and how to transfer the call. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(HandoffDestinationAssistant) diff --git a/src/vapi/types/handoff_destination_assistant_context_engineering_plan.py b/src/vapi/types/handoff_destination_assistant_context_engineering_plan.py new file mode 100644 index 0000000..c93e3b3 --- /dev/null +++ b/src/vapi/types/handoff_destination_assistant_context_engineering_plan.py @@ -0,0 +1,11 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .context_engineering_plan_all import ContextEngineeringPlanAll +from .context_engineering_plan_last_n_messages import ContextEngineeringPlanLastNMessages +from .context_engineering_plan_none import ContextEngineeringPlanNone + +HandoffDestinationAssistantContextEngineeringPlan = typing.Union[ + ContextEngineeringPlanLastNMessages, ContextEngineeringPlanNone, ContextEngineeringPlanAll +] diff --git a/src/vapi/types/handoff_destination_dynamic.py b/src/vapi/types/handoff_destination_dynamic.py new file mode 100644 index 0000000..b793aa0 --- /dev/null +++ b/src/vapi/types/handoff_destination_dynamic.py @@ -0,0 +1,37 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.unchecked_base_model import UncheckedBaseModel +from .server import Server + + +class HandoffDestinationDynamic(UncheckedBaseModel): + type: typing.Literal["dynamic"] = "dynamic" + server: typing.Optional[Server] = pydantic.Field(default=None) + """ + This is where Vapi will send the handoff-destination-request webhook in a dynamic handoff. + + The order of precedence is: + + 1. tool.server.url + 2. assistant.server.url + 3. phoneNumber.server.url + 4. org.server.url + """ + + description: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the description of the destination, used by the AI to choose when and how to transfer the call. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/handoff_tool.py b/src/vapi/types/handoff_tool.py new file mode 100644 index 0000000..ae8abc4 --- /dev/null +++ b/src/vapi/types/handoff_tool.py @@ -0,0 +1,336 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import datetime as dt +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel +from .handoff_tool_destinations_item import HandoffToolDestinationsItem +from .handoff_tool_messages_item import HandoffToolMessagesItem +from .tool_rejection_plan import ToolRejectionPlan + + +class HandoffTool(UncheckedBaseModel): + messages: typing.Optional[typing.List[HandoffToolMessagesItem]] = pydantic.Field(default=None) + """ + These are the messages that will be spoken to the user as the tool is running. + + For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + """ + + type: typing.Literal["handoff"] = "handoff" + destinations: typing.Optional[typing.List[HandoffToolDestinationsItem]] = pydantic.Field(default=None) + """ + These are the destinations that the call can be handed off to. + + Usage: + 1. Single destination + + Use `assistantId` to handoff the call to a saved assistant, or `assistantName` to handoff the call to an assistant in the same squad. + + ```json + { + "tools": [ + { + "type": "handoff", + "destinations": [ + { + "type": "assistant", + "assistantId": "assistant-123", // or "assistantName": "Assistant123" + "description": "customer wants to be handed off to assistant-123", + "contextEngineeringPlan": { + "type": "all" + } + } + ], + } + ] + } + ``` + + 2. Multiple destinations + + 2.1. Multiple Tools, Each With One Destination (OpenAI recommended) + + ```json + { + "tools": [ + { + "type": "handoff", + "destinations": [ + { + "type": "assistant", + "assistantId": "assistant-123", + "description": "customer wants to be handed off to assistant-123", + "contextEngineeringPlan": { + "type": "all" + } + }, + ], + }, + { + "type": "handoff", + "destinations": [ + { + "type": "assistant", + "assistantId": "assistant-456", + "description": "customer wants to be handed off to assistant-456", + "contextEngineeringPlan": { + "type": "all" + } + } + ], + } + ] + } + ``` + + 2.2. One Tool, Multiple Destinations (Anthropic recommended) + + ```json + { + "tools": [ + { + "type": "handoff", + "destinations": [ + { + "type": "assistant", + "assistantId": "assistant-123", + "description": "customer wants to be handed off to assistant-123", + "contextEngineeringPlan": { + "type": "all" + } + }, + { + "type": "assistant", + "assistantId": "assistant-456", + "description": "customer wants to be handed off to assistant-456", + "contextEngineeringPlan": { + "type": "all" + } + } + ], + } + ] + } + ``` + + 3. Dynamic destination + + 3.1 To determine the destination dynamically, supply a `dynamic` handoff destination type and a `server` object. + VAPI will send a handoff-destination-request webhook to the `server.url`. + The response from the server will be used as the destination (if valid). + + ```json + { + "tools": [ + { + "type": "handoff", + "destinations": [ + { + "type": "dynamic", + "server": { + "url": "https://example.com" + } + } + ], + } + ] + } + ``` + + 3.2. To pass custom parameters to the server, you can use the `function` object. + + ```json + { + "tools": [ + { + "type": "handoff", + "destinations": [ + { + "type": "dynamic", + "server": { + "url": "https://example.com" + }, + } + ], + "function": { + "name": "handoff", + "description": "Call this function when the customer is ready to be handed off to the next assistant", + "parameters": { + "type": "object", + "properties": { + "destination": { + "type": "string", + "description": "Use dynamic when customer is ready to be handed off to the next assistant", + "enum": ["dynamic"] + }, + "customerAreaCode": { + "type": "number", + "description": "Area code of the customer" + }, + "customerIntent": { + "type": "string", + "enum": ["new-customer", "existing-customer"], + "description": "Use new-customer when customer is a new customer, existing-customer when customer is an existing customer" + }, + "customerSentiment": { + "type": "string", + "enum": ["positive", "negative", "neutral"], + "description": "Use positive when customer is happy, negative when customer is unhappy, neutral when customer is neutral" + } + } + } + } + } + ] + } + ``` + + The properties `customerAreaCode`, `customerIntent`, and `customerSentiment` will be passed to the server in the webhook request body. + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the tool. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the organization that this tool belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the tool was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the tool was last updated. + """ + + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) + """ + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` + + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` + + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(HandoffTool) diff --git a/src/vapi/types/handoff_tool_destinations_item.py b/src/vapi/types/handoff_tool_destinations_item.py new file mode 100644 index 0000000..01ad556 --- /dev/null +++ b/src/vapi/types/handoff_tool_destinations_item.py @@ -0,0 +1,8 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .handoff_destination_assistant import HandoffDestinationAssistant +from .handoff_destination_dynamic import HandoffDestinationDynamic + +HandoffToolDestinationsItem = typing.Union[HandoffDestinationAssistant, HandoffDestinationDynamic] diff --git a/src/vapi/types/handoff_tool_messages_item.py b/src/vapi/types/handoff_tool_messages_item.py new file mode 100644 index 0000000..19f9740 --- /dev/null +++ b/src/vapi/types/handoff_tool_messages_item.py @@ -0,0 +1,10 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .tool_message_complete import ToolMessageComplete +from .tool_message_delayed import ToolMessageDelayed +from .tool_message_failed import ToolMessageFailed +from .tool_message_start import ToolMessageStart + +HandoffToolMessagesItem = typing.Union[ToolMessageStart, ToolMessageComplete, ToolMessageFailed, ToolMessageDelayed] diff --git a/src/vapi/types/import_twilio_phone_number_dto.py b/src/vapi/types/import_twilio_phone_number_dto.py index 8d917cf..d6738a7 100644 --- a/src/vapi/types/import_twilio_phone_number_dto.py +++ b/src/vapi/types/import_twilio_phone_number_dto.py @@ -8,7 +8,7 @@ from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .import_twilio_phone_number_dto_fallback_destination import ImportTwilioPhoneNumberDtoFallbackDestination -from .phone_number_hook_call_ringing import PhoneNumberHookCallRinging +from .import_twilio_phone_number_dto_hooks_item import ImportTwilioPhoneNumberDtoHooksItem from .server import Server @@ -25,7 +25,7 @@ class ImportTwilioPhoneNumberDto(UncheckedBaseModel): If this is not set and above conditions are met, the inbound call is hung up with an error message. """ - hooks: typing.Optional[typing.List[PhoneNumberHookCallRinging]] = pydantic.Field(default=None) + hooks: typing.Optional[typing.List[ImportTwilioPhoneNumberDtoHooksItem]] = pydantic.Field(default=None) """ This is the hooks that will be used for incoming calls to this phone number. """ diff --git a/src/vapi/types/import_twilio_phone_number_dto_hooks_item.py b/src/vapi/types/import_twilio_phone_number_dto_hooks_item.py new file mode 100644 index 0000000..71e868d --- /dev/null +++ b/src/vapi/types/import_twilio_phone_number_dto_hooks_item.py @@ -0,0 +1,8 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .phone_number_hook_call_ending import PhoneNumberHookCallEnding +from .phone_number_hook_call_ringing import PhoneNumberHookCallRinging + +ImportTwilioPhoneNumberDtoHooksItem = typing.Union[PhoneNumberHookCallRinging, PhoneNumberHookCallEnding] diff --git a/src/vapi/types/import_vonage_phone_number_dto.py b/src/vapi/types/import_vonage_phone_number_dto.py index 3a82b42..88c0aec 100644 --- a/src/vapi/types/import_vonage_phone_number_dto.py +++ b/src/vapi/types/import_vonage_phone_number_dto.py @@ -8,7 +8,7 @@ from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .import_vonage_phone_number_dto_fallback_destination import ImportVonagePhoneNumberDtoFallbackDestination -from .phone_number_hook_call_ringing import PhoneNumberHookCallRinging +from .import_vonage_phone_number_dto_hooks_item import ImportVonagePhoneNumberDtoHooksItem from .server import Server @@ -25,7 +25,7 @@ class ImportVonagePhoneNumberDto(UncheckedBaseModel): If this is not set and above conditions are met, the inbound call is hung up with an error message. """ - hooks: typing.Optional[typing.List[PhoneNumberHookCallRinging]] = pydantic.Field(default=None) + hooks: typing.Optional[typing.List[ImportVonagePhoneNumberDtoHooksItem]] = pydantic.Field(default=None) """ This is the hooks that will be used for incoming calls to this phone number. """ diff --git a/src/vapi/types/import_vonage_phone_number_dto_hooks_item.py b/src/vapi/types/import_vonage_phone_number_dto_hooks_item.py new file mode 100644 index 0000000..bd9789c --- /dev/null +++ b/src/vapi/types/import_vonage_phone_number_dto_hooks_item.py @@ -0,0 +1,8 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .phone_number_hook_call_ending import PhoneNumberHookCallEnding +from .phone_number_hook_call_ringing import PhoneNumberHookCallRinging + +ImportVonagePhoneNumberDtoHooksItem = typing.Union[PhoneNumberHookCallRinging, PhoneNumberHookCallEnding] diff --git a/src/vapi/types/inflection_ai_model.py b/src/vapi/types/inflection_ai_model.py index be7a84c..943e652 100644 --- a/src/vapi/types/inflection_ai_model.py +++ b/src/vapi/types/inflection_ai_model.py @@ -1,14 +1,15 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .create_custom_knowledge_base_dto import CreateCustomKnowledgeBaseDto -from .inflection_ai_model_tools_item import InflectionAiModelToolsItem from .open_ai_message import OpenAiMessage @@ -18,7 +19,7 @@ class InflectionAiModel(UncheckedBaseModel): This is the starting state for the conversation. """ - tools: typing.Optional[typing.List[InflectionAiModelToolsItem]] = pydantic.Field(default=None) + tools: typing.Optional[typing.List["InflectionAiModelToolsItem"]] = pydantic.Field(default=None) """ These are the tools that the assistant can use during the call. To use existing tools, use `toolIds`. @@ -41,13 +42,6 @@ class InflectionAiModel(UncheckedBaseModel): These are the options for the knowledge base. """ - knowledge_base_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="knowledgeBaseId")] = ( - pydantic.Field(default=None) - ) - """ - This is the ID of the knowledge base the model will use. - """ - model: typing.Literal["inflection_3_pi"] = pydantic.Field(default="inflection_3_pi") """ This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b @@ -96,3 +90,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 +from .inflection_ai_model_tools_item import InflectionAiModelToolsItem # noqa: E402, F401, I001 + +update_forward_refs(InflectionAiModel) diff --git a/src/vapi/types/inflection_ai_model_tools_item.py b/src/vapi/types/inflection_ai_model_tools_item.py index 176ad6a..426a906 100644 --- a/src/vapi/types/inflection_ai_model_tools_item.py +++ b/src/vapi/types/inflection_ai_model_tools_item.py @@ -1,5 +1,7 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing from .create_api_request_tool_dto import CreateApiRequestToolDto @@ -22,6 +24,8 @@ from .create_text_editor_tool_dto import CreateTextEditorToolDto from .create_transfer_call_tool_dto import CreateTransferCallToolDto +if typing.TYPE_CHECKING: + from .create_handoff_tool_dto import CreateHandoffToolDto InflectionAiModelToolsItem = typing.Union[ CreateApiRequestToolDto, CreateBashToolDto, @@ -36,6 +40,7 @@ CreateGoogleCalendarCheckAvailabilityToolDto, CreateGoogleCalendarCreateEventToolDto, CreateGoogleSheetsRowAppendToolDto, + "CreateHandoffToolDto", CreateMcpToolDto, CreateQueryToolDto, CreateSlackSendMessageToolDto, diff --git a/src/vapi/types/inworld_credential.py b/src/vapi/types/inworld_credential.py new file mode 100644 index 0000000..deb3edd --- /dev/null +++ b/src/vapi/types/inworld_credential.py @@ -0,0 +1,52 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel + + +class InworldCredential(UncheckedBaseModel): + provider: typing.Literal["inworld"] = "inworld" + api_key: typing_extensions.Annotated[str, FieldMetadata(alias="apiKey")] = pydantic.Field() + """ + This is the Inworld Basic (Base64) authentication token. This is not returned in the API. + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the credential. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the org that this credential belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the credential was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the assistant was last updated. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of credential. This is just for your reference. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/knowledge_base_model.py b/src/vapi/types/knowledge_base_model.py index 7cb5b57..0418789 100644 --- a/src/vapi/types/knowledge_base_model.py +++ b/src/vapi/types/knowledge_base_model.py @@ -7,14 +7,10 @@ "gemini-2.5-pro", "gemini-2.5-flash", "gemini-2.5-flash-lite", - "gemini-2.5-pro-preview-05-06", - "gemini-2.5-flash-preview-05-20", - "gemini-2.5-flash-preview-04-17", "gemini-2.0-flash-thinking-exp", "gemini-2.0-pro-exp-02-05", "gemini-2.0-flash", "gemini-2.0-flash-lite", - "gemini-2.0-flash-lite-preview-02-05", "gemini-2.0-flash-exp", "gemini-2.0-flash-realtime-exp", "gemini-1.5-flash", diff --git a/src/vapi/types/liquid_condition.py b/src/vapi/types/liquid_condition.py new file mode 100644 index 0000000..9b566e5 --- /dev/null +++ b/src/vapi/types/liquid_condition.py @@ -0,0 +1,40 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.unchecked_base_model import UncheckedBaseModel + + +class LiquidCondition(UncheckedBaseModel): + type: typing.Literal["liquid"] = pydantic.Field(default="liquid") + """ + This is the type discriminator for liquid condition + """ + + liquid: str = pydantic.Field() + """ + This is the Liquid template that must return exactly "true" or "false" as a string. + The template is evaluated and the entire output must be either "true" or "false" - nothing else. + + Available variables: + - `messages`: Array of recent messages in OpenAI chat completions format (ChatCompletionMessageParam[]) + Each message has properties like: role ('user', 'assistant', 'system'), content (string), etc. + - `now`: Current timestamp in milliseconds (built-in Liquid variable) + - Any assistant variable values (e.g., `userName`, `accountStatus`) + + Useful Liquid filters for messages: + - `messages | last: 5` - Get the 5 most recent messages + - `messages | where: 'role', 'user'` - Filter to only user messages + - `messages | reverse` - Reverse the order of messages + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/log.py b/src/vapi/types/log.py deleted file mode 100644 index f63e418..0000000 --- a/src/vapi/types/log.py +++ /dev/null @@ -1,182 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.serialization import FieldMetadata -from ..core.unchecked_base_model import UncheckedBaseModel -from .error import Error -from .log_request_http_method import LogRequestHttpMethod -from .log_resource import LogResource -from .log_type import LogType - - -class Log(UncheckedBaseModel): - time: str = pydantic.Field() - """ - This is the timestamp at which the log was written. - """ - - org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() - """ - This is the unique identifier for the org that this log belongs to. - """ - - type: LogType = pydantic.Field() - """ - This is the type of the log. - """ - - webhook_type: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="webhookType")] = ( - pydantic.Field(default=None) - ) - """ - This is the type of the webhook, given the log is from a webhook. - """ - - resource: typing.Optional[LogResource] = pydantic.Field(default=None) - """ - This is the specific resource, relevant only to API logs. - """ - - request_duration_seconds: typing_extensions.Annotated[ - typing.Optional[float], FieldMetadata(alias="requestDurationSeconds") - ] = pydantic.Field(default=None) - """ - 'This is how long the request took. - """ - - request_started_at: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="requestStartedAt")] = ( - pydantic.Field(default=None) - ) - """ - This is the timestamp at which the request began. - """ - - request_finished_at: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="requestFinishedAt")] = ( - pydantic.Field(default=None) - ) - """ - This is the timestamp at which the request finished. - """ - - request_body: typing_extensions.Annotated[ - typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]], FieldMetadata(alias="requestBody") - ] = pydantic.Field(default=None) - """ - This is the body of the request. - """ - - request_http_method: typing_extensions.Annotated[ - typing.Optional[LogRequestHttpMethod], FieldMetadata(alias="requestHttpMethod") - ] = pydantic.Field(default=None) - """ - This is the request method. - """ - - request_url: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="requestUrl")] = pydantic.Field( - default=None - ) - """ - This is the request URL. - """ - - request_path: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="requestPath")] = ( - pydantic.Field(default=None) - ) - """ - This is the request path. - """ - - request_query: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="requestQuery")] = ( - pydantic.Field(default=None) - ) - """ - This is the request query. - """ - - response_http_code: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="responseHttpCode")] = ( - pydantic.Field(default=None) - ) - """ - This the HTTP status code of the response. - """ - - request_ip_address: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="requestIpAddress")] = ( - pydantic.Field(default=None) - ) - """ - This is the request IP address. - """ - - request_origin: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="requestOrigin")] = ( - pydantic.Field(default=None) - ) - """ - This is the origin of the request - """ - - response_body: typing_extensions.Annotated[ - typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]], FieldMetadata(alias="responseBody") - ] = pydantic.Field(default=None) - """ - This is the body of the response. - """ - - request_headers: typing_extensions.Annotated[ - typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]], FieldMetadata(alias="requestHeaders") - ] = pydantic.Field(default=None) - """ - These are the headers of the request. - """ - - error: typing.Optional[Error] = pydantic.Field(default=None) - """ - This is the error, if one occurred. - """ - - assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = ( - pydantic.Field(default=None) - ) - """ - This is the ID of the assistant. - """ - - phone_number_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="phoneNumberId")] = ( - pydantic.Field(default=None) - ) - """ - This is the ID of the phone number. - """ - - customer_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="customerId")] = pydantic.Field( - default=None - ) - """ - This is the ID of the customer. - """ - - squad_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="squadId")] = pydantic.Field( - default=None - ) - """ - This is the ID of the squad. - """ - - call_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="callId")] = pydantic.Field( - default=None - ) - """ - This is the ID of the call. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/vapi/types/log_request_http_method.py b/src/vapi/types/log_request_http_method.py deleted file mode 100644 index f473488..0000000 --- a/src/vapi/types/log_request_http_method.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -LogRequestHttpMethod = typing.Union[typing.Literal["POST", "GET", "PUT", "PATCH", "DELETE"], typing.Any] diff --git a/src/vapi/types/log_resource.py b/src/vapi/types/log_resource.py deleted file mode 100644 index ab0b1c2..0000000 --- a/src/vapi/types/log_resource.py +++ /dev/null @@ -1,25 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -LogResource = typing.Union[ - typing.Literal[ - "org", - "assistant", - "analytics", - "credential", - "phone-number", - "block", - "voice-library", - "provider", - "tool", - "token", - "template", - "squad", - "call", - "file", - "metric", - "log", - ], - typing.Any, -] diff --git a/src/vapi/types/log_type.py b/src/vapi/types/log_type.py deleted file mode 100644 index d18d5af..0000000 --- a/src/vapi/types/log_type.py +++ /dev/null @@ -1,5 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -LogType = typing.Union[typing.Literal["API", "Webhook", "Call", "Provider"], typing.Any] diff --git a/src/vapi/types/make_tool.py b/src/vapi/types/make_tool.py index 2aa83d6..1e8c32f 100644 --- a/src/vapi/types/make_tool.py +++ b/src/vapi/types/make_tool.py @@ -1,16 +1,18 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import datetime as dt import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .make_tool_messages_item import MakeToolMessagesItem from .make_tool_metadata import MakeToolMetadata -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan class MakeTool(UncheckedBaseModel): @@ -21,7 +23,11 @@ class MakeTool(UncheckedBaseModel): For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. """ - type: typing.Literal["make"] = "make" + type: typing.Literal["make"] = pydantic.Field(default="make") + """ + The type of tool. "make" for Make tool. + """ + id: str = pydantic.Field() """ This is the unique identifier for the tool. @@ -42,13 +48,88 @@ class MakeTool(UncheckedBaseModel): This is the ISO 8601 date-time string of when the tool was last updated. """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` + + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ metadata: MakeToolMetadata @@ -61,3 +142,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(MakeTool) diff --git a/src/vapi/types/make_tool_with_tool_call.py b/src/vapi/types/make_tool_with_tool_call.py index 732fc53..37a6136 100644 --- a/src/vapi/types/make_tool_with_tool_call.py +++ b/src/vapi/types/make_tool_with_tool_call.py @@ -1,16 +1,18 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .make_tool_metadata import MakeToolMetadata from .make_tool_with_tool_call_messages_item import MakeToolWithToolCallMessagesItem -from .open_ai_function import OpenAiFunction from .tool_call import ToolCall +from .tool_rejection_plan import ToolRejectionPlan class MakeToolWithToolCall(UncheckedBaseModel): @@ -28,13 +30,88 @@ class MakeToolWithToolCall(UncheckedBaseModel): tool_call: typing_extensions.Annotated[ToolCall, FieldMetadata(alias="toolCall")] metadata: MakeToolMetadata - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -45,3 +122,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(MakeToolWithToolCall) diff --git a/src/vapi/types/mcp_tool.py b/src/vapi/types/mcp_tool.py index a0c1a15..babfdca 100644 --- a/src/vapi/types/mcp_tool.py +++ b/src/vapi/types/mcp_tool.py @@ -1,17 +1,19 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import datetime as dt import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .mcp_tool_messages_item import McpToolMessagesItem from .mcp_tool_metadata import McpToolMetadata -from .open_ai_function import OpenAiFunction from .server import Server +from .tool_rejection_plan import ToolRejectionPlan class McpTool(UncheckedBaseModel): @@ -56,13 +58,88 @@ class McpTool(UncheckedBaseModel): This is the ISO 8601 date-time string of when the tool was last updated. """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ metadata: typing.Optional[McpToolMetadata] = None @@ -75,3 +152,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(McpTool) diff --git a/src/vapi/types/message_plan.py b/src/vapi/types/message_plan.py deleted file mode 100644 index 0ec14d5..0000000 --- a/src/vapi/types/message_plan.py +++ /dev/null @@ -1,69 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.serialization import FieldMetadata -from ..core.unchecked_base_model import UncheckedBaseModel - - -class MessagePlan(UncheckedBaseModel): - idle_messages: typing_extensions.Annotated[ - typing.Optional[typing.List[str]], FieldMetadata(alias="idleMessages") - ] = pydantic.Field(default=None) - """ - This are the messages that the assistant will speak when the user hasn't responded for `idleTimeoutSeconds`. Each time the timeout is triggered, a random message will be chosen from this array. - - Usage: - - If user gets distracted and doesn't respond for a while, this can be used to grab their attention. - - If the transcriber doesn't pick up what the user said, this can be used to ask the user to repeat themselves. (From the perspective of the assistant, the conversation is idle since it didn't "hear" any user messages.) - - @default null (no idle message is spoken) - """ - - idle_message_max_spoken_count: typing_extensions.Annotated[ - typing.Optional[float], FieldMetadata(alias="idleMessageMaxSpokenCount") - ] = pydantic.Field(default=None) - """ - This determines the maximum number of times `idleMessages` can be spoken during the call. - - @default 3 - """ - - idle_message_reset_count_on_user_speech_enabled: typing_extensions.Annotated[ - typing.Optional[bool], FieldMetadata(alias="idleMessageResetCountOnUserSpeechEnabled") - ] = pydantic.Field(default=None) - """ - This determines whether the idle message count is reset whenever the user speaks. - - @default false - """ - - idle_timeout_seconds: typing_extensions.Annotated[ - typing.Optional[float], FieldMetadata(alias="idleTimeoutSeconds") - ] = pydantic.Field(default=None) - """ - This is the timeout in seconds before a message from `idleMessages` is spoken. The clock starts when the assistant finishes speaking and remains active until the user speaks. - - @default 10 - """ - - silence_timeout_message: typing_extensions.Annotated[ - typing.Optional[str], FieldMetadata(alias="silenceTimeoutMessage") - ] = pydantic.Field(default=None) - """ - This is the message that the assistant will say if the call ends due to silence. - - If unspecified, it will hang up without saying anything. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/src/vapi/types/message_target.py b/src/vapi/types/message_target.py new file mode 100644 index 0000000..b063231 --- /dev/null +++ b/src/vapi/types/message_target.py @@ -0,0 +1,36 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.unchecked_base_model import UncheckedBaseModel +from .message_target_role import MessageTargetRole + + +class MessageTarget(UncheckedBaseModel): + role: typing.Optional[MessageTargetRole] = pydantic.Field(default=None) + """ + This is the role of the message to target. + + If not specified, will find the position in the message history ignoring role (effectively `any`). + """ + + position: typing.Optional[float] = pydantic.Field(default=None) + """ + This is the position of the message to target. + - Negative numbers: Count from end (-1 = most recent, -2 = second most recent) + - 0: First/oldest message in history + - Positive numbers: Specific position (0-indexed from start) + + @default -1 (most recent message) + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/message_target_role.py b/src/vapi/types/message_target_role.py new file mode 100644 index 0000000..5f8ba92 --- /dev/null +++ b/src/vapi/types/message_target_role.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +MessageTargetRole = typing.Union[typing.Literal["user", "assistant"], typing.Any] diff --git a/src/vapi/types/minimax_voice.py b/src/vapi/types/minimax_voice.py new file mode 100644 index 0000000..1c2f8a4 --- /dev/null +++ b/src/vapi/types/minimax_voice.py @@ -0,0 +1,93 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel +from .chunk_plan import ChunkPlan +from .fallback_plan import FallbackPlan +from .minimax_voice_model import MinimaxVoiceModel +from .minimax_voice_region import MinimaxVoiceRegion + + +class MinimaxVoice(UncheckedBaseModel): + caching_enabled: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="cachingEnabled")] = ( + pydantic.Field(default=None) + ) + """ + This is the flag to toggle voice caching for the assistant. + """ + + provider: typing.Literal["minimax"] = pydantic.Field(default="minimax") + """ + This is the voice provider that will be used. + """ + + voice_id: typing_extensions.Annotated[str, FieldMetadata(alias="voiceId")] = pydantic.Field() + """ + This is the provider-specific ID that will be used. Use a voice from MINIMAX_PREDEFINED_VOICES or a custom cloned voice ID. + """ + + model: typing.Optional[MinimaxVoiceModel] = pydantic.Field(default=None) + """ + This is the model that will be used. Options are 'speech-02-hd' and 'speech-02-turbo'. + speech-02-hd is optimized for high-fidelity applications like voiceovers and audiobooks. + speech-02-turbo is designed for real-time applications with low latency. + + @default "speech-02-turbo" + """ + + emotion: typing.Optional[str] = pydantic.Field(default=None) + """ + The emotion to use for the voice. If not provided, will use auto-detect mode. + Options include: 'happy', 'sad', 'angry', 'fearful', 'surprised', 'disgusted', 'neutral' + """ + + pitch: typing.Optional[float] = pydantic.Field(default=None) + """ + Voice pitch adjustment. Range from -12 to 12 semitones. + @default 0 + """ + + speed: typing.Optional[float] = pydantic.Field(default=None) + """ + Voice speed adjustment. Range from 0.5 to 2.0. + @default 1.0 + """ + + volume: typing.Optional[float] = pydantic.Field(default=None) + """ + Voice volume adjustment. Range from 0.5 to 2.0. + @default 1.0 + """ + + region: typing.Optional[MinimaxVoiceRegion] = pydantic.Field(default=None) + """ + The region for Minimax API. Defaults to "worldwide". + """ + + chunk_plan: typing_extensions.Annotated[typing.Optional[ChunkPlan], FieldMetadata(alias="chunkPlan")] = ( + pydantic.Field(default=None) + ) + """ + This is the plan for chunking the model output before it is sent to the voice provider. + """ + + fallback_plan: typing_extensions.Annotated[typing.Optional[FallbackPlan], FieldMetadata(alias="fallbackPlan")] = ( + pydantic.Field(default=None) + ) + """ + This is the plan for voice provider fallbacks in the event that the primary voice provider fails. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/minimax_voice_model.py b/src/vapi/types/minimax_voice_model.py new file mode 100644 index 0000000..4d97b7c --- /dev/null +++ b/src/vapi/types/minimax_voice_model.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +MinimaxVoiceModel = typing.Union[typing.Literal["speech-02-hd", "speech-02-turbo"], typing.Any] diff --git a/src/vapi/types/minimax_voice_region.py b/src/vapi/types/minimax_voice_region.py new file mode 100644 index 0000000..cb6c8d2 --- /dev/null +++ b/src/vapi/types/minimax_voice_region.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +MinimaxVoiceRegion = typing.Union[typing.Literal["worldwide", "china"], typing.Any] diff --git a/src/vapi/types/open_ai_model.py b/src/vapi/types/open_ai_model.py index 5937147..9fec8fd 100644 --- a/src/vapi/types/open_ai_model.py +++ b/src/vapi/types/open_ai_model.py @@ -1,10 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .create_custom_knowledge_base_dto import CreateCustomKnowledgeBaseDto @@ -12,7 +14,6 @@ from .open_ai_model_fallback_models_item import OpenAiModelFallbackModelsItem from .open_ai_model_model import OpenAiModelModel from .open_ai_model_tool_strict_compatibility_mode import OpenAiModelToolStrictCompatibilityMode -from .open_ai_model_tools_item import OpenAiModelToolsItem class OpenAiModel(UncheckedBaseModel): @@ -21,7 +22,7 @@ class OpenAiModel(UncheckedBaseModel): This is the starting state for the conversation. """ - tools: typing.Optional[typing.List[OpenAiModelToolsItem]] = pydantic.Field(default=None) + tools: typing.Optional[typing.List["OpenAiModelToolsItem"]] = pydantic.Field(default=None) """ These are the tools that the assistant can use during the call. To use existing tools, use `toolIds`. @@ -44,13 +45,6 @@ class OpenAiModel(UncheckedBaseModel): These are the options for the knowledge base. """ - knowledge_base_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="knowledgeBaseId")] = ( - pydantic.Field(default=None) - ) - """ - This is the ID of the knowledge base the model will use. - """ - provider: typing.Literal["openai"] = pydantic.Field(default="openai") """ This is the provider that will be used for the model. @@ -127,3 +121,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 +from .open_ai_model_tools_item import OpenAiModelToolsItem # noqa: E402, F401, I001 + +update_forward_refs(OpenAiModel) diff --git a/src/vapi/types/open_ai_model_fallback_models_item.py b/src/vapi/types/open_ai_model_fallback_models_item.py index 4029a34..ae63830 100644 --- a/src/vapi/types/open_ai_model_fallback_models_item.py +++ b/src/vapi/types/open_ai_model_fallback_models_item.py @@ -4,24 +4,25 @@ OpenAiModelFallbackModelsItem = typing.Union[ typing.Literal[ + "gpt-5", + "gpt-5-mini", + "gpt-5-nano", "gpt-4.1-2025-04-14", "gpt-4.1-mini-2025-04-14", "gpt-4.1-nano-2025-04-14", "gpt-4.1", "gpt-4.1-mini", "gpt-4.1-nano", - "gpt-4.5-preview", "chatgpt-4o-latest", "o3", "o3-mini", "o4-mini", - "o1-preview", - "o1-preview-2024-09-12", "o1-mini", "o1-mini-2024-09-12", "gpt-4o-realtime-preview-2024-10-01", "gpt-4o-realtime-preview-2024-12-17", "gpt-4o-mini-realtime-preview-2024-12-17", + "gpt-realtime-2025-08-28", "gpt-4o-mini-2024-07-18", "gpt-4o-mini", "gpt-4o", diff --git a/src/vapi/types/open_ai_model_model.py b/src/vapi/types/open_ai_model_model.py index aab3168..bf7bbdc 100644 --- a/src/vapi/types/open_ai_model_model.py +++ b/src/vapi/types/open_ai_model_model.py @@ -4,24 +4,25 @@ OpenAiModelModel = typing.Union[ typing.Literal[ + "gpt-5", + "gpt-5-mini", + "gpt-5-nano", "gpt-4.1-2025-04-14", "gpt-4.1-mini-2025-04-14", "gpt-4.1-nano-2025-04-14", "gpt-4.1", "gpt-4.1-mini", "gpt-4.1-nano", - "gpt-4.5-preview", "chatgpt-4o-latest", "o3", "o3-mini", "o4-mini", - "o1-preview", - "o1-preview-2024-09-12", "o1-mini", "o1-mini-2024-09-12", "gpt-4o-realtime-preview-2024-10-01", "gpt-4o-realtime-preview-2024-12-17", "gpt-4o-mini-realtime-preview-2024-12-17", + "gpt-realtime-2025-08-28", "gpt-4o-mini-2024-07-18", "gpt-4o-mini", "gpt-4o", diff --git a/src/vapi/types/open_ai_model_tools_item.py b/src/vapi/types/open_ai_model_tools_item.py index 2d0c7de..ace8cc5 100644 --- a/src/vapi/types/open_ai_model_tools_item.py +++ b/src/vapi/types/open_ai_model_tools_item.py @@ -1,5 +1,7 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing from .create_api_request_tool_dto import CreateApiRequestToolDto @@ -22,6 +24,8 @@ from .create_text_editor_tool_dto import CreateTextEditorToolDto from .create_transfer_call_tool_dto import CreateTransferCallToolDto +if typing.TYPE_CHECKING: + from .create_handoff_tool_dto import CreateHandoffToolDto OpenAiModelToolsItem = typing.Union[ CreateApiRequestToolDto, CreateBashToolDto, @@ -36,6 +40,7 @@ CreateGoogleCalendarCheckAvailabilityToolDto, CreateGoogleCalendarCreateEventToolDto, CreateGoogleSheetsRowAppendToolDto, + "CreateHandoffToolDto", CreateMcpToolDto, CreateQueryToolDto, CreateSlackSendMessageToolDto, diff --git a/src/vapi/types/open_ai_voice_id_enum.py b/src/vapi/types/open_ai_voice_id_enum.py index 8cadbca..b9fb28b 100644 --- a/src/vapi/types/open_ai_voice_id_enum.py +++ b/src/vapi/types/open_ai_voice_id_enum.py @@ -2,4 +2,6 @@ import typing -OpenAiVoiceIdEnum = typing.Union[typing.Literal["alloy", "echo", "fable", "onyx", "nova", "shimmer"], typing.Any] +OpenAiVoiceIdEnum = typing.Union[ + typing.Literal["alloy", "echo", "fable", "onyx", "nova", "shimmer", "marin", "cedar"], typing.Any +] diff --git a/src/vapi/types/open_ai_voicemail_detection_plan.py b/src/vapi/types/open_ai_voicemail_detection_plan.py index 8d91d31..824695d 100644 --- a/src/vapi/types/open_ai_voicemail_detection_plan.py +++ b/src/vapi/types/open_ai_voicemail_detection_plan.py @@ -7,6 +7,7 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel +from .open_ai_voicemail_detection_plan_type import OpenAiVoicemailDetectionPlanType from .voicemail_detection_backoff_plan import VoicemailDetectionBackoffPlan @@ -38,6 +39,14 @@ class OpenAiVoicemailDetectionPlan(UncheckedBaseModel): This is the backoff plan for the voicemail detection. """ + type: typing.Optional[OpenAiVoicemailDetectionPlanType] = pydantic.Field(default=None) + """ + This is the detection type to use for voicemail detection. + - 'audio': Uses native audio models (default) + - 'transcript': Uses ASR/transcript-based detection + @default 'audio' (audio detection) + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/vapi/types/open_ai_voicemail_detection_plan_type.py b/src/vapi/types/open_ai_voicemail_detection_plan_type.py new file mode 100644 index 0000000..e472c89 --- /dev/null +++ b/src/vapi/types/open_ai_voicemail_detection_plan_type.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +OpenAiVoicemailDetectionPlanType = typing.Union[typing.Literal["audio", "transcript"], typing.Any] diff --git a/src/vapi/types/open_router_model.py b/src/vapi/types/open_router_model.py index cd34fdc..718ca6f 100644 --- a/src/vapi/types/open_router_model.py +++ b/src/vapi/types/open_router_model.py @@ -1,15 +1,16 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .create_custom_knowledge_base_dto import CreateCustomKnowledgeBaseDto from .open_ai_message import OpenAiMessage -from .open_router_model_tools_item import OpenRouterModelToolsItem class OpenRouterModel(UncheckedBaseModel): @@ -18,7 +19,7 @@ class OpenRouterModel(UncheckedBaseModel): This is the starting state for the conversation. """ - tools: typing.Optional[typing.List[OpenRouterModelToolsItem]] = pydantic.Field(default=None) + tools: typing.Optional[typing.List["OpenRouterModelToolsItem"]] = pydantic.Field(default=None) """ These are the tools that the assistant can use during the call. To use existing tools, use `toolIds`. @@ -41,13 +42,6 @@ class OpenRouterModel(UncheckedBaseModel): These are the options for the knowledge base. """ - knowledge_base_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="knowledgeBaseId")] = ( - pydantic.Field(default=None) - ) - """ - This is the ID of the knowledge base the model will use. - """ - provider: typing.Literal["openrouter"] = "openrouter" model: str = pydantic.Field() """ @@ -96,3 +90,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 +from .open_router_model_tools_item import OpenRouterModelToolsItem # noqa: E402, F401, I001 + +update_forward_refs(OpenRouterModel) diff --git a/src/vapi/types/open_router_model_tools_item.py b/src/vapi/types/open_router_model_tools_item.py index e373732..3789823 100644 --- a/src/vapi/types/open_router_model_tools_item.py +++ b/src/vapi/types/open_router_model_tools_item.py @@ -1,5 +1,7 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing from .create_api_request_tool_dto import CreateApiRequestToolDto @@ -22,6 +24,8 @@ from .create_text_editor_tool_dto import CreateTextEditorToolDto from .create_transfer_call_tool_dto import CreateTransferCallToolDto +if typing.TYPE_CHECKING: + from .create_handoff_tool_dto import CreateHandoffToolDto OpenRouterModelToolsItem = typing.Union[ CreateApiRequestToolDto, CreateBashToolDto, @@ -36,6 +40,7 @@ CreateGoogleCalendarCheckAvailabilityToolDto, CreateGoogleCalendarCreateEventToolDto, CreateGoogleSheetsRowAppendToolDto, + "CreateHandoffToolDto", CreateMcpToolDto, CreateQueryToolDto, CreateSlackSendMessageToolDto, diff --git a/src/vapi/types/org.py b/src/vapi/types/org.py index 97313d2..82372a9 100644 --- a/src/vapi/types/org.py +++ b/src/vapi/types/org.py @@ -10,7 +10,6 @@ from ..core.unchecked_base_model import UncheckedBaseModel from .compliance_plan import CompliancePlan from .org_channel import OrgChannel -from .org_plan import OrgPlan from .server import Server from .subscription import Subscription @@ -48,13 +47,6 @@ class Org(UncheckedBaseModel): This is the ISO 8601 date-time string of when the org was last updated. """ - stripe_customer_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="stripeCustomerId")] = ( - pydantic.Field(default=None) - ) - """ - This is the Stripe customer for the org. - """ - stripe_subscription_id: typing_extensions.Annotated[ typing.Optional[str], FieldMetadata(alias="stripeSubscriptionId") ] = pydantic.Field(default=None) @@ -83,11 +75,6 @@ class Org(UncheckedBaseModel): This is the subscription's status. """ - plan: typing.Optional[OrgPlan] = pydantic.Field(default=None) - """ - This is the plan for the org. - """ - jwt_secret: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="jwtSecret")] = pydantic.Field( default=None ) diff --git a/src/vapi/types/output_tool.py b/src/vapi/types/output_tool.py index 1d247df..3265758 100644 --- a/src/vapi/types/output_tool.py +++ b/src/vapi/types/output_tool.py @@ -1,15 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import datetime as dt import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel -from .open_ai_function import OpenAiFunction from .output_tool_messages_item import OutputToolMessagesItem +from .tool_rejection_plan import ToolRejectionPlan class OutputTool(UncheckedBaseModel): @@ -20,7 +22,11 @@ class OutputTool(UncheckedBaseModel): For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. """ - type: typing.Literal["output"] = "output" + type: typing.Literal["output"] = pydantic.Field(default="output") + """ + The type of tool. "output" for Output tool. + """ + id: str = pydantic.Field() """ This is the unique identifier for the tool. @@ -41,13 +47,88 @@ class OutputTool(UncheckedBaseModel): This is the ISO 8601 date-time string of when the tool was last updated. """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` + + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -58,3 +139,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(OutputTool) diff --git a/src/vapi/types/pagination_meta.py b/src/vapi/types/pagination_meta.py index 5f53e1a..f4e28c2 100644 --- a/src/vapi/types/pagination_meta.py +++ b/src/vapi/types/pagination_meta.py @@ -13,6 +13,9 @@ class PaginationMeta(UncheckedBaseModel): items_per_page: typing_extensions.Annotated[float, FieldMetadata(alias="itemsPerPage")] total_items: typing_extensions.Annotated[float, FieldMetadata(alias="totalItems")] current_page: typing_extensions.Annotated[float, FieldMetadata(alias="currentPage")] + items_beyond_retention: typing_extensions.Annotated[ + typing.Optional[bool], FieldMetadata(alias="itemsBeyondRetention") + ] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/vapi/types/performance_metrics.py b/src/vapi/types/performance_metrics.py new file mode 100644 index 0000000..fa7d98e --- /dev/null +++ b/src/vapi/types/performance_metrics.py @@ -0,0 +1,63 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel +from .turn_latency import TurnLatency + + +class PerformanceMetrics(UncheckedBaseModel): + turn_latencies: typing_extensions.Annotated[ + typing.Optional[typing.List[TurnLatency]], FieldMetadata(alias="turnLatencies") + ] = pydantic.Field(default=None) + """ + These are the individual latencies for each turn. + """ + + model_latency_average: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="modelLatencyAverage") + ] = pydantic.Field(default=None) + """ + This is the average latency for the model to output the first token. + """ + + voice_latency_average: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="voiceLatencyAverage") + ] = pydantic.Field(default=None) + """ + This is the average latency for the text to speech. + """ + + transcriber_latency_average: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="transcriberLatencyAverage") + ] = pydantic.Field(default=None) + """ + This is the average latency for the transcriber. + """ + + endpointing_latency_average: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="endpointingLatencyAverage") + ] = pydantic.Field(default=None) + """ + This is the average latency for the endpointing. + """ + + turn_latency_average: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="turnLatencyAverage") + ] = pydantic.Field(default=None) + """ + This is the average latency for complete turns. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/perplexity_ai_model.py b/src/vapi/types/perplexity_ai_model.py index bb505c0..3946801 100644 --- a/src/vapi/types/perplexity_ai_model.py +++ b/src/vapi/types/perplexity_ai_model.py @@ -1,15 +1,16 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .create_custom_knowledge_base_dto import CreateCustomKnowledgeBaseDto from .open_ai_message import OpenAiMessage -from .perplexity_ai_model_tools_item import PerplexityAiModelToolsItem class PerplexityAiModel(UncheckedBaseModel): @@ -18,7 +19,7 @@ class PerplexityAiModel(UncheckedBaseModel): This is the starting state for the conversation. """ - tools: typing.Optional[typing.List[PerplexityAiModelToolsItem]] = pydantic.Field(default=None) + tools: typing.Optional[typing.List["PerplexityAiModelToolsItem"]] = pydantic.Field(default=None) """ These are the tools that the assistant can use during the call. To use existing tools, use `toolIds`. @@ -41,13 +42,6 @@ class PerplexityAiModel(UncheckedBaseModel): These are the options for the knowledge base. """ - knowledge_base_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="knowledgeBaseId")] = ( - pydantic.Field(default=None) - ) - """ - This is the ID of the knowledge base the model will use. - """ - provider: typing.Literal["perplexity-ai"] = "perplexity-ai" model: str = pydantic.Field() """ @@ -96,3 +90,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 +from .perplexity_ai_model_tools_item import PerplexityAiModelToolsItem # noqa: E402, F401, I001 + +update_forward_refs(PerplexityAiModel) diff --git a/src/vapi/types/perplexity_ai_model_tools_item.py b/src/vapi/types/perplexity_ai_model_tools_item.py index 6f9a25b..0dcbaa5 100644 --- a/src/vapi/types/perplexity_ai_model_tools_item.py +++ b/src/vapi/types/perplexity_ai_model_tools_item.py @@ -1,5 +1,7 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing from .create_api_request_tool_dto import CreateApiRequestToolDto @@ -22,6 +24,8 @@ from .create_text_editor_tool_dto import CreateTextEditorToolDto from .create_transfer_call_tool_dto import CreateTransferCallToolDto +if typing.TYPE_CHECKING: + from .create_handoff_tool_dto import CreateHandoffToolDto PerplexityAiModelToolsItem = typing.Union[ CreateApiRequestToolDto, CreateBashToolDto, @@ -36,6 +40,7 @@ CreateGoogleCalendarCheckAvailabilityToolDto, CreateGoogleCalendarCreateEventToolDto, CreateGoogleSheetsRowAppendToolDto, + "CreateHandoffToolDto", CreateMcpToolDto, CreateQueryToolDto, CreateSlackSendMessageToolDto, diff --git a/src/vapi/types/phone_number_call_ending_hook_filter.py b/src/vapi/types/phone_number_call_ending_hook_filter.py new file mode 100644 index 0000000..6b214a0 --- /dev/null +++ b/src/vapi/types/phone_number_call_ending_hook_filter.py @@ -0,0 +1,38 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel +from .phone_number_call_ending_hook_filter_one_of_item import PhoneNumberCallEndingHookFilterOneOfItem + + +class PhoneNumberCallEndingHookFilter(UncheckedBaseModel): + type: typing.Literal["oneOf"] = pydantic.Field(default="oneOf") + """ + This is the type of filter - currently only "oneOf" is supported + """ + + key: typing.Literal["call.endedReason"] = pydantic.Field(default="call.endedReason") + """ + This is the key to filter on - only "call.endedReason" is allowed for phone number call ending hooks + """ + + one_of: typing_extensions.Annotated[ + typing.List[PhoneNumberCallEndingHookFilterOneOfItem], FieldMetadata(alias="oneOf") + ] = pydantic.Field() + """ + This is the array of assistant-request related ended reasons to match against + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/phone_number_call_ending_hook_filter_one_of_item.py b/src/vapi/types/phone_number_call_ending_hook_filter_one_of_item.py new file mode 100644 index 0000000..e831c0d --- /dev/null +++ b/src/vapi/types/phone_number_call_ending_hook_filter_one_of_item.py @@ -0,0 +1,15 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +PhoneNumberCallEndingHookFilterOneOfItem = typing.Union[ + typing.Literal[ + "assistant-request-failed", + "assistant-request-returned-error", + "assistant-request-returned-unspeakable-error", + "assistant-request-returned-invalid-assistant", + "assistant-request-returned-no-assistant", + "assistant-request-returned-forwarding-phone-number", + ], + typing.Any, +] diff --git a/src/vapi/types/phone_number_hook_call_ending.py b/src/vapi/types/phone_number_hook_call_ending.py new file mode 100644 index 0000000..bc162eb --- /dev/null +++ b/src/vapi/types/phone_number_hook_call_ending.py @@ -0,0 +1,35 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.unchecked_base_model import UncheckedBaseModel +from .phone_number_call_ending_hook_filter import PhoneNumberCallEndingHookFilter +from .phone_number_hook_call_ending_do import PhoneNumberHookCallEndingDo + + +class PhoneNumberHookCallEnding(UncheckedBaseModel): + on: typing.Literal["call.ending"] = pydantic.Field(default="call.ending") + """ + This is the event to trigger the hook on + """ + + filters: typing.Optional[typing.List[PhoneNumberCallEndingHookFilter]] = pydantic.Field(default=None) + """ + Optional filters to decide when to trigger - restricted to assistant-request related ended reasons + """ + + do: typing.Optional[PhoneNumberHookCallEndingDo] = pydantic.Field(default=None) + """ + This is the action to perform when the hook triggers + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/phone_number_hook_call_ending_do.py b/src/vapi/types/phone_number_hook_call_ending_do.py new file mode 100644 index 0000000..0d75366 --- /dev/null +++ b/src/vapi/types/phone_number_hook_call_ending_do.py @@ -0,0 +1,8 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .say_phone_number_hook_action import SayPhoneNumberHookAction +from .transfer_phone_number_hook_action import TransferPhoneNumberHookAction + +PhoneNumberHookCallEndingDo = typing.Union[TransferPhoneNumberHookAction, SayPhoneNumberHookAction] diff --git a/src/vapi/types/phone_number_hook_call_ringing.py b/src/vapi/types/phone_number_hook_call_ringing.py index 6a646cc..30e0551 100644 --- a/src/vapi/types/phone_number_hook_call_ringing.py +++ b/src/vapi/types/phone_number_hook_call_ringing.py @@ -16,7 +16,7 @@ class PhoneNumberHookCallRinging(UncheckedBaseModel): do: typing.List[PhoneNumberHookCallRingingDoItem] = pydantic.Field() """ - This is the set of actions to perform when the hook triggers + Only the first action will be executed. Additional actions will be ignored. """ if IS_PYDANTIC_V2: diff --git a/src/vapi/types/prompt_injection_security_filter.py b/src/vapi/types/prompt_injection_security_filter.py new file mode 100644 index 0000000..13d796f --- /dev/null +++ b/src/vapi/types/prompt_injection_security_filter.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.unchecked_base_model import UncheckedBaseModel + + +class PromptInjectionSecurityFilter(UncheckedBaseModel): + type: typing.Literal["prompt-injection"] = pydantic.Field(default="prompt-injection") + """ + The type of security threat to filter. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/provider_resource.py b/src/vapi/types/provider_resource.py new file mode 100644 index 0000000..aee5c6f --- /dev/null +++ b/src/vapi/types/provider_resource.py @@ -0,0 +1,64 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel +from .eleven_labs_pronunciation_dictionary import ElevenLabsPronunciationDictionary + + +class ProviderResource(UncheckedBaseModel): + id: str = pydantic.Field() + """ + This is the unique identifier for the provider resource. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the org that this provider resource belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the provider resource was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the provider resource was last updated. + """ + + provider: typing.Literal["11labs"] = pydantic.Field(default="11labs") + """ + This is the provider that manages this resource. + """ + + resource_name: typing_extensions.Annotated[ + typing.Literal["pronunciation-dictionary"], FieldMetadata(alias="resourceName") + ] = pydantic.Field(default="pronunciation-dictionary") + """ + This is the name/type of the resource. + """ + + resource_id: typing_extensions.Annotated[str, FieldMetadata(alias="resourceId")] = pydantic.Field() + """ + This is the provider-specific identifier for the resource. + """ + + resource: ElevenLabsPronunciationDictionary = pydantic.Field() + """ + This is the full resource data from the provider's API. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/call_logs_paginated_response.py b/src/vapi/types/provider_resource_paginated_response.py similarity index 79% rename from src/vapi/types/call_logs_paginated_response.py rename to src/vapi/types/provider_resource_paginated_response.py index e31a63b..93965a0 100644 --- a/src/vapi/types/call_logs_paginated_response.py +++ b/src/vapi/types/provider_resource_paginated_response.py @@ -5,12 +5,12 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel -from .call_log_privileged import CallLogPrivileged from .pagination_meta import PaginationMeta +from .provider_resource import ProviderResource -class CallLogsPaginatedResponse(UncheckedBaseModel): - results: typing.List[CallLogPrivileged] +class ProviderResourcePaginatedResponse(UncheckedBaseModel): + results: typing.List[ProviderResource] metadata: PaginationMeta if IS_PYDANTIC_V2: diff --git a/src/vapi/types/query_tool.py b/src/vapi/types/query_tool.py index b0c0a2b..bda4283 100644 --- a/src/vapi/types/query_tool.py +++ b/src/vapi/types/query_tool.py @@ -1,16 +1,18 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import datetime as dt import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .knowledge_base import KnowledgeBase -from .open_ai_function import OpenAiFunction from .query_tool_messages_item import QueryToolMessagesItem +from .tool_rejection_plan import ToolRejectionPlan class QueryTool(UncheckedBaseModel): @@ -49,13 +51,88 @@ class QueryTool(UncheckedBaseModel): This is the ISO 8601 date-time string of when the tool was last updated. """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -66,3 +143,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(QueryTool) diff --git a/src/vapi/types/rce_security_filter.py b/src/vapi/types/rce_security_filter.py new file mode 100644 index 0000000..0820691 --- /dev/null +++ b/src/vapi/types/rce_security_filter.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.unchecked_base_model import UncheckedBaseModel + + +class RceSecurityFilter(UncheckedBaseModel): + type: typing.Literal["rce"] = pydantic.Field(default="rce") + """ + The type of security threat to filter. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/regex_condition.py b/src/vapi/types/regex_condition.py new file mode 100644 index 0000000..d5c6cf6 --- /dev/null +++ b/src/vapi/types/regex_condition.py @@ -0,0 +1,54 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.unchecked_base_model import UncheckedBaseModel +from .message_target import MessageTarget + + +class RegexCondition(UncheckedBaseModel): + type: typing.Literal["regex"] = pydantic.Field(default="regex") + """ + This is the type discriminator for regex condition + """ + + regex: str = pydantic.Field() + """ + This is the regular expression pattern to match against message content. + + Note: + - This works by using the RegExp.test method in Node.JS. Eg. /hello/.test("hello there") will return true. + + Hot tips: + - In JavaScript, escape \ when sending the regex pattern. Eg. "hello\sthere" will be sent over the wire as "hellosthere". Send "hello\\sthere" instead. + - RegExp.test does substring matching, so /cat/.test("I love cats") will return true. To do full string matching, use anchors: /^cat$/ will only match exactly "cat". + - Word boundaries \b are useful for matching whole words: /\bcat\b/ matches "cat" but not "cats" or "category". + - Use inline flags for portability: (?i) for case insensitive, (?m) for multiline + """ + + target: typing.Optional[MessageTarget] = pydantic.Field(default=None) + """ + This is the target for messages to check against. + If not specified, the condition will run on the last message (position: -1). + If role is not specified, it will look at the last message regardless of role. + @default { position: -1 } + """ + + negate: typing.Optional[bool] = pydantic.Field(default=None) + """ + This is the flag that when true, the condition matches if the pattern does NOT match. + Useful for ensuring certain words/phrases are absent. + + @default false + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/regex_security_filter.py b/src/vapi/types/regex_security_filter.py new file mode 100644 index 0000000..064acc5 --- /dev/null +++ b/src/vapi/types/regex_security_filter.py @@ -0,0 +1,28 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.unchecked_base_model import UncheckedBaseModel + + +class RegexSecurityFilter(UncheckedBaseModel): + type: typing.Literal["regex"] = pydantic.Field(default="regex") + """ + The type of security threat to filter. + """ + + regex: str = pydantic.Field() + """ + The regex pattern to filter. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/rime_ai_voice.py b/src/vapi/types/rime_ai_voice.py index 5b817a9..0bd9952 100644 --- a/src/vapi/types/rime_ai_voice.py +++ b/src/vapi/types/rime_ai_voice.py @@ -33,7 +33,7 @@ class RimeAiVoice(UncheckedBaseModel): model: typing.Optional[RimeAiVoiceModel] = pydantic.Field(default=None) """ - This is the model that will be used. Defaults to 'mistv2' when not specified. + This is the model that will be used. Defaults to 'arcana' when not specified. """ speed: typing.Optional[float] = pydantic.Field(default=None) diff --git a/src/vapi/types/rime_ai_voice_model.py b/src/vapi/types/rime_ai_voice_model.py index 5d288d2..a1225fb 100644 --- a/src/vapi/types/rime_ai_voice_model.py +++ b/src/vapi/types/rime_ai_voice_model.py @@ -2,4 +2,4 @@ import typing -RimeAiVoiceModel = typing.Union[typing.Literal["mist", "mistv2", "arcana"], typing.Any] +RimeAiVoiceModel = typing.Union[typing.Literal["arcana", "mistv2", "mist"], typing.Any] diff --git a/src/vapi/types/say_assistant_hook_action.py b/src/vapi/types/say_assistant_hook_action.py index ee29e9f..cc5b12f 100644 --- a/src/vapi/types/say_assistant_hook_action.py +++ b/src/vapi/types/say_assistant_hook_action.py @@ -2,27 +2,4 @@ import typing -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel - - -class SayAssistantHookAction(UncheckedBaseModel): - type: typing.Literal["say"] = pydantic.Field(default="say") - """ - This is the type of action - must be "say" - """ - - exact: typing.Dict[str, typing.Optional[typing.Any]] = pydantic.Field() - """ - This is the message to say - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow +SayAssistantHookAction = typing.Optional[typing.Any] diff --git a/src/vapi/types/say_hook_action.py b/src/vapi/types/say_hook_action.py new file mode 100644 index 0000000..271aa6e --- /dev/null +++ b/src/vapi/types/say_hook_action.py @@ -0,0 +1,35 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.unchecked_base_model import UncheckedBaseModel +from .say_hook_action_prompt import SayHookActionPrompt + + +class SayHookAction(UncheckedBaseModel): + type: typing.Literal["say"] = pydantic.Field(default="say") + """ + This is the type of action - must be "say" + """ + + prompt: typing.Optional[SayHookActionPrompt] = pydantic.Field(default=None) + """ + This is the prompt for the assistant to generate a response based on existing conversation. + Can be a string or an array of chat messages. + """ + + exact: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None) + """ + This is the message to say + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/say_hook_action_prompt.py b/src/vapi/types/say_hook_action_prompt.py new file mode 100644 index 0000000..e2c8f07 --- /dev/null +++ b/src/vapi/types/say_hook_action_prompt.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .say_hook_action_prompt_item import SayHookActionPromptItem + +SayHookActionPrompt = typing.Union[str, typing.List[SayHookActionPromptItem]] diff --git a/src/vapi/types/say_hook_action_prompt_item.py b/src/vapi/types/say_hook_action_prompt_item.py new file mode 100644 index 0000000..d3841ad --- /dev/null +++ b/src/vapi/types/say_hook_action_prompt_item.py @@ -0,0 +1,11 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .assistant_message import AssistantMessage +from .developer_message import DeveloperMessage +from .system_message import SystemMessage +from .tool_message import ToolMessage +from .user_message import UserMessage + +SayHookActionPromptItem = typing.Union[SystemMessage, UserMessage, AssistantMessage, ToolMessage, DeveloperMessage] diff --git a/src/vapi/types/error.py b/src/vapi/types/security_filter_base.py similarity index 90% rename from src/vapi/types/error.py rename to src/vapi/types/security_filter_base.py index ef51e8e..08d4b5d 100644 --- a/src/vapi/types/error.py +++ b/src/vapi/types/security_filter_base.py @@ -7,9 +7,7 @@ from ..core.unchecked_base_model import UncheckedBaseModel -class Error(UncheckedBaseModel): - message: str - +class SecurityFilterBase(UncheckedBaseModel): if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/vapi/types/security_filter_plan.py b/src/vapi/types/security_filter_plan.py new file mode 100644 index 0000000..ad2899c --- /dev/null +++ b/src/vapi/types/security_filter_plan.py @@ -0,0 +1,51 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel +from .security_filter_base import SecurityFilterBase +from .security_filter_plan_mode import SecurityFilterPlanMode + + +class SecurityFilterPlan(UncheckedBaseModel): + enabled: typing.Optional[bool] = pydantic.Field(default=None) + """ + Whether the security filter is enabled. + @default false + """ + + filters: typing.Optional[typing.List[SecurityFilterBase]] = pydantic.Field(default=None) + """ + Array of security filter types to apply. + If array is not empty, only those security filters are run. + """ + + mode: typing.Optional[SecurityFilterPlanMode] = pydantic.Field(default=None) + """ + Mode of operation when a security threat is detected. + - 'sanitize': Remove or replace the threatening content + - 'reject': Replace the entire transcript with replacement text + - 'replace': Replace threatening patterns with replacement text + @default 'sanitize' + """ + + replacement_text: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="replacementText")] = ( + pydantic.Field(default=None) + ) + """ + Text to use when replacing filtered content. + @default '[FILTERED]' + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/security_filter_plan_mode.py b/src/vapi/types/security_filter_plan_mode.py new file mode 100644 index 0000000..0516801 --- /dev/null +++ b/src/vapi/types/security_filter_plan_mode.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SecurityFilterPlanMode = typing.Union[typing.Literal["sanitize", "reject", "replace"], typing.Any] diff --git a/src/vapi/types/server.py b/src/vapi/types/server.py index f37ab9f..8b2096e 100644 --- a/src/vapi/types/server.py +++ b/src/vapi/types/server.py @@ -20,6 +20,13 @@ class Server(UncheckedBaseModel): @default 20 """ + credential_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="credentialId")] = ( + pydantic.Field(default=None) + ) + """ + The credential ID for server authentication + """ + url: typing.Optional[str] = pydantic.Field(default=None) """ This is where the request will be sent. diff --git a/src/vapi/types/server_message.py b/src/vapi/types/server_message.py index fc9ae5c..7bb2689 100644 --- a/src/vapi/types/server_message.py +++ b/src/vapi/types/server_message.py @@ -1,9 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .server_message_message import ServerMessageMessage @@ -29,3 +31,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ServerMessage) diff --git a/src/vapi/types/server_message_assistant_request.py b/src/vapi/types/server_message_assistant_request.py index d97cc66..4f1e751 100644 --- a/src/vapi/types/server_message_assistant_request.py +++ b/src/vapi/types/server_message_assistant_request.py @@ -1,16 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .artifact import Artifact from .call import Call from .chat import Chat -from .create_assistant_dto import CreateAssistantDto from .create_customer_dto import CreateCustomerDto from .server_message_assistant_request_phone_number import ServerMessageAssistantRequestPhoneNumber @@ -40,7 +41,7 @@ class ServerMessageAssistantRequest(UncheckedBaseModel): This matches what is stored on `call.artifact` after the call. """ - assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) """ This is the assistant that the message is associated with. """ @@ -68,3 +69,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ServerMessageAssistantRequest) diff --git a/src/vapi/types/server_message_call_endpointing_request.py b/src/vapi/types/server_message_call_endpointing_request.py index 842d8d0..b4df5cb 100644 --- a/src/vapi/types/server_message_call_endpointing_request.py +++ b/src/vapi/types/server_message_call_endpointing_request.py @@ -1,16 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .artifact import Artifact from .call import Call from .chat import Chat -from .create_assistant_dto import CreateAssistantDto from .create_customer_dto import CreateCustomerDto from .open_ai_message import OpenAiMessage from .server_message_call_endpointing_request_messages_item import ServerMessageCallEndpointingRequestMessagesItem @@ -81,7 +82,7 @@ class ServerMessageCallEndpointingRequest(UncheckedBaseModel): This matches what is stored on `call.artifact` after the call. """ - assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) """ This is the assistant that the message is associated with. """ @@ -109,3 +110,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ServerMessageCallEndpointingRequest) diff --git a/src/vapi/types/server_message_chat_created.py b/src/vapi/types/server_message_chat_created.py new file mode 100644 index 0000000..2dd3aba --- /dev/null +++ b/src/vapi/types/server_message_chat_created.py @@ -0,0 +1,98 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel +from .artifact import Artifact +from .call import Call +from .chat import Chat +from .create_customer_dto import CreateCustomerDto +from .server_message_chat_created_phone_number import ServerMessageChatCreatedPhoneNumber + + +class ServerMessageChatCreated(UncheckedBaseModel): + phone_number: typing_extensions.Annotated[ + typing.Optional[ServerMessageChatCreatedPhoneNumber], FieldMetadata(alias="phoneNumber") + ] = pydantic.Field(default=None) + """ + This is the phone number that the message is associated with. + """ + + type: typing.Literal["chat.created"] = pydantic.Field(default="chat.created") + """ + This is the type of the message. "chat.created" is sent when a new chat is created. + """ + + timestamp: typing.Optional[float] = pydantic.Field(default=None) + """ + This is the timestamp of the message. + """ + + artifact: typing.Optional[Artifact] = pydantic.Field(default=None) + """ + This is a live version of the `call.artifact`. + + This matches what is stored on `call.artifact` after the call. + """ + + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) + """ + This is the assistant that the message is associated with. + """ + + customer: typing.Optional[CreateCustomerDto] = pydantic.Field(default=None) + """ + This is the customer that the message is associated with. + """ + + call: typing.Optional[Call] = pydantic.Field(default=None) + """ + This is the call that the message is associated with. + """ + + chat: Chat = pydantic.Field() + """ + This is the chat that was created. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ServerMessageChatCreated) diff --git a/src/vapi/types/server_message_chat_created_phone_number.py b/src/vapi/types/server_message_chat_created_phone_number.py new file mode 100644 index 0000000..8c82943 --- /dev/null +++ b/src/vapi/types/server_message_chat_created_phone_number.py @@ -0,0 +1,17 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .create_byo_phone_number_dto import CreateByoPhoneNumberDto +from .create_telnyx_phone_number_dto import CreateTelnyxPhoneNumberDto +from .create_twilio_phone_number_dto import CreateTwilioPhoneNumberDto +from .create_vapi_phone_number_dto import CreateVapiPhoneNumberDto +from .create_vonage_phone_number_dto import CreateVonagePhoneNumberDto + +ServerMessageChatCreatedPhoneNumber = typing.Union[ + CreateByoPhoneNumberDto, + CreateTwilioPhoneNumberDto, + CreateVonagePhoneNumberDto, + CreateVapiPhoneNumberDto, + CreateTelnyxPhoneNumberDto, +] diff --git a/src/vapi/types/server_message_chat_deleted.py b/src/vapi/types/server_message_chat_deleted.py new file mode 100644 index 0000000..cbaa6e3 --- /dev/null +++ b/src/vapi/types/server_message_chat_deleted.py @@ -0,0 +1,98 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel +from .artifact import Artifact +from .call import Call +from .chat import Chat +from .create_customer_dto import CreateCustomerDto +from .server_message_chat_deleted_phone_number import ServerMessageChatDeletedPhoneNumber + + +class ServerMessageChatDeleted(UncheckedBaseModel): + phone_number: typing_extensions.Annotated[ + typing.Optional[ServerMessageChatDeletedPhoneNumber], FieldMetadata(alias="phoneNumber") + ] = pydantic.Field(default=None) + """ + This is the phone number that the message is associated with. + """ + + type: typing.Literal["chat.deleted"] = pydantic.Field(default="chat.deleted") + """ + This is the type of the message. "chat.deleted" is sent when a chat is deleted. + """ + + timestamp: typing.Optional[float] = pydantic.Field(default=None) + """ + This is the timestamp of the message. + """ + + artifact: typing.Optional[Artifact] = pydantic.Field(default=None) + """ + This is a live version of the `call.artifact`. + + This matches what is stored on `call.artifact` after the call. + """ + + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) + """ + This is the assistant that the message is associated with. + """ + + customer: typing.Optional[CreateCustomerDto] = pydantic.Field(default=None) + """ + This is the customer that the message is associated with. + """ + + call: typing.Optional[Call] = pydantic.Field(default=None) + """ + This is the call that the message is associated with. + """ + + chat: Chat = pydantic.Field() + """ + This is the chat that was deleted. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ServerMessageChatDeleted) diff --git a/src/vapi/types/server_message_chat_deleted_phone_number.py b/src/vapi/types/server_message_chat_deleted_phone_number.py new file mode 100644 index 0000000..a56457e --- /dev/null +++ b/src/vapi/types/server_message_chat_deleted_phone_number.py @@ -0,0 +1,17 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .create_byo_phone_number_dto import CreateByoPhoneNumberDto +from .create_telnyx_phone_number_dto import CreateTelnyxPhoneNumberDto +from .create_twilio_phone_number_dto import CreateTwilioPhoneNumberDto +from .create_vapi_phone_number_dto import CreateVapiPhoneNumberDto +from .create_vonage_phone_number_dto import CreateVonagePhoneNumberDto + +ServerMessageChatDeletedPhoneNumber = typing.Union[ + CreateByoPhoneNumberDto, + CreateTwilioPhoneNumberDto, + CreateVonagePhoneNumberDto, + CreateVapiPhoneNumberDto, + CreateTelnyxPhoneNumberDto, +] diff --git a/src/vapi/types/server_message_conversation_update.py b/src/vapi/types/server_message_conversation_update.py index 5e5aa8c..4d50398 100644 --- a/src/vapi/types/server_message_conversation_update.py +++ b/src/vapi/types/server_message_conversation_update.py @@ -1,16 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .artifact import Artifact from .call import Call from .chat import Chat -from .create_assistant_dto import CreateAssistantDto from .create_customer_dto import CreateCustomerDto from .open_ai_message import OpenAiMessage from .server_message_conversation_update_messages_item import ServerMessageConversationUpdateMessagesItem @@ -54,7 +55,7 @@ class ServerMessageConversationUpdate(UncheckedBaseModel): This matches what is stored on `call.artifact` after the call. """ - assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) """ This is the assistant that the message is associated with. """ @@ -82,3 +83,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ServerMessageConversationUpdate) diff --git a/src/vapi/types/server_message_end_of_call_report.py b/src/vapi/types/server_message_end_of_call_report.py index fb80e64..cd046a9 100644 --- a/src/vapi/types/server_message_end_of_call_report.py +++ b/src/vapi/types/server_message_end_of_call_report.py @@ -1,18 +1,19 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import datetime as dt import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .analysis import Analysis from .artifact import Artifact from .call import Call from .chat import Chat -from .create_assistant_dto import CreateAssistantDto from .create_customer_dto import CreateCustomerDto from .server_message_end_of_call_report_costs_item import ServerMessageEndOfCallReportCostsItem from .server_message_end_of_call_report_ended_reason import ServerMessageEndOfCallReportEndedReason @@ -59,7 +60,7 @@ class ServerMessageEndOfCallReport(UncheckedBaseModel): These are the artifacts from the call. This can also be found at `call.artifact` on GET /call/:id. """ - assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) """ This is the assistant that the message is associated with. """ @@ -106,3 +107,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ServerMessageEndOfCallReport) diff --git a/src/vapi/types/server_message_end_of_call_report_ended_reason.py b/src/vapi/types/server_message_end_of_call_report_ended_reason.py index ae823fd..a3fdf3c 100644 --- a/src/vapi/types/server_message_end_of_call_report_ended_reason.py +++ b/src/vapi/types/server_message_end_of_call_report_ended_reason.py @@ -42,6 +42,7 @@ "pipeline-error-hume-voice-failed", "pipeline-error-sesame-voice-failed", "pipeline-error-inworld-voice-failed", + "pipeline-error-minimax-voice-failed", "pipeline-error-tavus-video-failed", "call.in-progress.error-vapifault-openai-voice-failed", "call.in-progress.error-vapifault-cartesia-voice-failed", @@ -56,6 +57,7 @@ "call.in-progress.error-vapifault-hume-voice-failed", "call.in-progress.error-vapifault-sesame-voice-failed", "call.in-progress.error-vapifault-inworld-voice-failed", + "call.in-progress.error-vapifault-minimax-voice-failed", "call.in-progress.error-vapifault-tavus-video-failed", "pipeline-error-vapi-llm-failed", "pipeline-error-vapi-400-bad-request-validation-failed", @@ -64,7 +66,7 @@ "pipeline-error-vapi-429-exceeded-quota", "pipeline-error-vapi-500-server-error", "pipeline-error-vapi-503-server-overloaded-error", - "call.in-progress.error-vapifault-vapi-llm-failed", + "call.in-progress.error-providerfault-vapi-llm-failed", "call.in-progress.error-vapifault-vapi-400-bad-request-validation-failed", "call.in-progress.error-vapifault-vapi-401-unauthorized", "call.in-progress.error-vapifault-vapi-403-model-access-denied", @@ -107,15 +109,15 @@ "call.in-progress.error-vapifault-worker-died", "call.in-progress.twilio-completed-call", "call.in-progress.sip-completed-call", - "call.in-progress.error-vapifault-openai-llm-failed", - "call.in-progress.error-vapifault-azure-openai-llm-failed", - "call.in-progress.error-vapifault-groq-llm-failed", - "call.in-progress.error-vapifault-google-llm-failed", - "call.in-progress.error-vapifault-xai-llm-failed", - "call.in-progress.error-vapifault-mistral-llm-failed", - "call.in-progress.error-vapifault-inflection-ai-llm-failed", - "call.in-progress.error-vapifault-cerebras-llm-failed", - "call.in-progress.error-vapifault-deep-seek-llm-failed", + "call.in-progress.error-providerfault-openai-llm-failed", + "call.in-progress.error-providerfault-azure-openai-llm-failed", + "call.in-progress.error-providerfault-groq-llm-failed", + "call.in-progress.error-providerfault-google-llm-failed", + "call.in-progress.error-providerfault-xai-llm-failed", + "call.in-progress.error-providerfault-mistral-llm-failed", + "call.in-progress.error-providerfault-inflection-ai-llm-failed", + "call.in-progress.error-providerfault-cerebras-llm-failed", + "call.in-progress.error-providerfault-deep-seek-llm-failed", "call.in-progress.error-vapifault-chat-pipeline-failed-to-start", "pipeline-error-openai-400-bad-request-validation-failed", "pipeline-error-openai-401-unauthorized", @@ -247,7 +249,7 @@ "pipeline-error-anthropic-500-server-error", "pipeline-error-anthropic-503-server-overloaded-error", "pipeline-error-anthropic-llm-failed", - "call.in-progress.error-vapifault-anthropic-llm-failed", + "call.in-progress.error-providerfault-anthropic-llm-failed", "call.in-progress.error-vapifault-anthropic-400-bad-request-validation-failed", "call.in-progress.error-vapifault-anthropic-401-unauthorized", "call.in-progress.error-vapifault-anthropic-403-model-access-denied", @@ -261,7 +263,7 @@ "pipeline-error-anthropic-bedrock-500-server-error", "pipeline-error-anthropic-bedrock-503-server-overloaded-error", "pipeline-error-anthropic-bedrock-llm-failed", - "call.in-progress.error-vapifault-anthropic-bedrock-llm-failed", + "call.in-progress.error-providerfault-anthropic-bedrock-llm-failed", "call.in-progress.error-vapifault-anthropic-bedrock-400-bad-request-validation-failed", "call.in-progress.error-vapifault-anthropic-bedrock-401-unauthorized", "call.in-progress.error-vapifault-anthropic-bedrock-403-model-access-denied", @@ -275,7 +277,7 @@ "pipeline-error-anthropic-vertex-500-server-error", "pipeline-error-anthropic-vertex-503-server-overloaded-error", "pipeline-error-anthropic-vertex-llm-failed", - "call.in-progress.error-vapifault-anthropic-vertex-llm-failed", + "call.in-progress.error-providerfault-anthropic-vertex-llm-failed", "call.in-progress.error-vapifault-anthropic-vertex-400-bad-request-validation-failed", "call.in-progress.error-vapifault-anthropic-vertex-401-unauthorized", "call.in-progress.error-vapifault-anthropic-vertex-403-model-access-denied", @@ -289,7 +291,7 @@ "pipeline-error-together-ai-500-server-error", "pipeline-error-together-ai-503-server-overloaded-error", "pipeline-error-together-ai-llm-failed", - "call.in-progress.error-vapifault-together-ai-llm-failed", + "call.in-progress.error-providerfault-together-ai-llm-failed", "call.in-progress.error-vapifault-together-ai-400-bad-request-validation-failed", "call.in-progress.error-vapifault-together-ai-401-unauthorized", "call.in-progress.error-vapifault-together-ai-403-model-access-denied", @@ -303,7 +305,7 @@ "pipeline-error-anyscale-500-server-error", "pipeline-error-anyscale-503-server-overloaded-error", "pipeline-error-anyscale-llm-failed", - "call.in-progress.error-vapifault-anyscale-llm-failed", + "call.in-progress.error-providerfault-anyscale-llm-failed", "call.in-progress.error-vapifault-anyscale-400-bad-request-validation-failed", "call.in-progress.error-vapifault-anyscale-401-unauthorized", "call.in-progress.error-vapifault-anyscale-403-model-access-denied", @@ -317,7 +319,7 @@ "pipeline-error-openrouter-500-server-error", "pipeline-error-openrouter-503-server-overloaded-error", "pipeline-error-openrouter-llm-failed", - "call.in-progress.error-vapifault-openrouter-llm-failed", + "call.in-progress.error-providerfault-openrouter-llm-failed", "call.in-progress.error-vapifault-openrouter-400-bad-request-validation-failed", "call.in-progress.error-vapifault-openrouter-401-unauthorized", "call.in-progress.error-vapifault-openrouter-403-model-access-denied", @@ -331,7 +333,7 @@ "pipeline-error-perplexity-ai-500-server-error", "pipeline-error-perplexity-ai-503-server-overloaded-error", "pipeline-error-perplexity-ai-llm-failed", - "call.in-progress.error-vapifault-perplexity-ai-llm-failed", + "call.in-progress.error-providerfault-perplexity-ai-llm-failed", "call.in-progress.error-vapifault-perplexity-ai-400-bad-request-validation-failed", "call.in-progress.error-vapifault-perplexity-ai-401-unauthorized", "call.in-progress.error-vapifault-perplexity-ai-403-model-access-denied", @@ -345,7 +347,7 @@ "pipeline-error-deepinfra-500-server-error", "pipeline-error-deepinfra-503-server-overloaded-error", "pipeline-error-deepinfra-llm-failed", - "call.in-progress.error-vapifault-deepinfra-llm-failed", + "call.in-progress.error-providerfault-deepinfra-llm-failed", "call.in-progress.error-vapifault-deepinfra-400-bad-request-validation-failed", "call.in-progress.error-vapifault-deepinfra-401-unauthorized", "call.in-progress.error-vapifault-deepinfra-403-model-access-denied", @@ -359,7 +361,7 @@ "pipeline-error-runpod-500-server-error", "pipeline-error-runpod-503-server-overloaded-error", "pipeline-error-runpod-llm-failed", - "call.in-progress.error-vapifault-runpod-llm-failed", + "call.in-progress.error-providerfault-runpod-llm-failed", "call.in-progress.error-vapifault-runpod-400-bad-request-validation-failed", "call.in-progress.error-vapifault-runpod-401-unauthorized", "call.in-progress.error-vapifault-runpod-403-model-access-denied", @@ -373,7 +375,7 @@ "pipeline-error-custom-llm-500-server-error", "pipeline-error-custom-llm-503-server-overloaded-error", "pipeline-error-custom-llm-llm-failed", - "call.in-progress.error-vapifault-custom-llm-llm-failed", + "call.in-progress.error-providerfault-custom-llm-llm-failed", "call.in-progress.error-vapifault-custom-llm-400-bad-request-validation-failed", "call.in-progress.error-vapifault-custom-llm-401-unauthorized", "call.in-progress.error-vapifault-custom-llm-403-model-access-denied", @@ -484,6 +486,12 @@ "call.in-progress.error-vapifault-google-transcriber-failed", "pipeline-error-openai-transcriber-failed", "call.in-progress.error-vapifault-openai-transcriber-failed", + "call.in-progress.error-warm-transfer-max-duration", + "call.in-progress.error-warm-transfer-assistant-cancelled", + "call.in-progress.error-warm-transfer-silence-timeout", + "call.in-progress.error-warm-transfer-microphone-timeout", + "call.in-progress.error-warm-transfer-hang-timeout", + "call.in-progress.error-warm-transfer-idle-timeout", "assistant-ended-call", "assistant-said-end-call-phrase", "assistant-ended-call-with-hangup-task", @@ -494,6 +502,7 @@ "call.in-progress.error-transfer-failed", "customer-busy", "customer-ended-call", + "customer-ended-call-after-warm-transfer-attempt", "customer-did-not-answer", "customer-did-not-give-microphone-permission", "exceeded-max-duration", @@ -509,6 +518,8 @@ "call.in-progress.error-sip-outbound-call-failed-to-connect", "call.ringing.hook-executed-say", "call.ringing.hook-executed-transfer", + "call.ending.hook-executed-say", + "call.ending.hook-executed-transfer", "call.ringing.sip-inbound-caller-hungup-before-call-connect", "call.ringing.error-sip-inbound-call-failed-to-connect", "twilio-failed-to-connect-call", diff --git a/src/vapi/types/server_message_hang.py b/src/vapi/types/server_message_hang.py index e378643..a5a9b6c 100644 --- a/src/vapi/types/server_message_hang.py +++ b/src/vapi/types/server_message_hang.py @@ -1,16 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .artifact import Artifact from .call import Call from .chat import Chat -from .create_assistant_dto import CreateAssistantDto from .create_customer_dto import CreateCustomerDto from .server_message_hang_phone_number import ServerMessageHangPhoneNumber @@ -44,7 +45,7 @@ class ServerMessageHang(UncheckedBaseModel): This matches what is stored on `call.artifact` after the call. """ - assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) """ This is the assistant that the message is associated with. """ @@ -72,3 +73,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ServerMessageHang) diff --git a/src/vapi/types/server_message_knowledge_base_request.py b/src/vapi/types/server_message_knowledge_base_request.py index a169224..d217283 100644 --- a/src/vapi/types/server_message_knowledge_base_request.py +++ b/src/vapi/types/server_message_knowledge_base_request.py @@ -1,16 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .artifact import Artifact from .call import Call from .chat import Chat -from .create_assistant_dto import CreateAssistantDto from .create_customer_dto import CreateCustomerDto from .open_ai_message import OpenAiMessage from .server_message_knowledge_base_request_messages_item import ServerMessageKnowledgeBaseRequestMessagesItem @@ -54,7 +55,7 @@ class ServerMessageKnowledgeBaseRequest(UncheckedBaseModel): This matches what is stored on `call.artifact` after the call. """ - assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) """ This is the assistant that the message is associated with. """ @@ -82,3 +83,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ServerMessageKnowledgeBaseRequest) diff --git a/src/vapi/types/server_message_language_change_detected.py b/src/vapi/types/server_message_language_change_detected.py index cc01804..c2f3d89 100644 --- a/src/vapi/types/server_message_language_change_detected.py +++ b/src/vapi/types/server_message_language_change_detected.py @@ -1,16 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .artifact import Artifact from .call import Call from .chat import Chat -from .create_assistant_dto import CreateAssistantDto from .create_customer_dto import CreateCustomerDto from .server_message_language_change_detected_phone_number import ServerMessageLanguageChangeDetectedPhoneNumber @@ -40,7 +41,7 @@ class ServerMessageLanguageChangeDetected(UncheckedBaseModel): This matches what is stored on `call.artifact` after the call. """ - assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) """ This is the assistant that the message is associated with. """ @@ -73,3 +74,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ServerMessageLanguageChangeDetected) diff --git a/src/vapi/types/server_message_message.py b/src/vapi/types/server_message_message.py index feac270..d1cd25e 100644 --- a/src/vapi/types/server_message_message.py +++ b/src/vapi/types/server_message_message.py @@ -4,6 +4,8 @@ from .server_message_assistant_request import ServerMessageAssistantRequest from .server_message_call_endpointing_request import ServerMessageCallEndpointingRequest +from .server_message_chat_created import ServerMessageChatCreated +from .server_message_chat_deleted import ServerMessageChatDeleted from .server_message_conversation_update import ServerMessageConversationUpdate from .server_message_end_of_call_report import ServerMessageEndOfCallReport from .server_message_hang import ServerMessageHang @@ -11,6 +13,9 @@ from .server_message_language_change_detected import ServerMessageLanguageChangeDetected from .server_message_model_output import ServerMessageModelOutput from .server_message_phone_call_control import ServerMessagePhoneCallControl +from .server_message_session_created import ServerMessageSessionCreated +from .server_message_session_deleted import ServerMessageSessionDeleted +from .server_message_session_updated import ServerMessageSessionUpdated from .server_message_speech_update import ServerMessageSpeechUpdate from .server_message_status_update import ServerMessageStatusUpdate from .server_message_tool_calls import ServerMessageToolCalls @@ -40,4 +45,9 @@ ServerMessageVoiceInput, ServerMessageVoiceRequest, ServerMessageCallEndpointingRequest, + ServerMessageChatCreated, + ServerMessageChatDeleted, + ServerMessageSessionCreated, + ServerMessageSessionUpdated, + ServerMessageSessionDeleted, ] diff --git a/src/vapi/types/server_message_model_output.py b/src/vapi/types/server_message_model_output.py index c95d3a0..8253f27 100644 --- a/src/vapi/types/server_message_model_output.py +++ b/src/vapi/types/server_message_model_output.py @@ -1,16 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .artifact import Artifact from .call import Call from .chat import Chat -from .create_assistant_dto import CreateAssistantDto from .create_customer_dto import CreateCustomerDto from .server_message_model_output_phone_number import ServerMessageModelOutputPhoneNumber @@ -40,7 +41,7 @@ class ServerMessageModelOutput(UncheckedBaseModel): This matches what is stored on `call.artifact` after the call. """ - assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) """ This is the assistant that the message is associated with. """ @@ -73,3 +74,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ServerMessageModelOutput) diff --git a/src/vapi/types/server_message_phone_call_control.py b/src/vapi/types/server_message_phone_call_control.py index cc61964..7a3e142 100644 --- a/src/vapi/types/server_message_phone_call_control.py +++ b/src/vapi/types/server_message_phone_call_control.py @@ -1,16 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .artifact import Artifact from .call import Call from .chat import Chat -from .create_assistant_dto import CreateAssistantDto from .create_customer_dto import CreateCustomerDto from .server_message_phone_call_control_destination import ServerMessagePhoneCallControlDestination from .server_message_phone_call_control_phone_number import ServerMessagePhoneCallControlPhoneNumber @@ -54,7 +55,7 @@ class ServerMessagePhoneCallControl(UncheckedBaseModel): This matches what is stored on `call.artifact` after the call. """ - assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) """ This is the assistant that the message is associated with. """ @@ -82,3 +83,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ServerMessagePhoneCallControl) diff --git a/src/vapi/types/server_message_response.py b/src/vapi/types/server_message_response.py index 861bdda..f0752dc 100644 --- a/src/vapi/types/server_message_response.py +++ b/src/vapi/types/server_message_response.py @@ -1,10 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .server_message_response_message_response import ServerMessageResponseMessageResponse @@ -28,3 +30,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ServerMessageResponse) diff --git a/src/vapi/types/server_message_response_assistant_request.py b/src/vapi/types/server_message_response_assistant_request.py index e16d115..f789f77 100644 --- a/src/vapi/types/server_message_response_assistant_request.py +++ b/src/vapi/types/server_message_response_assistant_request.py @@ -1,14 +1,15 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .assistant_overrides import AssistantOverrides -from .create_assistant_dto import CreateAssistantDto from .create_squad_dto import CreateSquadDto from .create_workflow_dto import CreateWorkflowDto from .server_message_response_assistant_request_destination import ServerMessageResponseAssistantRequestDestination @@ -35,7 +36,7 @@ class ServerMessageResponseAssistantRequest(UncheckedBaseModel): - Workflow, use `workflowId` or `workflow` """ - assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) """ This is the assistant that will be used for the call. To use an existing assistant, use `assistantId` instead. @@ -118,3 +119,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ServerMessageResponseAssistantRequest) diff --git a/src/vapi/types/server_message_response_handoff_destination_request.py b/src/vapi/types/server_message_response_handoff_destination_request.py new file mode 100644 index 0000000..80f536a --- /dev/null +++ b/src/vapi/types/server_message_response_handoff_destination_request.py @@ -0,0 +1,52 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.unchecked_base_model import UncheckedBaseModel + + +class ServerMessageResponseHandoffDestinationRequest(UncheckedBaseModel): + destination: "HandoffDestinationAssistant" = pydantic.Field() + """ + This is the destination you'd like the call to be transferred to. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ServerMessageResponseHandoffDestinationRequest) diff --git a/src/vapi/types/server_message_response_message_response.py b/src/vapi/types/server_message_response_message_response.py index 2dfd254..60e7929 100644 --- a/src/vapi/types/server_message_response_message_response.py +++ b/src/vapi/types/server_message_response_message_response.py @@ -4,6 +4,7 @@ from .server_message_response_assistant_request import ServerMessageResponseAssistantRequest from .server_message_response_call_endpointing_request import ServerMessageResponseCallEndpointingRequest +from .server_message_response_handoff_destination_request import ServerMessageResponseHandoffDestinationRequest from .server_message_response_knowledge_base_request import ServerMessageResponseKnowledgeBaseRequest from .server_message_response_tool_calls import ServerMessageResponseToolCalls from .server_message_response_transfer_destination_request import ServerMessageResponseTransferDestinationRequest @@ -11,6 +12,7 @@ ServerMessageResponseMessageResponse = typing.Union[ ServerMessageResponseAssistantRequest, + ServerMessageResponseHandoffDestinationRequest, ServerMessageResponseKnowledgeBaseRequest, ServerMessageResponseToolCalls, ServerMessageResponseTransferDestinationRequest, diff --git a/src/vapi/types/server_message_session_created.py b/src/vapi/types/server_message_session_created.py new file mode 100644 index 0000000..1aaed2d --- /dev/null +++ b/src/vapi/types/server_message_session_created.py @@ -0,0 +1,104 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel +from .artifact import Artifact +from .call import Call +from .chat import Chat +from .create_customer_dto import CreateCustomerDto +from .server_message_session_created_phone_number import ServerMessageSessionCreatedPhoneNumber +from .session import Session + + +class ServerMessageSessionCreated(UncheckedBaseModel): + phone_number: typing_extensions.Annotated[ + typing.Optional[ServerMessageSessionCreatedPhoneNumber], FieldMetadata(alias="phoneNumber") + ] = pydantic.Field(default=None) + """ + This is the phone number that the message is associated with. + """ + + type: typing.Literal["session.created"] = pydantic.Field(default="session.created") + """ + This is the type of the message. "session.created" is sent when a new session is created. + """ + + timestamp: typing.Optional[float] = pydantic.Field(default=None) + """ + This is the timestamp of the message. + """ + + artifact: typing.Optional[Artifact] = pydantic.Field(default=None) + """ + This is a live version of the `call.artifact`. + + This matches what is stored on `call.artifact` after the call. + """ + + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) + """ + This is the assistant that the message is associated with. + """ + + customer: typing.Optional[CreateCustomerDto] = pydantic.Field(default=None) + """ + This is the customer that the message is associated with. + """ + + call: typing.Optional[Call] = pydantic.Field(default=None) + """ + This is the call that the message is associated with. + """ + + chat: typing.Optional[Chat] = pydantic.Field(default=None) + """ + This is the chat object. + """ + + session: Session = pydantic.Field() + """ + This is the session that was created. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ServerMessageSessionCreated) diff --git a/src/vapi/types/server_message_session_created_phone_number.py b/src/vapi/types/server_message_session_created_phone_number.py new file mode 100644 index 0000000..a4739b7 --- /dev/null +++ b/src/vapi/types/server_message_session_created_phone_number.py @@ -0,0 +1,17 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .create_byo_phone_number_dto import CreateByoPhoneNumberDto +from .create_telnyx_phone_number_dto import CreateTelnyxPhoneNumberDto +from .create_twilio_phone_number_dto import CreateTwilioPhoneNumberDto +from .create_vapi_phone_number_dto import CreateVapiPhoneNumberDto +from .create_vonage_phone_number_dto import CreateVonagePhoneNumberDto + +ServerMessageSessionCreatedPhoneNumber = typing.Union[ + CreateByoPhoneNumberDto, + CreateTwilioPhoneNumberDto, + CreateVonagePhoneNumberDto, + CreateVapiPhoneNumberDto, + CreateTelnyxPhoneNumberDto, +] diff --git a/src/vapi/types/server_message_session_deleted.py b/src/vapi/types/server_message_session_deleted.py new file mode 100644 index 0000000..3e57c8e --- /dev/null +++ b/src/vapi/types/server_message_session_deleted.py @@ -0,0 +1,104 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel +from .artifact import Artifact +from .call import Call +from .chat import Chat +from .create_customer_dto import CreateCustomerDto +from .server_message_session_deleted_phone_number import ServerMessageSessionDeletedPhoneNumber +from .session import Session + + +class ServerMessageSessionDeleted(UncheckedBaseModel): + phone_number: typing_extensions.Annotated[ + typing.Optional[ServerMessageSessionDeletedPhoneNumber], FieldMetadata(alias="phoneNumber") + ] = pydantic.Field(default=None) + """ + This is the phone number that the message is associated with. + """ + + type: typing.Literal["session.deleted"] = pydantic.Field(default="session.deleted") + """ + This is the type of the message. "session.deleted" is sent when a session is deleted. + """ + + timestamp: typing.Optional[float] = pydantic.Field(default=None) + """ + This is the timestamp of the message. + """ + + artifact: typing.Optional[Artifact] = pydantic.Field(default=None) + """ + This is a live version of the `call.artifact`. + + This matches what is stored on `call.artifact` after the call. + """ + + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) + """ + This is the assistant that the message is associated with. + """ + + customer: typing.Optional[CreateCustomerDto] = pydantic.Field(default=None) + """ + This is the customer that the message is associated with. + """ + + call: typing.Optional[Call] = pydantic.Field(default=None) + """ + This is the call that the message is associated with. + """ + + chat: typing.Optional[Chat] = pydantic.Field(default=None) + """ + This is the chat object. + """ + + session: Session = pydantic.Field() + """ + This is the session that was deleted. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ServerMessageSessionDeleted) diff --git a/src/vapi/types/server_message_session_deleted_phone_number.py b/src/vapi/types/server_message_session_deleted_phone_number.py new file mode 100644 index 0000000..1b137be --- /dev/null +++ b/src/vapi/types/server_message_session_deleted_phone_number.py @@ -0,0 +1,17 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .create_byo_phone_number_dto import CreateByoPhoneNumberDto +from .create_telnyx_phone_number_dto import CreateTelnyxPhoneNumberDto +from .create_twilio_phone_number_dto import CreateTwilioPhoneNumberDto +from .create_vapi_phone_number_dto import CreateVapiPhoneNumberDto +from .create_vonage_phone_number_dto import CreateVonagePhoneNumberDto + +ServerMessageSessionDeletedPhoneNumber = typing.Union[ + CreateByoPhoneNumberDto, + CreateTwilioPhoneNumberDto, + CreateVonagePhoneNumberDto, + CreateVapiPhoneNumberDto, + CreateTelnyxPhoneNumberDto, +] diff --git a/src/vapi/types/server_message_session_updated.py b/src/vapi/types/server_message_session_updated.py new file mode 100644 index 0000000..35cfe0f --- /dev/null +++ b/src/vapi/types/server_message_session_updated.py @@ -0,0 +1,104 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel +from .artifact import Artifact +from .call import Call +from .chat import Chat +from .create_customer_dto import CreateCustomerDto +from .server_message_session_updated_phone_number import ServerMessageSessionUpdatedPhoneNumber +from .session import Session + + +class ServerMessageSessionUpdated(UncheckedBaseModel): + phone_number: typing_extensions.Annotated[ + typing.Optional[ServerMessageSessionUpdatedPhoneNumber], FieldMetadata(alias="phoneNumber") + ] = pydantic.Field(default=None) + """ + This is the phone number that the message is associated with. + """ + + type: typing.Literal["session.updated"] = pydantic.Field(default="session.updated") + """ + This is the type of the message. "session.updated" is sent when a session is updated. + """ + + timestamp: typing.Optional[float] = pydantic.Field(default=None) + """ + This is the timestamp of the message. + """ + + artifact: typing.Optional[Artifact] = pydantic.Field(default=None) + """ + This is a live version of the `call.artifact`. + + This matches what is stored on `call.artifact` after the call. + """ + + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) + """ + This is the assistant that the message is associated with. + """ + + customer: typing.Optional[CreateCustomerDto] = pydantic.Field(default=None) + """ + This is the customer that the message is associated with. + """ + + call: typing.Optional[Call] = pydantic.Field(default=None) + """ + This is the call that the message is associated with. + """ + + chat: typing.Optional[Chat] = pydantic.Field(default=None) + """ + This is the chat object. + """ + + session: Session = pydantic.Field() + """ + This is the session that was updated. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ServerMessageSessionUpdated) diff --git a/src/vapi/types/server_message_session_updated_phone_number.py b/src/vapi/types/server_message_session_updated_phone_number.py new file mode 100644 index 0000000..414aa79 --- /dev/null +++ b/src/vapi/types/server_message_session_updated_phone_number.py @@ -0,0 +1,17 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .create_byo_phone_number_dto import CreateByoPhoneNumberDto +from .create_telnyx_phone_number_dto import CreateTelnyxPhoneNumberDto +from .create_twilio_phone_number_dto import CreateTwilioPhoneNumberDto +from .create_vapi_phone_number_dto import CreateVapiPhoneNumberDto +from .create_vonage_phone_number_dto import CreateVonagePhoneNumberDto + +ServerMessageSessionUpdatedPhoneNumber = typing.Union[ + CreateByoPhoneNumberDto, + CreateTwilioPhoneNumberDto, + CreateVonagePhoneNumberDto, + CreateVapiPhoneNumberDto, + CreateTelnyxPhoneNumberDto, +] diff --git a/src/vapi/types/server_message_speech_update.py b/src/vapi/types/server_message_speech_update.py index a9f66d4..594e877 100644 --- a/src/vapi/types/server_message_speech_update.py +++ b/src/vapi/types/server_message_speech_update.py @@ -1,16 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .artifact import Artifact from .call import Call from .chat import Chat -from .create_assistant_dto import CreateAssistantDto from .create_customer_dto import CreateCustomerDto from .server_message_speech_update_phone_number import ServerMessageSpeechUpdatePhoneNumber from .server_message_speech_update_role import ServerMessageSpeechUpdateRole @@ -57,7 +58,7 @@ class ServerMessageSpeechUpdate(UncheckedBaseModel): This matches what is stored on `call.artifact` after the call. """ - assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) """ This is the assistant that the message is associated with. """ @@ -85,3 +86,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ServerMessageSpeechUpdate) diff --git a/src/vapi/types/server_message_status_update.py b/src/vapi/types/server_message_status_update.py index 001858c..22876b0 100644 --- a/src/vapi/types/server_message_status_update.py +++ b/src/vapi/types/server_message_status_update.py @@ -1,16 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .artifact import Artifact from .call import Call from .chat import Chat -from .create_assistant_dto import CreateAssistantDto from .create_customer_dto import CreateCustomerDto from .open_ai_message import OpenAiMessage from .server_message_status_update_destination import ServerMessageStatusUpdateDestination @@ -74,7 +75,7 @@ class ServerMessageStatusUpdate(UncheckedBaseModel): This matches what is stored on `call.artifact` after the call. """ - assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) """ This is the assistant that the message is associated with. """ @@ -122,3 +123,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ServerMessageStatusUpdate) diff --git a/src/vapi/types/server_message_status_update_ended_reason.py b/src/vapi/types/server_message_status_update_ended_reason.py index cc43ad7..eaf0abb 100644 --- a/src/vapi/types/server_message_status_update_ended_reason.py +++ b/src/vapi/types/server_message_status_update_ended_reason.py @@ -42,6 +42,7 @@ "pipeline-error-hume-voice-failed", "pipeline-error-sesame-voice-failed", "pipeline-error-inworld-voice-failed", + "pipeline-error-minimax-voice-failed", "pipeline-error-tavus-video-failed", "call.in-progress.error-vapifault-openai-voice-failed", "call.in-progress.error-vapifault-cartesia-voice-failed", @@ -56,6 +57,7 @@ "call.in-progress.error-vapifault-hume-voice-failed", "call.in-progress.error-vapifault-sesame-voice-failed", "call.in-progress.error-vapifault-inworld-voice-failed", + "call.in-progress.error-vapifault-minimax-voice-failed", "call.in-progress.error-vapifault-tavus-video-failed", "pipeline-error-vapi-llm-failed", "pipeline-error-vapi-400-bad-request-validation-failed", @@ -64,7 +66,7 @@ "pipeline-error-vapi-429-exceeded-quota", "pipeline-error-vapi-500-server-error", "pipeline-error-vapi-503-server-overloaded-error", - "call.in-progress.error-vapifault-vapi-llm-failed", + "call.in-progress.error-providerfault-vapi-llm-failed", "call.in-progress.error-vapifault-vapi-400-bad-request-validation-failed", "call.in-progress.error-vapifault-vapi-401-unauthorized", "call.in-progress.error-vapifault-vapi-403-model-access-denied", @@ -107,15 +109,15 @@ "call.in-progress.error-vapifault-worker-died", "call.in-progress.twilio-completed-call", "call.in-progress.sip-completed-call", - "call.in-progress.error-vapifault-openai-llm-failed", - "call.in-progress.error-vapifault-azure-openai-llm-failed", - "call.in-progress.error-vapifault-groq-llm-failed", - "call.in-progress.error-vapifault-google-llm-failed", - "call.in-progress.error-vapifault-xai-llm-failed", - "call.in-progress.error-vapifault-mistral-llm-failed", - "call.in-progress.error-vapifault-inflection-ai-llm-failed", - "call.in-progress.error-vapifault-cerebras-llm-failed", - "call.in-progress.error-vapifault-deep-seek-llm-failed", + "call.in-progress.error-providerfault-openai-llm-failed", + "call.in-progress.error-providerfault-azure-openai-llm-failed", + "call.in-progress.error-providerfault-groq-llm-failed", + "call.in-progress.error-providerfault-google-llm-failed", + "call.in-progress.error-providerfault-xai-llm-failed", + "call.in-progress.error-providerfault-mistral-llm-failed", + "call.in-progress.error-providerfault-inflection-ai-llm-failed", + "call.in-progress.error-providerfault-cerebras-llm-failed", + "call.in-progress.error-providerfault-deep-seek-llm-failed", "call.in-progress.error-vapifault-chat-pipeline-failed-to-start", "pipeline-error-openai-400-bad-request-validation-failed", "pipeline-error-openai-401-unauthorized", @@ -247,7 +249,7 @@ "pipeline-error-anthropic-500-server-error", "pipeline-error-anthropic-503-server-overloaded-error", "pipeline-error-anthropic-llm-failed", - "call.in-progress.error-vapifault-anthropic-llm-failed", + "call.in-progress.error-providerfault-anthropic-llm-failed", "call.in-progress.error-vapifault-anthropic-400-bad-request-validation-failed", "call.in-progress.error-vapifault-anthropic-401-unauthorized", "call.in-progress.error-vapifault-anthropic-403-model-access-denied", @@ -261,7 +263,7 @@ "pipeline-error-anthropic-bedrock-500-server-error", "pipeline-error-anthropic-bedrock-503-server-overloaded-error", "pipeline-error-anthropic-bedrock-llm-failed", - "call.in-progress.error-vapifault-anthropic-bedrock-llm-failed", + "call.in-progress.error-providerfault-anthropic-bedrock-llm-failed", "call.in-progress.error-vapifault-anthropic-bedrock-400-bad-request-validation-failed", "call.in-progress.error-vapifault-anthropic-bedrock-401-unauthorized", "call.in-progress.error-vapifault-anthropic-bedrock-403-model-access-denied", @@ -275,7 +277,7 @@ "pipeline-error-anthropic-vertex-500-server-error", "pipeline-error-anthropic-vertex-503-server-overloaded-error", "pipeline-error-anthropic-vertex-llm-failed", - "call.in-progress.error-vapifault-anthropic-vertex-llm-failed", + "call.in-progress.error-providerfault-anthropic-vertex-llm-failed", "call.in-progress.error-vapifault-anthropic-vertex-400-bad-request-validation-failed", "call.in-progress.error-vapifault-anthropic-vertex-401-unauthorized", "call.in-progress.error-vapifault-anthropic-vertex-403-model-access-denied", @@ -289,7 +291,7 @@ "pipeline-error-together-ai-500-server-error", "pipeline-error-together-ai-503-server-overloaded-error", "pipeline-error-together-ai-llm-failed", - "call.in-progress.error-vapifault-together-ai-llm-failed", + "call.in-progress.error-providerfault-together-ai-llm-failed", "call.in-progress.error-vapifault-together-ai-400-bad-request-validation-failed", "call.in-progress.error-vapifault-together-ai-401-unauthorized", "call.in-progress.error-vapifault-together-ai-403-model-access-denied", @@ -303,7 +305,7 @@ "pipeline-error-anyscale-500-server-error", "pipeline-error-anyscale-503-server-overloaded-error", "pipeline-error-anyscale-llm-failed", - "call.in-progress.error-vapifault-anyscale-llm-failed", + "call.in-progress.error-providerfault-anyscale-llm-failed", "call.in-progress.error-vapifault-anyscale-400-bad-request-validation-failed", "call.in-progress.error-vapifault-anyscale-401-unauthorized", "call.in-progress.error-vapifault-anyscale-403-model-access-denied", @@ -317,7 +319,7 @@ "pipeline-error-openrouter-500-server-error", "pipeline-error-openrouter-503-server-overloaded-error", "pipeline-error-openrouter-llm-failed", - "call.in-progress.error-vapifault-openrouter-llm-failed", + "call.in-progress.error-providerfault-openrouter-llm-failed", "call.in-progress.error-vapifault-openrouter-400-bad-request-validation-failed", "call.in-progress.error-vapifault-openrouter-401-unauthorized", "call.in-progress.error-vapifault-openrouter-403-model-access-denied", @@ -331,7 +333,7 @@ "pipeline-error-perplexity-ai-500-server-error", "pipeline-error-perplexity-ai-503-server-overloaded-error", "pipeline-error-perplexity-ai-llm-failed", - "call.in-progress.error-vapifault-perplexity-ai-llm-failed", + "call.in-progress.error-providerfault-perplexity-ai-llm-failed", "call.in-progress.error-vapifault-perplexity-ai-400-bad-request-validation-failed", "call.in-progress.error-vapifault-perplexity-ai-401-unauthorized", "call.in-progress.error-vapifault-perplexity-ai-403-model-access-denied", @@ -345,7 +347,7 @@ "pipeline-error-deepinfra-500-server-error", "pipeline-error-deepinfra-503-server-overloaded-error", "pipeline-error-deepinfra-llm-failed", - "call.in-progress.error-vapifault-deepinfra-llm-failed", + "call.in-progress.error-providerfault-deepinfra-llm-failed", "call.in-progress.error-vapifault-deepinfra-400-bad-request-validation-failed", "call.in-progress.error-vapifault-deepinfra-401-unauthorized", "call.in-progress.error-vapifault-deepinfra-403-model-access-denied", @@ -359,7 +361,7 @@ "pipeline-error-runpod-500-server-error", "pipeline-error-runpod-503-server-overloaded-error", "pipeline-error-runpod-llm-failed", - "call.in-progress.error-vapifault-runpod-llm-failed", + "call.in-progress.error-providerfault-runpod-llm-failed", "call.in-progress.error-vapifault-runpod-400-bad-request-validation-failed", "call.in-progress.error-vapifault-runpod-401-unauthorized", "call.in-progress.error-vapifault-runpod-403-model-access-denied", @@ -373,7 +375,7 @@ "pipeline-error-custom-llm-500-server-error", "pipeline-error-custom-llm-503-server-overloaded-error", "pipeline-error-custom-llm-llm-failed", - "call.in-progress.error-vapifault-custom-llm-llm-failed", + "call.in-progress.error-providerfault-custom-llm-llm-failed", "call.in-progress.error-vapifault-custom-llm-400-bad-request-validation-failed", "call.in-progress.error-vapifault-custom-llm-401-unauthorized", "call.in-progress.error-vapifault-custom-llm-403-model-access-denied", @@ -484,6 +486,12 @@ "call.in-progress.error-vapifault-google-transcriber-failed", "pipeline-error-openai-transcriber-failed", "call.in-progress.error-vapifault-openai-transcriber-failed", + "call.in-progress.error-warm-transfer-max-duration", + "call.in-progress.error-warm-transfer-assistant-cancelled", + "call.in-progress.error-warm-transfer-silence-timeout", + "call.in-progress.error-warm-transfer-microphone-timeout", + "call.in-progress.error-warm-transfer-hang-timeout", + "call.in-progress.error-warm-transfer-idle-timeout", "assistant-ended-call", "assistant-said-end-call-phrase", "assistant-ended-call-with-hangup-task", @@ -494,6 +502,7 @@ "call.in-progress.error-transfer-failed", "customer-busy", "customer-ended-call", + "customer-ended-call-after-warm-transfer-attempt", "customer-did-not-answer", "customer-did-not-give-microphone-permission", "exceeded-max-duration", @@ -509,6 +518,8 @@ "call.in-progress.error-sip-outbound-call-failed-to-connect", "call.ringing.hook-executed-say", "call.ringing.hook-executed-transfer", + "call.ending.hook-executed-say", + "call.ending.hook-executed-transfer", "call.ringing.sip-inbound-caller-hungup-before-call-connect", "call.ringing.error-sip-inbound-call-failed-to-connect", "twilio-failed-to-connect-call", diff --git a/src/vapi/types/server_message_tool_calls.py b/src/vapi/types/server_message_tool_calls.py index 1825eed..0976165 100644 --- a/src/vapi/types/server_message_tool_calls.py +++ b/src/vapi/types/server_message_tool_calls.py @@ -1,16 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .artifact import Artifact from .call import Call from .chat import Chat -from .create_assistant_dto import CreateAssistantDto from .create_customer_dto import CreateCustomerDto from .server_message_tool_calls_phone_number import ServerMessageToolCallsPhoneNumber from .server_message_tool_calls_tool_with_tool_call_list_item import ServerMessageToolCallsToolWithToolCallListItem @@ -49,7 +50,7 @@ class ServerMessageToolCalls(UncheckedBaseModel): This matches what is stored on `call.artifact` after the call. """ - assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) """ This is the assistant that the message is associated with. """ @@ -84,3 +85,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ServerMessageToolCalls) diff --git a/src/vapi/types/server_message_transcript.py b/src/vapi/types/server_message_transcript.py index 7b277fe..0aa3561 100644 --- a/src/vapi/types/server_message_transcript.py +++ b/src/vapi/types/server_message_transcript.py @@ -1,16 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .artifact import Artifact from .call import Call from .chat import Chat -from .create_assistant_dto import CreateAssistantDto from .create_customer_dto import CreateCustomerDto from .server_message_transcript_phone_number import ServerMessageTranscriptPhoneNumber from .server_message_transcript_role import ServerMessageTranscriptRole @@ -43,7 +44,7 @@ class ServerMessageTranscript(UncheckedBaseModel): This matches what is stored on `call.artifact` after the call. """ - assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) """ This is the assistant that the message is associated with. """ @@ -80,6 +81,27 @@ class ServerMessageTranscript(UncheckedBaseModel): This is the transcript content. """ + is_filtered: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="isFiltered")] = pydantic.Field( + default=None + ) + """ + Indicates if the transcript was filtered for security reasons. + """ + + detected_threats: typing_extensions.Annotated[ + typing.Optional[typing.List[str]], FieldMetadata(alias="detectedThreats") + ] = pydantic.Field(default=None) + """ + List of detected security threats if the transcript was filtered. + """ + + original_transcript: typing_extensions.Annotated[ + typing.Optional[str], FieldMetadata(alias="originalTranscript") + ] = pydantic.Field(default=None) + """ + The original transcript before filtering (only included if content was filtered). + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: @@ -88,3 +110,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ServerMessageTranscript) diff --git a/src/vapi/types/server_message_transcript_type.py b/src/vapi/types/server_message_transcript_type.py index 977ac82..15c5a76 100644 --- a/src/vapi/types/server_message_transcript_type.py +++ b/src/vapi/types/server_message_transcript_type.py @@ -2,6 +2,4 @@ import typing -ServerMessageTranscriptType = typing.Union[ - typing.Literal["transcript", 'transcript[transcriptType="final"]'], typing.Any -] +ServerMessageTranscriptType = typing.Union[typing.Literal["transcript[transcriptType='final']"], typing.Any] diff --git a/src/vapi/types/server_message_transfer_destination_request.py b/src/vapi/types/server_message_transfer_destination_request.py index 5c3e51a..2555f77 100644 --- a/src/vapi/types/server_message_transfer_destination_request.py +++ b/src/vapi/types/server_message_transfer_destination_request.py @@ -1,16 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .artifact import Artifact from .call import Call from .chat import Chat -from .create_assistant_dto import CreateAssistantDto from .create_customer_dto import CreateCustomerDto from .server_message_transfer_destination_request_phone_number import ServerMessageTransferDestinationRequestPhoneNumber @@ -40,7 +41,7 @@ class ServerMessageTransferDestinationRequest(UncheckedBaseModel): This matches what is stored on `call.artifact` after the call. """ - assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) """ This is the assistant that the message is associated with. """ @@ -68,3 +69,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ServerMessageTransferDestinationRequest) diff --git a/src/vapi/types/server_message_transfer_update.py b/src/vapi/types/server_message_transfer_update.py index 6e3cad7..8742e0e 100644 --- a/src/vapi/types/server_message_transfer_update.py +++ b/src/vapi/types/server_message_transfer_update.py @@ -1,16 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .artifact import Artifact from .call import Call from .chat import Chat -from .create_assistant_dto import CreateAssistantDto from .create_customer_dto import CreateCustomerDto from .server_message_transfer_update_destination import ServerMessageTransferUpdateDestination from .server_message_transfer_update_phone_number import ServerMessageTransferUpdatePhoneNumber @@ -46,7 +47,7 @@ class ServerMessageTransferUpdate(UncheckedBaseModel): This matches what is stored on `call.artifact` after the call. """ - assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) """ This is the assistant that the message is associated with. """ @@ -67,14 +68,14 @@ class ServerMessageTransferUpdate(UncheckedBaseModel): """ to_assistant: typing_extensions.Annotated[ - typing.Optional[CreateAssistantDto], FieldMetadata(alias="toAssistant") + typing.Optional["CreateAssistantDto"], FieldMetadata(alias="toAssistant") ] = pydantic.Field(default=None) """ This is the assistant that the call is being transferred to. This is only sent if `destination.type` is "assistant". """ from_assistant: typing_extensions.Annotated[ - typing.Optional[CreateAssistantDto], FieldMetadata(alias="fromAssistant") + typing.Optional["CreateAssistantDto"], FieldMetadata(alias="fromAssistant") ] = pydantic.Field(default=None) """ This is the assistant that the call is being transferred from. This is only sent if `destination.type` is "assistant". @@ -102,3 +103,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ServerMessageTransferUpdate) diff --git a/src/vapi/types/server_message_user_interrupted.py b/src/vapi/types/server_message_user_interrupted.py index 8148da7..b459d7d 100644 --- a/src/vapi/types/server_message_user_interrupted.py +++ b/src/vapi/types/server_message_user_interrupted.py @@ -1,16 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .artifact import Artifact from .call import Call from .chat import Chat -from .create_assistant_dto import CreateAssistantDto from .create_customer_dto import CreateCustomerDto from .server_message_user_interrupted_phone_number import ServerMessageUserInterruptedPhoneNumber @@ -40,7 +41,7 @@ class ServerMessageUserInterrupted(UncheckedBaseModel): This matches what is stored on `call.artifact` after the call. """ - assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) """ This is the assistant that the message is associated with. """ @@ -68,3 +69,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ServerMessageUserInterrupted) diff --git a/src/vapi/types/server_message_voice_input.py b/src/vapi/types/server_message_voice_input.py index d961e30..3e4eeb6 100644 --- a/src/vapi/types/server_message_voice_input.py +++ b/src/vapi/types/server_message_voice_input.py @@ -1,16 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .artifact import Artifact from .call import Call from .chat import Chat -from .create_assistant_dto import CreateAssistantDto from .create_customer_dto import CreateCustomerDto from .server_message_voice_input_phone_number import ServerMessageVoiceInputPhoneNumber @@ -40,7 +41,7 @@ class ServerMessageVoiceInput(UncheckedBaseModel): This matches what is stored on `call.artifact` after the call. """ - assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) """ This is the assistant that the message is associated with. """ @@ -73,3 +74,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ServerMessageVoiceInput) diff --git a/src/vapi/types/server_message_voice_request.py b/src/vapi/types/server_message_voice_request.py index 2019d71..560c644 100644 --- a/src/vapi/types/server_message_voice_request.py +++ b/src/vapi/types/server_message_voice_request.py @@ -1,16 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .artifact import Artifact from .call import Call from .chat import Chat -from .create_assistant_dto import CreateAssistantDto from .create_customer_dto import CreateCustomerDto from .server_message_voice_request_phone_number import ServerMessageVoiceRequestPhoneNumber @@ -61,7 +62,7 @@ class ServerMessageVoiceRequest(UncheckedBaseModel): This matches what is stored on `call.artifact` after the call. """ - assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) """ This is the assistant that the message is associated with. """ @@ -99,3 +100,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ServerMessageVoiceRequest) diff --git a/src/vapi/types/session.py b/src/vapi/types/session.py index 898c504..37cd34d 100644 --- a/src/vapi/types/session.py +++ b/src/vapi/types/session.py @@ -1,14 +1,15 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import datetime as dt import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel -from .create_assistant_dto import CreateAssistantDto from .create_customer_dto import CreateCustomerDto from .import_twilio_phone_number_dto import ImportTwilioPhoneNumberDto from .session_messages_item import SessionMessagesItem @@ -60,7 +61,7 @@ class Session(UncheckedBaseModel): This is the ID of the assistant associated with this session. Use this when referencing an existing assistant. """ - assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) """ This is the assistant configuration for this session. Use this when creating a new assistant configuration. If assistantId is provided, this will be ignored. @@ -98,3 +99,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(Session) diff --git a/src/vapi/types/session_paginated_response.py b/src/vapi/types/session_paginated_response.py index 1a44510..067c1d5 100644 --- a/src/vapi/types/session_paginated_response.py +++ b/src/vapi/types/session_paginated_response.py @@ -1,9 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .pagination_meta import PaginationMeta from .session import Session @@ -21,3 +23,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(SessionPaginatedResponse) diff --git a/src/vapi/types/slack_send_message_tool.py b/src/vapi/types/slack_send_message_tool.py index 7c69797..6c56e97 100644 --- a/src/vapi/types/slack_send_message_tool.py +++ b/src/vapi/types/slack_send_message_tool.py @@ -1,15 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import datetime as dt import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel -from .open_ai_function import OpenAiFunction from .slack_send_message_tool_messages_item import SlackSendMessageToolMessagesItem +from .tool_rejection_plan import ToolRejectionPlan class SlackSendMessageTool(UncheckedBaseModel): @@ -41,13 +43,88 @@ class SlackSendMessageTool(UncheckedBaseModel): This is the ISO 8601 date-time string of when the tool was last updated. """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -58,3 +135,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(SlackSendMessageTool) diff --git a/src/vapi/types/sms_tool.py b/src/vapi/types/sms_tool.py index 09f163f..93dfa75 100644 --- a/src/vapi/types/sms_tool.py +++ b/src/vapi/types/sms_tool.py @@ -1,15 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import datetime as dt import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel -from .open_ai_function import OpenAiFunction from .sms_tool_messages_item import SmsToolMessagesItem +from .tool_rejection_plan import ToolRejectionPlan class SmsTool(UncheckedBaseModel): @@ -41,13 +43,88 @@ class SmsTool(UncheckedBaseModel): This is the ISO 8601 date-time string of when the tool was last updated. """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -58,3 +135,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(SmsTool) diff --git a/src/vapi/types/sql_injection_security_filter.py b/src/vapi/types/sql_injection_security_filter.py new file mode 100644 index 0000000..12d2a4b --- /dev/null +++ b/src/vapi/types/sql_injection_security_filter.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.unchecked_base_model import UncheckedBaseModel + + +class SqlInjectionSecurityFilter(UncheckedBaseModel): + type: typing.Literal["sql-injection"] = pydantic.Field(default="sql-injection") + """ + The type of security threat to filter. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/squad.py b/src/vapi/types/squad.py index 64fda59..d3313ac 100644 --- a/src/vapi/types/squad.py +++ b/src/vapi/types/squad.py @@ -1,11 +1,13 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import datetime as dt import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .assistant_overrides import AssistantOverrides @@ -62,3 +64,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(Squad) diff --git a/src/vapi/types/squad_member_dto.py b/src/vapi/types/squad_member_dto.py index 9c431db..639dafb 100644 --- a/src/vapi/types/squad_member_dto.py +++ b/src/vapi/types/squad_member_dto.py @@ -1,18 +1,33 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .assistant_overrides import AssistantOverrides -from .create_assistant_dto import CreateAssistantDto -from .transfer_destination_assistant import TransferDestinationAssistant +from .squad_member_dto_assistant_destinations_item import SquadMemberDtoAssistantDestinationsItem class SquadMemberDto(UncheckedBaseModel): + assistant_destinations: typing_extensions.Annotated[ + typing.Optional[typing.List[SquadMemberDtoAssistantDestinationsItem]], + FieldMetadata(alias="assistantDestinations"), + ] = pydantic.Field(default=None) + """ + These are the other assistants that this assistant can transfer or handoff to. + + Supports both: + - TransferDestinationAssistant: For transfer call tool (legacy) + - HandoffDestinationAssistant: For handoff tool (recommended) + + If the assistant already has transfer call or handoff tools, these destinations are just appended to existing ones. + """ + assistant_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="assistantId")] = ( pydantic.Field(default=None) ) @@ -20,7 +35,7 @@ class SquadMemberDto(UncheckedBaseModel): This is the assistant that will be used for the call. To use a transient assistant, use `assistant` instead. """ - assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) """ This is the assistant that will be used for the call. To use an existing assistant, use `assistantId` instead. """ @@ -32,15 +47,6 @@ class SquadMemberDto(UncheckedBaseModel): This can be used to override the assistant's settings and provide values for it's template variables. """ - assistant_destinations: typing_extensions.Annotated[ - typing.Optional[typing.List[TransferDestinationAssistant]], FieldMetadata(alias="assistantDestinations") - ] = pydantic.Field(default=None) - """ - These are the others assistants that this assistant can transfer to. - - If the assistant already has transfer call tool, these destinations are just appended to existing ones. - """ - if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: @@ -49,3 +55,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(SquadMemberDto) diff --git a/src/vapi/types/squad_member_dto_assistant_destinations_item.py b/src/vapi/types/squad_member_dto_assistant_destinations_item.py new file mode 100644 index 0000000..7df3a90 --- /dev/null +++ b/src/vapi/types/squad_member_dto_assistant_destinations_item.py @@ -0,0 +1,8 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .handoff_destination_assistant import HandoffDestinationAssistant +from .transfer_destination_assistant import TransferDestinationAssistant + +SquadMemberDtoAssistantDestinationsItem = typing.Union[TransferDestinationAssistant, HandoffDestinationAssistant] diff --git a/src/vapi/types/ssrf_security_filter.py b/src/vapi/types/ssrf_security_filter.py new file mode 100644 index 0000000..e8cd9c8 --- /dev/null +++ b/src/vapi/types/ssrf_security_filter.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.unchecked_base_model import UncheckedBaseModel + + +class SsrfSecurityFilter(UncheckedBaseModel): + type: typing.Literal["ssrf"] = pydantic.Field(default="ssrf") + """ + The type of security threat to filter. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/structured_data_plan.py b/src/vapi/types/structured_data_plan.py index 65d1c6b..7a8eb93 100644 --- a/src/vapi/types/structured_data_plan.py +++ b/src/vapi/types/structured_data_plan.py @@ -30,7 +30,7 @@ class StructuredDataPlan(UncheckedBaseModel): You can customize by providing any messages you want. Here are the template variables available: - - {{transcript}}: the transcript of the call from `call.artifact.transcript`- {{systemPrompt}}: the system prompt of the call from `assistant.model.messages[type=system].content`- {{schema}}: the schema of the structured data from `structuredDataPlan.schema`- {{endedReason}}: the ended reason of the call from `call.endedReason` + - {{transcript}}: the transcript of the call from `call.artifact.transcript`- {{systemPrompt}}: the system prompt of the call from `assistant.model.messages[type=system].content`- {{messages}}: the messages of the call from `assistant.model.messages`- {{schema}}: the schema of the structured data from `structuredDataPlan.schema`- {{endedReason}}: the ended reason of the call from `call.endedReason` """ enabled: typing.Optional[bool] = pydantic.Field(default=None) diff --git a/src/vapi/types/structured_output.py b/src/vapi/types/structured_output.py new file mode 100644 index 0000000..3f28f7d --- /dev/null +++ b/src/vapi/types/structured_output.py @@ -0,0 +1,103 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel +from .json_schema import JsonSchema +from .structured_output_model import StructuredOutputModel + + +class StructuredOutput(UncheckedBaseModel): + model: typing.Optional[StructuredOutputModel] = pydantic.Field(default=None) + """ + This is the model that will be used to extract the structured output. + + To provide your own custom system and user prompts for structured output extraction, populate the messages array with your system and user messages. You can specify liquid templating in your system and user messages. + Between the system or user messages, you must reference either 'transcript' or 'messages' with the '{{}}' syntax to access the conversation history. + Between the system or user messages, you must reference a variation of the structured output with the '{{}}' syntax to access the structured output definition. + i.e.: + {{structuredOutput}} + {{structuredOutput.name}} + {{structuredOutput.description}} + {{structuredOutput.schema}} + + If model is not specified, GPT-4.1 will be used by default for extraction, utilizing default system and user prompts. + If messages or required fields are not specified, the default system and user prompts will be used. + """ + + id: str = pydantic.Field() + """ + This is the unique identifier for the structured output. + """ + + org_id: typing_extensions.Annotated[str, FieldMetadata(alias="orgId")] = pydantic.Field() + """ + This is the unique identifier for the org that this structured output belongs to. + """ + + created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the structured output was created. + """ + + updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field() + """ + This is the ISO 8601 date-time string of when the structured output was last updated. + """ + + name: str = pydantic.Field() + """ + This is the name of the structured output. + """ + + description: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the description of what the structured output extracts. + + Use this to provide context about what data will be extracted and how it will be used. + """ + + assistant_ids: typing_extensions.Annotated[ + typing.Optional[typing.List[str]], FieldMetadata(alias="assistantIds") + ] = pydantic.Field(default=None) + """ + These are the assistant IDs that this structured output is linked to. + + When linked to assistants, this structured output will be available for extraction during those assistant's calls. + """ + + workflow_ids: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="workflowIds")] = ( + pydantic.Field(default=None) + ) + """ + These are the workflow IDs that this structured output is linked to. + + When linked to workflows, this structured output will be available for extraction during those workflow's execution. + """ + + schema_: typing_extensions.Annotated[JsonSchema, FieldMetadata(alias="schema")] = pydantic.Field() + """ + This is the JSON Schema definition for the structured output. + + Defines the structure and validation rules for the data that will be extracted. Supports all JSON Schema features including: + - Objects and nested properties + - Arrays and array validation + - String, number, boolean, and null types + - Enums and const values + - Validation constraints (min/max, patterns, etc.) + - Composition with allOf, anyOf, oneOf + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/structured_output_model.py b/src/vapi/types/structured_output_model.py new file mode 100644 index 0000000..3f65ef1 --- /dev/null +++ b/src/vapi/types/structured_output_model.py @@ -0,0 +1,12 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .workflow_anthropic_model import WorkflowAnthropicModel +from .workflow_custom_model import WorkflowCustomModel +from .workflow_google_model import WorkflowGoogleModel +from .workflow_open_ai_model import WorkflowOpenAiModel + +StructuredOutputModel = typing.Union[ + WorkflowOpenAiModel, WorkflowAnthropicModel, WorkflowGoogleModel, WorkflowCustomModel +] diff --git a/src/vapi/types/logs_paginated_response.py b/src/vapi/types/structured_output_paginated_response.py similarity index 79% rename from src/vapi/types/logs_paginated_response.py rename to src/vapi/types/structured_output_paginated_response.py index f341e0f..a4a149d 100644 --- a/src/vapi/types/logs_paginated_response.py +++ b/src/vapi/types/structured_output_paginated_response.py @@ -5,12 +5,12 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel -from .log import Log from .pagination_meta import PaginationMeta +from .structured_output import StructuredOutput -class LogsPaginatedResponse(UncheckedBaseModel): - results: typing.List[Log] +class StructuredOutputPaginatedResponse(UncheckedBaseModel): + results: typing.List[StructuredOutput] metadata: PaginationMeta if IS_PYDANTIC_V2: diff --git a/src/vapi/types/subscription.py b/src/vapi/types/subscription.py index 1702f27..c03493f 100644 --- a/src/vapi/types/subscription.py +++ b/src/vapi/types/subscription.py @@ -10,6 +10,7 @@ from ..core.unchecked_base_model import UncheckedBaseModel from .auto_reload_plan import AutoReloadPlan from .invoice_plan import InvoicePlan +from .subscription_minutes_included_reset_frequency import SubscriptionMinutesIncludedResetFrequency from .subscription_status import SubscriptionStatus from .subscription_type import SubscriptionType @@ -262,6 +263,41 @@ class Subscription(UncheckedBaseModel): This is the ID for the Common Paper agreement outlining the PCI contract. """ + call_retention_days: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="callRetentionDays") + ] = pydantic.Field(default=None) + """ + This is the call retention days for the subscription. + """ + + chat_retention_days: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="chatRetentionDays") + ] = pydantic.Field(default=None) + """ + This is the chat retention days for the subscription. + """ + + minutes_included_reset_frequency: typing_extensions.Annotated[ + typing.Optional[SubscriptionMinutesIncludedResetFrequency], FieldMetadata(alias="minutesIncludedResetFrequency") + ] = pydantic.Field(default=None) + """ + This is the minutes_included reset frequency for the subscription. + """ + + rbac_enabled: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="rbacEnabled")] = ( + pydantic.Field(default=None) + ) + """ + This is the Role Based Access Control (RBAC) enabled flag for the subscription. + """ + + platform_fee: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="platformFee")] = ( + pydantic.Field(default=None) + ) + """ + This is the platform fee for the subscription. + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/vapi/types/subscription_minutes_included_reset_frequency.py b/src/vapi/types/subscription_minutes_included_reset_frequency.py new file mode 100644 index 0000000..9146f5f --- /dev/null +++ b/src/vapi/types/subscription_minutes_included_reset_frequency.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +SubscriptionMinutesIncludedResetFrequency = typing.Union[typing.Literal["monthly", "annually"], typing.Any] diff --git a/src/vapi/types/subscription_type.py b/src/vapi/types/subscription_type.py index 541e830..4eae5c7 100644 --- a/src/vapi/types/subscription_type.py +++ b/src/vapi/types/subscription_type.py @@ -3,5 +3,5 @@ import typing SubscriptionType = typing.Union[ - typing.Literal["trial", "pay-as-you-go", "enterprise", "agency", "startup", "growth", "scale"], typing.Any + typing.Literal["pay-as-you-go", "enterprise", "agency", "startup", "growth", "scale"], typing.Any ] diff --git a/src/vapi/types/success_evaluation_plan.py b/src/vapi/types/success_evaluation_plan.py index d09eabf..cc2ce38 100644 --- a/src/vapi/types/success_evaluation_plan.py +++ b/src/vapi/types/success_evaluation_plan.py @@ -51,7 +51,7 @@ class SuccessEvaluationPlan(UncheckedBaseModel): You can customize by providing any messages you want. Here are the template variables available: - - {{transcript}}: the transcript of the call from `call.artifact.transcript`- {{systemPrompt}}: the system prompt of the call from `assistant.model.messages[type=system].content`- {{rubric}}: the rubric of the success evaluation from `successEvaluationPlan.rubric`- {{endedReason}}: the ended reason of the call from `call.endedReason` + - {{transcript}}: the transcript of the call from `call.artifact.transcript`- {{systemPrompt}}: the system prompt of the call from `assistant.model.messages[type=system].content`- {{messages}}: the messages of the call from `assistant.model.messages`- {{rubric}}: the rubric of the success evaluation from `successEvaluationPlan.rubric`- {{endedReason}}: the ended reason of the call from `call.endedReason` """ enabled: typing.Optional[bool] = pydantic.Field(default=None) diff --git a/src/vapi/types/summary_plan.py b/src/vapi/types/summary_plan.py index 5a6f347..3b8ff21 100644 --- a/src/vapi/types/summary_plan.py +++ b/src/vapi/types/summary_plan.py @@ -31,6 +31,7 @@ class SummaryPlan(UncheckedBaseModel): Here are the template variables available: - {{transcript}}: The transcript of the call from `call.artifact.transcript` - {{systemPrompt}}: The system prompt of the call from `assistant.model.messages[type=system].content` + - {{messages}}: The messages of the call from `assistant.model.messages` - {{endedReason}}: The ended reason of the call from `call.endedReason` """ diff --git a/src/vapi/types/sync_voice_library_dto_providers_item.py b/src/vapi/types/sync_voice_library_dto_providers_item.py index c4e295a..99cd3ae 100644 --- a/src/vapi/types/sync_voice_library_dto_providers_item.py +++ b/src/vapi/types/sync_voice_library_dto_providers_item.py @@ -20,6 +20,7 @@ "tavus", "sesame", "inworld", + "minimax", ], typing.Any, ] diff --git a/src/vapi/types/target_plan.py b/src/vapi/types/target_plan.py index 252f388..84ea544 100644 --- a/src/vapi/types/target_plan.py +++ b/src/vapi/types/target_plan.py @@ -1,10 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .assistant_overrides import AssistantOverrides @@ -54,3 +56,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(TargetPlan) diff --git a/src/vapi/types/telnyx_phone_number.py b/src/vapi/types/telnyx_phone_number.py index 6815f8b..f013947 100644 --- a/src/vapi/types/telnyx_phone_number.py +++ b/src/vapi/types/telnyx_phone_number.py @@ -8,9 +8,9 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel -from .phone_number_hook_call_ringing import PhoneNumberHookCallRinging from .server import Server from .telnyx_phone_number_fallback_destination import TelnyxPhoneNumberFallbackDestination +from .telnyx_phone_number_hooks_item import TelnyxPhoneNumberHooksItem from .telnyx_phone_number_status import TelnyxPhoneNumberStatus @@ -27,7 +27,7 @@ class TelnyxPhoneNumber(UncheckedBaseModel): If this is not set and above conditions are met, the inbound call is hung up with an error message. """ - hooks: typing.Optional[typing.List[PhoneNumberHookCallRinging]] = pydantic.Field(default=None) + hooks: typing.Optional[typing.List[TelnyxPhoneNumberHooksItem]] = pydantic.Field(default=None) """ This is the hooks that will be used for incoming calls to this phone number. """ diff --git a/src/vapi/types/telnyx_phone_number_hooks_item.py b/src/vapi/types/telnyx_phone_number_hooks_item.py new file mode 100644 index 0000000..d49fe51 --- /dev/null +++ b/src/vapi/types/telnyx_phone_number_hooks_item.py @@ -0,0 +1,8 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .phone_number_hook_call_ending import PhoneNumberHookCallEnding +from .phone_number_hook_call_ringing import PhoneNumberHookCallRinging + +TelnyxPhoneNumberHooksItem = typing.Union[PhoneNumberHookCallRinging, PhoneNumberHookCallEnding] diff --git a/src/vapi/types/template.py b/src/vapi/types/template.py index 84d7921..9cd0a95 100644 --- a/src/vapi/types/template.py +++ b/src/vapi/types/template.py @@ -1,11 +1,13 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import datetime as dt import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .template_details import TemplateDetails @@ -57,3 +59,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(Template) diff --git a/src/vapi/types/template_details.py b/src/vapi/types/template_details.py index ed5f637..3af2882 100644 --- a/src/vapi/types/template_details.py +++ b/src/vapi/types/template_details.py @@ -15,6 +15,7 @@ from .create_google_calendar_check_availability_tool_dto import CreateGoogleCalendarCheckAvailabilityToolDto from .create_google_calendar_create_event_tool_dto import CreateGoogleCalendarCreateEventToolDto from .create_google_sheets_row_append_tool_dto import CreateGoogleSheetsRowAppendToolDto +from .create_handoff_tool_dto import CreateHandoffToolDto from .create_mcp_tool_dto import CreateMcpToolDto from .create_query_tool_dto import CreateQueryToolDto from .create_slack_send_message_tool_dto import CreateSlackSendMessageToolDto @@ -36,6 +37,7 @@ CreateGoogleCalendarCheckAvailabilityToolDto, CreateGoogleCalendarCreateEventToolDto, CreateGoogleSheetsRowAppendToolDto, + CreateHandoffToolDto, CreateMcpToolDto, CreateQueryToolDto, CreateSlackSendMessageToolDto, diff --git a/src/vapi/types/test_suite.py b/src/vapi/types/test_suite.py index f31a533..bee3437 100644 --- a/src/vapi/types/test_suite.py +++ b/src/vapi/types/test_suite.py @@ -1,11 +1,13 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import datetime as dt import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .target_plan import TargetPlan @@ -69,3 +71,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(TestSuite) diff --git a/src/vapi/types/test_suite_test_chat.py b/src/vapi/types/test_suite_test_chat.py index f733c5d..12f37ff 100644 --- a/src/vapi/types/test_suite_test_chat.py +++ b/src/vapi/types/test_suite_test_chat.py @@ -17,7 +17,11 @@ class TestSuiteTestChat(UncheckedBaseModel): These are the scorers used to evaluate the test. """ - type: typing.Literal["chat"] = "chat" + type: typing.Literal["chat"] = pydantic.Field(default="chat") + """ + This is the type of the test, which must be chat. + """ + id: str = pydantic.Field() """ This is the unique identifier for the test. diff --git a/src/vapi/types/test_suite_test_voice.py b/src/vapi/types/test_suite_test_voice.py index b224f48..054cdef 100644 --- a/src/vapi/types/test_suite_test_voice.py +++ b/src/vapi/types/test_suite_test_voice.py @@ -17,7 +17,11 @@ class TestSuiteTestVoice(UncheckedBaseModel): These are the scorers used to evaluate the test. """ - type: typing.Literal["voice"] = "voice" + type: typing.Literal["voice"] = pydantic.Field(default="voice") + """ + This is the type of the test, which must be voice. + """ + id: str = pydantic.Field() """ This is the unique identifier for the test. diff --git a/src/vapi/types/test_suites_paginated_response.py b/src/vapi/types/test_suites_paginated_response.py index 8a23f28..b46c365 100644 --- a/src/vapi/types/test_suites_paginated_response.py +++ b/src/vapi/types/test_suites_paginated_response.py @@ -1,9 +1,11 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.unchecked_base_model import UncheckedBaseModel from .pagination_meta import PaginationMeta from .test_suite import TestSuite @@ -21,3 +23,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(TestSuitesPaginatedResponse) diff --git a/src/vapi/types/tester_plan.py b/src/vapi/types/tester_plan.py index f544aee..b3dee45 100644 --- a/src/vapi/types/tester_plan.py +++ b/src/vapi/types/tester_plan.py @@ -1,18 +1,19 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .assistant_overrides import AssistantOverrides -from .create_assistant_dto import CreateAssistantDto class TesterPlan(UncheckedBaseModel): - assistant: typing.Optional[CreateAssistantDto] = pydantic.Field(default=None) + assistant: typing.Optional["CreateAssistantDto"] = pydantic.Field(default=None) """ Pass a transient assistant to use for the test assistant. @@ -46,3 +47,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(TesterPlan) diff --git a/src/vapi/types/text_editor_tool.py b/src/vapi/types/text_editor_tool.py index 7662be9..9ceb449 100644 --- a/src/vapi/types/text_editor_tool.py +++ b/src/vapi/types/text_editor_tool.py @@ -1,16 +1,18 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import datetime as dt import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel -from .open_ai_function import OpenAiFunction from .server import Server from .text_editor_tool_messages_item import TextEditorToolMessagesItem +from .tool_rejection_plan import ToolRejectionPlan class TextEditorTool(UncheckedBaseModel): @@ -62,13 +64,88 @@ class TextEditorTool(UncheckedBaseModel): This is the ISO 8601 date-time string of when the tool was last updated. """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ name: typing.Literal["str_replace_editor"] = pydantic.Field(default="str_replace_editor") @@ -84,3 +161,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(TextEditorTool) diff --git a/src/vapi/types/text_editor_tool_with_tool_call.py b/src/vapi/types/text_editor_tool_with_tool_call.py index 3f83066..98b1869 100644 --- a/src/vapi/types/text_editor_tool_with_tool_call.py +++ b/src/vapi/types/text_editor_tool_with_tool_call.py @@ -1,16 +1,18 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel -from .open_ai_function import OpenAiFunction from .server import Server from .text_editor_tool_with_tool_call_messages_item import TextEditorToolWithToolCallMessagesItem from .tool_call import ToolCall +from .tool_rejection_plan import ToolRejectionPlan class TextEditorToolWithToolCall(UncheckedBaseModel): @@ -52,13 +54,88 @@ class TextEditorToolWithToolCall(UncheckedBaseModel): The name of the tool, fixed to 'str_replace_editor' """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -69,3 +146,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(TextEditorToolWithToolCall) diff --git a/src/vapi/types/together_ai_model.py b/src/vapi/types/together_ai_model.py index 91dc5dc..651a04c 100644 --- a/src/vapi/types/together_ai_model.py +++ b/src/vapi/types/together_ai_model.py @@ -1,15 +1,16 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .create_custom_knowledge_base_dto import CreateCustomKnowledgeBaseDto from .open_ai_message import OpenAiMessage -from .together_ai_model_tools_item import TogetherAiModelToolsItem class TogetherAiModel(UncheckedBaseModel): @@ -18,7 +19,7 @@ class TogetherAiModel(UncheckedBaseModel): This is the starting state for the conversation. """ - tools: typing.Optional[typing.List[TogetherAiModelToolsItem]] = pydantic.Field(default=None) + tools: typing.Optional[typing.List["TogetherAiModelToolsItem"]] = pydantic.Field(default=None) """ These are the tools that the assistant can use during the call. To use existing tools, use `toolIds`. @@ -41,13 +42,6 @@ class TogetherAiModel(UncheckedBaseModel): These are the options for the knowledge base. """ - knowledge_base_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="knowledgeBaseId")] = ( - pydantic.Field(default=None) - ) - """ - This is the ID of the knowledge base the model will use. - """ - provider: typing.Literal["together-ai"] = "together-ai" model: str = pydantic.Field() """ @@ -96,3 +90,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 +from .together_ai_model_tools_item import TogetherAiModelToolsItem # noqa: E402, F401, I001 + +update_forward_refs(TogetherAiModel) diff --git a/src/vapi/types/together_ai_model_tools_item.py b/src/vapi/types/together_ai_model_tools_item.py index fb4dafa..9d8a5e5 100644 --- a/src/vapi/types/together_ai_model_tools_item.py +++ b/src/vapi/types/together_ai_model_tools_item.py @@ -1,5 +1,7 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing from .create_api_request_tool_dto import CreateApiRequestToolDto @@ -22,6 +24,8 @@ from .create_text_editor_tool_dto import CreateTextEditorToolDto from .create_transfer_call_tool_dto import CreateTransferCallToolDto +if typing.TYPE_CHECKING: + from .create_handoff_tool_dto import CreateHandoffToolDto TogetherAiModelToolsItem = typing.Union[ CreateApiRequestToolDto, CreateBashToolDto, @@ -36,6 +40,7 @@ CreateGoogleCalendarCheckAvailabilityToolDto, CreateGoogleCalendarCreateEventToolDto, CreateGoogleSheetsRowAppendToolDto, + "CreateHandoffToolDto", CreateMcpToolDto, CreateQueryToolDto, CreateSlackSendMessageToolDto, diff --git a/src/vapi/types/tool_call_hook_action.py b/src/vapi/types/tool_call_hook_action.py new file mode 100644 index 0000000..1c501cd --- /dev/null +++ b/src/vapi/types/tool_call_hook_action.py @@ -0,0 +1,66 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel + + +class ToolCallHookAction(UncheckedBaseModel): + type: typing.Literal["tool"] = pydantic.Field(default="tool") + """ + This is the type of action - must be "tool" + """ + + tool: typing.Optional["ToolCallHookActionTool"] = pydantic.Field(default=None) + """ + This is the tool to call. To use an existing tool, send `toolId` instead. + """ + + tool_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="toolId")] = pydantic.Field( + default=None + ) + """ + This is the tool to call. To use a transient tool, send `tool` instead. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 +from .tool_call_hook_action_tool import ToolCallHookActionTool # noqa: E402, F401, I001 + +update_forward_refs(ToolCallHookAction) diff --git a/src/vapi/types/tool_call_hook_action_tool.py b/src/vapi/types/tool_call_hook_action_tool.py new file mode 100644 index 0000000..28be74b --- /dev/null +++ b/src/vapi/types/tool_call_hook_action_tool.py @@ -0,0 +1,50 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +from .create_api_request_tool_dto import CreateApiRequestToolDto +from .create_bash_tool_dto import CreateBashToolDto +from .create_computer_tool_dto import CreateComputerToolDto +from .create_dtmf_tool_dto import CreateDtmfToolDto +from .create_end_call_tool_dto import CreateEndCallToolDto +from .create_function_tool_dto import CreateFunctionToolDto +from .create_go_high_level_calendar_availability_tool_dto import CreateGoHighLevelCalendarAvailabilityToolDto +from .create_go_high_level_calendar_event_create_tool_dto import CreateGoHighLevelCalendarEventCreateToolDto +from .create_go_high_level_contact_create_tool_dto import CreateGoHighLevelContactCreateToolDto +from .create_go_high_level_contact_get_tool_dto import CreateGoHighLevelContactGetToolDto +from .create_google_calendar_check_availability_tool_dto import CreateGoogleCalendarCheckAvailabilityToolDto +from .create_google_calendar_create_event_tool_dto import CreateGoogleCalendarCreateEventToolDto +from .create_google_sheets_row_append_tool_dto import CreateGoogleSheetsRowAppendToolDto +from .create_mcp_tool_dto import CreateMcpToolDto +from .create_query_tool_dto import CreateQueryToolDto +from .create_slack_send_message_tool_dto import CreateSlackSendMessageToolDto +from .create_sms_tool_dto import CreateSmsToolDto +from .create_text_editor_tool_dto import CreateTextEditorToolDto +from .create_transfer_call_tool_dto import CreateTransferCallToolDto + +if typing.TYPE_CHECKING: + from .create_handoff_tool_dto import CreateHandoffToolDto +ToolCallHookActionTool = typing.Union[ + CreateApiRequestToolDto, + CreateBashToolDto, + CreateComputerToolDto, + CreateDtmfToolDto, + CreateEndCallToolDto, + CreateFunctionToolDto, + CreateGoHighLevelCalendarAvailabilityToolDto, + CreateGoHighLevelCalendarEventCreateToolDto, + CreateGoHighLevelContactCreateToolDto, + CreateGoHighLevelContactGetToolDto, + CreateGoogleCalendarCheckAvailabilityToolDto, + CreateGoogleCalendarCreateEventToolDto, + CreateGoogleSheetsRowAppendToolDto, + "CreateHandoffToolDto", + CreateMcpToolDto, + CreateQueryToolDto, + CreateSlackSendMessageToolDto, + CreateSmsToolDto, + CreateTextEditorToolDto, + CreateTransferCallToolDto, +] diff --git a/src/vapi/types/tool_message.py b/src/vapi/types/tool_message.py index 083d5a7..b5c2a7f 100644 --- a/src/vapi/types/tool_message.py +++ b/src/vapi/types/tool_message.py @@ -28,6 +28,11 @@ class ToolMessage(UncheckedBaseModel): This is an optional name for the participant """ + metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None) + """ + This is an optional metadata for the message + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/vapi/types/tool_node.py b/src/vapi/types/tool_node.py index 365bce6..b53cb61 100644 --- a/src/vapi/types/tool_node.py +++ b/src/vapi/types/tool_node.py @@ -1,10 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .tool_node_tool import ToolNodeTool @@ -56,3 +58,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(ToolNode) diff --git a/src/vapi/types/tool_node_tool.py b/src/vapi/types/tool_node_tool.py index 88c04f5..394918c 100644 --- a/src/vapi/types/tool_node_tool.py +++ b/src/vapi/types/tool_node_tool.py @@ -15,6 +15,7 @@ from .create_google_calendar_check_availability_tool_dto import CreateGoogleCalendarCheckAvailabilityToolDto from .create_google_calendar_create_event_tool_dto import CreateGoogleCalendarCreateEventToolDto from .create_google_sheets_row_append_tool_dto import CreateGoogleSheetsRowAppendToolDto +from .create_handoff_tool_dto import CreateHandoffToolDto from .create_mcp_tool_dto import CreateMcpToolDto from .create_query_tool_dto import CreateQueryToolDto from .create_slack_send_message_tool_dto import CreateSlackSendMessageToolDto @@ -36,6 +37,7 @@ CreateGoogleCalendarCheckAvailabilityToolDto, CreateGoogleCalendarCreateEventToolDto, CreateGoogleSheetsRowAppendToolDto, + CreateHandoffToolDto, CreateMcpToolDto, CreateQueryToolDto, CreateSlackSendMessageToolDto, diff --git a/src/vapi/types/tool_rejection_plan.py b/src/vapi/types/tool_rejection_plan.py new file mode 100644 index 0000000..d53c9d0 --- /dev/null +++ b/src/vapi/types/tool_rejection_plan.py @@ -0,0 +1,37 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.unchecked_base_model import UncheckedBaseModel +from .tool_rejection_plan_conditions_item import ToolRejectionPlanConditionsItem + + +class ToolRejectionPlan(UncheckedBaseModel): + conditions: typing.Optional[typing.List[ToolRejectionPlanConditionsItem]] = pydantic.Field(default=None) + """ + This is the list of conditions that must be evaluated. + + Usage: + - If all conditions match (AND logic), the tool call is rejected. + - For OR logic at the top level, use a single 'group' condition with operator: 'OR'. + + @default [] - Empty array means tool always executes + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(ToolRejectionPlan) diff --git a/src/vapi/types/tool_rejection_plan_conditions_item.py b/src/vapi/types/tool_rejection_plan_conditions_item.py new file mode 100644 index 0000000..fad97f7 --- /dev/null +++ b/src/vapi/types/tool_rejection_plan_conditions_item.py @@ -0,0 +1,9 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .group_condition import GroupCondition +from .liquid_condition import LiquidCondition +from .regex_condition import RegexCondition + +ToolRejectionPlanConditionsItem = typing.Union[RegexCondition, LiquidCondition, GroupCondition] diff --git a/src/vapi/types/transfer_assistant.py b/src/vapi/types/transfer_assistant.py new file mode 100644 index 0000000..580afdc --- /dev/null +++ b/src/vapi/types/transfer_assistant.py @@ -0,0 +1,74 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel +from .transfer_assistant_first_message_mode import TransferAssistantFirstMessageMode +from .transfer_assistant_model import TransferAssistantModel + + +class TransferAssistant(UncheckedBaseModel): + name: typing.Optional[str] = pydantic.Field(default=None) + """ + Optional name for the transfer assistant + """ + + model: TransferAssistantModel = pydantic.Field() + """ + Model configuration for the transfer assistant + """ + + first_message: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="firstMessage")] = ( + pydantic.Field(default=None) + ) + """ + This is the first message that the transfer assistant will say. + This can also be a URL to a custom audio file. + + If unspecified, assistant will wait for user to speak and use the model to respond once they speak. + """ + + first_message_mode: typing_extensions.Annotated[ + typing.Optional[TransferAssistantFirstMessageMode], FieldMetadata(alias="firstMessageMode") + ] = pydantic.Field(default=None) + """ + This is the mode for the first message. Default is 'assistant-speaks-first'. + + Use: + - 'assistant-speaks-first' to have the assistant speak first. + - 'assistant-waits-for-user' to have the assistant wait for the user to speak first. + - 'assistant-speaks-first-with-model-generated-message' to have the assistant speak first with a message generated by the model based on the conversation state. + + @default 'assistant-speaks-first' + """ + + max_duration_seconds: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="maxDurationSeconds") + ] = pydantic.Field(default=None) + """ + This is the maximum duration in seconds for the transfer assistant conversation. + After this time, the transfer will be cancelled automatically. + @default 120 + """ + + silence_timeout_seconds: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="silenceTimeoutSeconds") + ] = pydantic.Field(default=None) + """ + This is the number of seconds of silence to wait before ending the call. Defaults to 30. + + @default 30 + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/transfer_assistant_first_message_mode.py b/src/vapi/types/transfer_assistant_first_message_mode.py new file mode 100644 index 0000000..a367292 --- /dev/null +++ b/src/vapi/types/transfer_assistant_first_message_mode.py @@ -0,0 +1,10 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +TransferAssistantFirstMessageMode = typing.Union[ + typing.Literal[ + "assistant-speaks-first", "assistant-speaks-first-with-model-generated-message", "assistant-waits-for-user" + ], + typing.Any, +] diff --git a/src/vapi/types/transfer_assistant_hook_action.py b/src/vapi/types/transfer_assistant_hook_action.py index 7416750..afeeda5 100644 --- a/src/vapi/types/transfer_assistant_hook_action.py +++ b/src/vapi/types/transfer_assistant_hook_action.py @@ -2,28 +2,4 @@ import typing -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel -from .transfer_assistant_hook_action_destination import TransferAssistantHookActionDestination - - -class TransferAssistantHookAction(UncheckedBaseModel): - type: typing.Literal["transfer"] = pydantic.Field(default="transfer") - """ - This is the type of action - must be "transfer" - """ - - destination: typing.Optional[TransferAssistantHookActionDestination] = pydantic.Field(default=None) - """ - This is the destination details for the transfer - can be a phone number or SIP URI - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow +TransferAssistantHookAction = typing.Optional[typing.Any] diff --git a/src/vapi/types/transfer_assistant_model.py b/src/vapi/types/transfer_assistant_model.py new file mode 100644 index 0000000..88227a8 --- /dev/null +++ b/src/vapi/types/transfer_assistant_model.py @@ -0,0 +1,63 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.unchecked_base_model import UncheckedBaseModel +from .transfer_assistant_model_provider import TransferAssistantModelProvider + + +class TransferAssistantModel(UncheckedBaseModel): + provider: TransferAssistantModelProvider = pydantic.Field() + """ + The model provider for the transfer assistant + """ + + model: str = pydantic.Field() + """ + The model name - must be compatible with the selected provider + """ + + messages: typing.Optional[typing.List[typing.Optional[typing.Any]]] = pydantic.Field(default=None) + """ + These are the messages used to configure the transfer assistant. + + @default: ``` + [ + { + role: 'system', + content: 'You are a transfer assistant designed to facilitate call transfers. Your core responsibility is to manage the transfer process efficiently.\n\n## Core Responsibility\n- Facilitate the transfer process by using transferSuccessful or transferCancel tools appropriately\n\n## When to Respond\n- Answer questions about the transfer process or provide summaries when specifically asked by the operator\n- Respond to direct questions about the current transfer situation\n\n## What to Avoid\n- Do not discuss topics unrelated to the transfer\n- Do not engage in general conversation\n- Keep all interactions focused on facilitating the transfer\n\n## Transfer Tools\n- Use transferSuccessful when the transfer should proceed\n- Use transferCancel when the transfer cannot be completed\n\nStay focused on your core responsibility of facilitating transfers.' + } + ]``` + + **Default Behavior:** If you don't provide any messages or don't include a system message as the first message, the default system message above will be automatically added. + + **Override Default:** To replace the default system message, provide your own system message as the first message in the array. + + **Add Context:** You can provide additional messages (user, assistant, etc.) to add context while keeping the default system message, or combine them with your custom system message. + """ + + tools: typing.Optional[typing.List[typing.Optional[typing.Any]]] = pydantic.Field(default=None) + """ + Tools available to the transfer assistant during warm-transfer-experimental. + + **Default Behavior:** The transfer assistant will ALWAYS have both `transferSuccessful` and `transferCancel` tools automatically added, regardless of what you provide here. + + **Default Tools:** + - `transferSuccessful`: "Call this function to confirm the transfer is successful and connect the customer. Use this when you detect a human has answered and is ready to take the call." + - `transferCancel`: "Call this function to cancel the transfer when no human answers or transfer should not proceed. Use this when you detect voicemail, busy signal, or no answer." + + **Customization:** You can override the default tools by providing `transferSuccessful` and/or `transferCancel` tools with custom `function` or `messages` configurations. + + **Additional Tools:** You can also provide other tools, but the two transfer tools will always be present and available to the assistant. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/transfer_assistant_model_provider.py b/src/vapi/types/transfer_assistant_model_provider.py new file mode 100644 index 0000000..c8260d1 --- /dev/null +++ b/src/vapi/types/transfer_assistant_model_provider.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +TransferAssistantModelProvider = typing.Union[typing.Literal["openai", "anthropic", "google", "custom-llm"], typing.Any] diff --git a/src/vapi/types/transfer_call_tool.py b/src/vapi/types/transfer_call_tool.py index 1297610..e9f48e6 100644 --- a/src/vapi/types/transfer_call_tool.py +++ b/src/vapi/types/transfer_call_tool.py @@ -1,14 +1,16 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import datetime as dt import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan from .transfer_call_tool_destinations_item import TransferCallToolDestinationsItem from .transfer_call_tool_messages_item import TransferCallToolMessagesItem @@ -47,13 +49,88 @@ class TransferCallTool(UncheckedBaseModel): This is the ISO 8601 date-time string of when the tool was last updated. """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -64,3 +141,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(TransferCallTool) diff --git a/src/vapi/types/transfer_cancel_tool_user_editable.py b/src/vapi/types/transfer_cancel_tool_user_editable.py new file mode 100644 index 0000000..c3295a5 --- /dev/null +++ b/src/vapi/types/transfer_cancel_tool_user_editable.py @@ -0,0 +1,125 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel +from .tool_rejection_plan import ToolRejectionPlan +from .transfer_cancel_tool_user_editable_messages_item import TransferCancelToolUserEditableMessagesItem + + +class TransferCancelToolUserEditable(UncheckedBaseModel): + messages: typing.Optional[typing.List[TransferCancelToolUserEditableMessagesItem]] = pydantic.Field(default=None) + """ + These are the messages that will be spoken to the user as the tool is running. + + For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + """ + + type: typing.Literal["transferCancel"] = pydantic.Field(default="transferCancel") + """ + The type of tool. "transferCancel" for Transfer Cancel tool. This tool can only be used during warm-transfer-experimental by the transfer assistant to cancel an ongoing transfer and return the call back to the original assistant when the transfer cannot be completed. + """ + + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) + """ + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` + + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` + + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(TransferCancelToolUserEditable) diff --git a/src/vapi/types/transfer_cancel_tool_user_editable_messages_item.py b/src/vapi/types/transfer_cancel_tool_user_editable_messages_item.py new file mode 100644 index 0000000..51a60c1 --- /dev/null +++ b/src/vapi/types/transfer_cancel_tool_user_editable_messages_item.py @@ -0,0 +1,12 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .tool_message_complete import ToolMessageComplete +from .tool_message_delayed import ToolMessageDelayed +from .tool_message_failed import ToolMessageFailed +from .tool_message_start import ToolMessageStart + +TransferCancelToolUserEditableMessagesItem = typing.Union[ + ToolMessageStart, ToolMessageComplete, ToolMessageFailed, ToolMessageDelayed +] diff --git a/src/vapi/types/transfer_hook_action.py b/src/vapi/types/transfer_hook_action.py new file mode 100644 index 0000000..057186e --- /dev/null +++ b/src/vapi/types/transfer_hook_action.py @@ -0,0 +1,29 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.unchecked_base_model import UncheckedBaseModel +from .transfer_hook_action_destination import TransferHookActionDestination + + +class TransferHookAction(UncheckedBaseModel): + type: typing.Literal["transfer"] = pydantic.Field(default="transfer") + """ + This is the type of action - must be "transfer" + """ + + destination: typing.Optional[TransferHookActionDestination] = pydantic.Field(default=None) + """ + This is the destination details for the transfer - can be a phone number or SIP URI + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/transfer_assistant_hook_action_destination.py b/src/vapi/types/transfer_hook_action_destination.py similarity index 66% rename from src/vapi/types/transfer_assistant_hook_action_destination.py rename to src/vapi/types/transfer_hook_action_destination.py index 092da09..79adb31 100644 --- a/src/vapi/types/transfer_assistant_hook_action_destination.py +++ b/src/vapi/types/transfer_hook_action_destination.py @@ -5,4 +5,4 @@ from .transfer_destination_number import TransferDestinationNumber from .transfer_destination_sip import TransferDestinationSip -TransferAssistantHookActionDestination = typing.Union[TransferDestinationNumber, TransferDestinationSip] +TransferHookActionDestination = typing.Union[TransferDestinationNumber, TransferDestinationSip] diff --git a/src/vapi/types/transfer_successful_tool_user_editable.py b/src/vapi/types/transfer_successful_tool_user_editable.py new file mode 100644 index 0000000..55bee05 --- /dev/null +++ b/src/vapi/types/transfer_successful_tool_user_editable.py @@ -0,0 +1,127 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel +from .tool_rejection_plan import ToolRejectionPlan +from .transfer_successful_tool_user_editable_messages_item import TransferSuccessfulToolUserEditableMessagesItem + + +class TransferSuccessfulToolUserEditable(UncheckedBaseModel): + messages: typing.Optional[typing.List[TransferSuccessfulToolUserEditableMessagesItem]] = pydantic.Field( + default=None + ) + """ + These are the messages that will be spoken to the user as the tool is running. + + For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + """ + + type: typing.Literal["transferSuccessful"] = pydantic.Field(default="transferSuccessful") + """ + The type of tool. "transferSuccessful" for Transfer Successful tool. This tool can only be used during warm-transfer-experimental by the transfer assistant to confirm that the transfer should proceed and finalize the handoff to the destination. + """ + + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) + """ + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` + + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` + + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(TransferSuccessfulToolUserEditable) diff --git a/src/vapi/types/transfer_successful_tool_user_editable_messages_item.py b/src/vapi/types/transfer_successful_tool_user_editable_messages_item.py new file mode 100644 index 0000000..532e2e8 --- /dev/null +++ b/src/vapi/types/transfer_successful_tool_user_editable_messages_item.py @@ -0,0 +1,12 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .tool_message_complete import ToolMessageComplete +from .tool_message_delayed import ToolMessageDelayed +from .tool_message_failed import ToolMessageFailed +from .tool_message_start import ToolMessageStart + +TransferSuccessfulToolUserEditableMessagesItem = typing.Union[ + ToolMessageStart, ToolMessageComplete, ToolMessageFailed, ToolMessageDelayed +] diff --git a/src/vapi/types/trieve_knowledge_base.py b/src/vapi/types/trieve_knowledge_base.py index 6f854a2..fab49e0 100644 --- a/src/vapi/types/trieve_knowledge_base.py +++ b/src/vapi/types/trieve_knowledge_base.py @@ -12,7 +12,13 @@ class TrieveKnowledgeBase(UncheckedBaseModel): - provider: typing.Literal["trieve"] = "trieve" + provider: typing.Literal["trieve"] = pydantic.Field(default="trieve") + """ + This knowledge base is provided by Trieve. + + To learn more about Trieve, visit https://trieve.ai. + """ + name: typing.Optional[str] = pydantic.Field(default=None) """ This is the name of the knowledge base. diff --git a/src/vapi/types/turn_latency.py b/src/vapi/types/turn_latency.py new file mode 100644 index 0000000..8c56462 --- /dev/null +++ b/src/vapi/types/turn_latency.py @@ -0,0 +1,55 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel + + +class TurnLatency(UncheckedBaseModel): + model_latency: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="modelLatency")] = ( + pydantic.Field(default=None) + ) + """ + This is the model latency for the first token. + """ + + voice_latency: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="voiceLatency")] = ( + pydantic.Field(default=None) + ) + """ + This is the voice latency from the model output. + """ + + transcriber_latency: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="transcriberLatency") + ] = pydantic.Field(default=None) + """ + This is the transcriber latency from the user speech. + """ + + endpointing_latency: typing_extensions.Annotated[ + typing.Optional[float], FieldMetadata(alias="endpointingLatency") + ] = pydantic.Field(default=None) + """ + This is the endpointing latency. + """ + + turn_latency: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="turnLatency")] = ( + pydantic.Field(default=None) + ) + """ + This is the latency for the whole turn. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/twilio_phone_number.py b/src/vapi/types/twilio_phone_number.py index db47961..ae12777 100644 --- a/src/vapi/types/twilio_phone_number.py +++ b/src/vapi/types/twilio_phone_number.py @@ -8,9 +8,9 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel -from .phone_number_hook_call_ringing import PhoneNumberHookCallRinging from .server import Server from .twilio_phone_number_fallback_destination import TwilioPhoneNumberFallbackDestination +from .twilio_phone_number_hooks_item import TwilioPhoneNumberHooksItem from .twilio_phone_number_status import TwilioPhoneNumberStatus @@ -27,7 +27,7 @@ class TwilioPhoneNumber(UncheckedBaseModel): If this is not set and above conditions are met, the inbound call is hung up with an error message. """ - hooks: typing.Optional[typing.List[PhoneNumberHookCallRinging]] = pydantic.Field(default=None) + hooks: typing.Optional[typing.List[TwilioPhoneNumberHooksItem]] = pydantic.Field(default=None) """ This is the hooks that will be used for incoming calls to this phone number. """ diff --git a/src/vapi/types/twilio_phone_number_hooks_item.py b/src/vapi/types/twilio_phone_number_hooks_item.py new file mode 100644 index 0000000..74580e1 --- /dev/null +++ b/src/vapi/types/twilio_phone_number_hooks_item.py @@ -0,0 +1,8 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .phone_number_hook_call_ending import PhoneNumberHookCallEnding +from .phone_number_hook_call_ringing import PhoneNumberHookCallRinging + +TwilioPhoneNumberHooksItem = typing.Union[PhoneNumberHookCallRinging, PhoneNumberHookCallEnding] diff --git a/src/vapi/types/update_api_request_tool_dto.py b/src/vapi/types/update_api_request_tool_dto.py index 966d7e2..b4a3370 100644 --- a/src/vapi/types/update_api_request_tool_dto.py +++ b/src/vapi/types/update_api_request_tool_dto.py @@ -1,15 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .backoff_plan import BackoffPlan from .json_schema import JsonSchema -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan from .update_api_request_tool_dto_messages_item import UpdateApiRequestToolDtoMessagesItem from .update_api_request_tool_dto_method import UpdateApiRequestToolDtoMethod from .variable_extraction_plan import VariableExtractionPlan @@ -33,13 +35,95 @@ class UpdateApiRequestToolDto(UncheckedBaseModel): @default 20 """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + credential_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="credentialId")] = ( + pydantic.Field(default=None) + ) + """ + The credential ID for API request authentication + """ + + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` + + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` + + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ name: typing.Optional[str] = pydantic.Field(default=None) @@ -66,7 +150,7 @@ class UpdateApiRequestToolDto(UncheckedBaseModel): headers: typing.Optional[JsonSchema] = pydantic.Field(default=None) """ - These are the headers to send in the request. + These are the headers to send with the request. """ backoff_plan: typing_extensions.Annotated[typing.Optional[BackoffPlan], FieldMetadata(alias="backoffPlan")] = ( @@ -161,33 +245,9 @@ class UpdateApiRequestToolDto(UncheckedBaseModel): } } ``` - - 4.2. If you hit example.com and it returns `{"name": {"first": "John", "last": "Doe"}}`, then you can specify the schema as: - - ```json - { - "schema": { - "type": "object", - "properties": { - "name": { - "type": "object", - "properties": { - "first": { - "type": "string" - }, - "last": { - "type": "string" - } - } - } - } - } - } - ``` - These will be extracted as `{{ name }}` and `{{ age }}` respectively. To emphasize, object properties are extracted as direct global variables. - 4.3. If you hit example.com and it returns `{"name": {"first": "John", "last": "Doe"}}`, then you can specify the schema as: + 4.2. If you hit example.com and it returns `{"name": {"first": "John", "last": "Doe"}}`, then you can specify the schema as: ```json { @@ -212,7 +272,7 @@ class UpdateApiRequestToolDto(UncheckedBaseModel): These will be extracted as `{{ name }}`. And, `{{ name.first }}` and `{{ name.last }}` will be accessible. - 4.4. If you hit example.com and it returns `["94123", "94124"]`, then you can specify the schema as: + 4.3. If you hit example.com and it returns `["94123", "94124"]`, then you can specify the schema as: ```json { @@ -228,7 +288,7 @@ class UpdateApiRequestToolDto(UncheckedBaseModel): This will be extracted as `{{ zipCodes }}`. To access the array items, you can use `{{ zipCodes[0] }}` and `{{ zipCodes[1] }}`. - 4.5. If you hit example.com and it returns `[{"name": "John", "age": 30, "zipCodes": ["94123", "94124"]}, {"name": "Jane", "age": 25, "zipCodes": ["94125", "94126"]}]`, then you can specify the schema as: + 4.4. If you hit example.com and it returns `[{"name": "John", "age": 30, "zipCodes": ["94123", "94124"]}, {"name": "Jane", "age": 25, "zipCodes": ["94125", "94126"]}]`, then you can specify the schema as: ```json { @@ -269,3 +329,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(UpdateApiRequestToolDto) diff --git a/src/vapi/types/update_api_request_tool_dto_method.py b/src/vapi/types/update_api_request_tool_dto_method.py index 2842f15..200a858 100644 --- a/src/vapi/types/update_api_request_tool_dto_method.py +++ b/src/vapi/types/update_api_request_tool_dto_method.py @@ -2,4 +2,4 @@ import typing -UpdateApiRequestToolDtoMethod = typing.Union[typing.Literal["POST", "GET"], typing.Any] +UpdateApiRequestToolDtoMethod = typing.Union[typing.Literal["POST", "GET", "PUT", "PATCH", "DELETE"], typing.Any] diff --git a/src/vapi/types/update_azure_open_ai_credential_dto_models_item.py b/src/vapi/types/update_azure_open_ai_credential_dto_models_item.py index 6bb4729..58245f5 100644 --- a/src/vapi/types/update_azure_open_ai_credential_dto_models_item.py +++ b/src/vapi/types/update_azure_open_ai_credential_dto_models_item.py @@ -4,6 +4,9 @@ UpdateAzureOpenAiCredentialDtoModelsItem = typing.Union[ typing.Literal[ + "gpt-5", + "gpt-5-mini", + "gpt-5-nano", "gpt-4.1-2025-04-14", "gpt-4.1-mini-2025-04-14", "gpt-4.1-nano-2025-04-14", diff --git a/src/vapi/types/update_bash_tool_dto.py b/src/vapi/types/update_bash_tool_dto.py index 16e692b..2d6decb 100644 --- a/src/vapi/types/update_bash_tool_dto.py +++ b/src/vapi/types/update_bash_tool_dto.py @@ -1,14 +1,16 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel -from .open_ai_function import OpenAiFunction from .server import Server +from .tool_rejection_plan import ToolRejectionPlan from .update_bash_tool_dto_messages_item import UpdateBashToolDtoMessagesItem @@ -40,13 +42,88 @@ class UpdateBashToolDto(UncheckedBaseModel): - Webhook expects a response with tool call result. """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ name: typing.Optional[typing.Literal["bash"]] = pydantic.Field(default=None) @@ -62,3 +139,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(UpdateBashToolDto) diff --git a/src/vapi/types/update_byo_phone_number_dto.py b/src/vapi/types/update_byo_phone_number_dto.py index 1efc49e..5595650 100644 --- a/src/vapi/types/update_byo_phone_number_dto.py +++ b/src/vapi/types/update_byo_phone_number_dto.py @@ -7,9 +7,9 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel -from .phone_number_hook_call_ringing import PhoneNumberHookCallRinging from .server import Server from .update_byo_phone_number_dto_fallback_destination import UpdateByoPhoneNumberDtoFallbackDestination +from .update_byo_phone_number_dto_hooks_item import UpdateByoPhoneNumberDtoHooksItem class UpdateByoPhoneNumberDto(UncheckedBaseModel): @@ -25,7 +25,7 @@ class UpdateByoPhoneNumberDto(UncheckedBaseModel): If this is not set and above conditions are met, the inbound call is hung up with an error message. """ - hooks: typing.Optional[typing.List[PhoneNumberHookCallRinging]] = pydantic.Field(default=None) + hooks: typing.Optional[typing.List[UpdateByoPhoneNumberDtoHooksItem]] = pydantic.Field(default=None) """ This is the hooks that will be used for incoming calls to this phone number. """ diff --git a/src/vapi/types/update_byo_phone_number_dto_hooks_item.py b/src/vapi/types/update_byo_phone_number_dto_hooks_item.py new file mode 100644 index 0000000..f2082de --- /dev/null +++ b/src/vapi/types/update_byo_phone_number_dto_hooks_item.py @@ -0,0 +1,8 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .phone_number_hook_call_ending import PhoneNumberHookCallEnding +from .phone_number_hook_call_ringing import PhoneNumberHookCallRinging + +UpdateByoPhoneNumberDtoHooksItem = typing.Union[PhoneNumberHookCallRinging, PhoneNumberHookCallEnding] diff --git a/src/vapi/types/update_computer_tool_dto.py b/src/vapi/types/update_computer_tool_dto.py index fb7dccd..529e07d 100644 --- a/src/vapi/types/update_computer_tool_dto.py +++ b/src/vapi/types/update_computer_tool_dto.py @@ -1,14 +1,16 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel -from .open_ai_function import OpenAiFunction from .server import Server +from .tool_rejection_plan import ToolRejectionPlan from .update_computer_tool_dto_messages_item import UpdateComputerToolDtoMessagesItem @@ -40,13 +42,88 @@ class UpdateComputerToolDto(UncheckedBaseModel): - Webhook expects a response with tool call result. """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ name: typing.Optional[typing.Literal["computer"]] = pydantic.Field(default=None) @@ -83,3 +160,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(UpdateComputerToolDto) diff --git a/src/vapi/types/update_custom_credential_dto.py b/src/vapi/types/update_custom_credential_dto.py new file mode 100644 index 0000000..0ab1348 --- /dev/null +++ b/src/vapi/types/update_custom_credential_dto.py @@ -0,0 +1,33 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel +from .update_custom_credential_dto_authentication_plan import UpdateCustomCredentialDtoAuthenticationPlan + + +class UpdateCustomCredentialDto(UncheckedBaseModel): + authentication_plan: typing_extensions.Annotated[ + typing.Optional[UpdateCustomCredentialDtoAuthenticationPlan], FieldMetadata(alias="authenticationPlan") + ] = pydantic.Field(default=None) + """ + This is the authentication plan. Supports OAuth2 RFC 6749, HMAC signing, and Bearer authentication. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of credential. This is just for your reference. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/update_custom_credential_dto_authentication_plan.py b/src/vapi/types/update_custom_credential_dto_authentication_plan.py new file mode 100644 index 0000000..6f3dc80 --- /dev/null +++ b/src/vapi/types/update_custom_credential_dto_authentication_plan.py @@ -0,0 +1,11 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .bearer_authentication_plan import BearerAuthenticationPlan +from .hmac_authentication_plan import HmacAuthenticationPlan +from .o_auth_2_authentication_plan import OAuth2AuthenticationPlan + +UpdateCustomCredentialDtoAuthenticationPlan = typing.Union[ + OAuth2AuthenticationPlan, HmacAuthenticationPlan, BearerAuthenticationPlan +] diff --git a/src/vapi/types/update_dtmf_tool_dto.py b/src/vapi/types/update_dtmf_tool_dto.py index 3bd6bc7..67a4e47 100644 --- a/src/vapi/types/update_dtmf_tool_dto.py +++ b/src/vapi/types/update_dtmf_tool_dto.py @@ -1,11 +1,15 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan from .update_dtmf_tool_dto_messages_item import UpdateDtmfToolDtoMessagesItem @@ -17,13 +21,88 @@ class UpdateDtmfToolDto(UncheckedBaseModel): For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -34,3 +113,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(UpdateDtmfToolDto) diff --git a/src/vapi/types/update_end_call_tool_dto.py b/src/vapi/types/update_end_call_tool_dto.py index c353b63..2fc4aaa 100644 --- a/src/vapi/types/update_end_call_tool_dto.py +++ b/src/vapi/types/update_end_call_tool_dto.py @@ -1,11 +1,15 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan from .update_end_call_tool_dto_messages_item import UpdateEndCallToolDtoMessagesItem @@ -17,13 +21,88 @@ class UpdateEndCallToolDto(UncheckedBaseModel): For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -34,3 +113,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(UpdateEndCallToolDto) diff --git a/src/vapi/types/update_function_tool_dto.py b/src/vapi/types/update_function_tool_dto.py index eb2b9e7..1c95824 100644 --- a/src/vapi/types/update_function_tool_dto.py +++ b/src/vapi/types/update_function_tool_dto.py @@ -1,14 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .open_ai_function import OpenAiFunction from .server import Server +from .tool_rejection_plan import ToolRejectionPlan from .update_function_tool_dto_messages_item import UpdateFunctionToolDtoMessagesItem @@ -46,13 +49,93 @@ class UpdateFunctionToolDto(UncheckedBaseModel): - Webhook expects a response with tool call result. """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` + + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` + """ + + function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + """ + This is the function definition of the tool. """ if IS_PYDANTIC_V2: @@ -63,3 +146,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(UpdateFunctionToolDto) diff --git a/src/vapi/types/update_ghl_tool_dto.py b/src/vapi/types/update_ghl_tool_dto.py index 8e1e541..64f25f5 100644 --- a/src/vapi/types/update_ghl_tool_dto.py +++ b/src/vapi/types/update_ghl_tool_dto.py @@ -1,12 +1,16 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .ghl_tool_metadata import GhlToolMetadata -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan from .update_ghl_tool_dto_messages_item import UpdateGhlToolDtoMessagesItem @@ -18,13 +22,88 @@ class UpdateGhlToolDto(UncheckedBaseModel): For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ metadata: typing.Optional[GhlToolMetadata] = None @@ -37,3 +116,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(UpdateGhlToolDto) diff --git a/src/vapi/types/update_go_high_level_calendar_availability_tool_dto.py b/src/vapi/types/update_go_high_level_calendar_availability_tool_dto.py index d02c302..45e292a 100644 --- a/src/vapi/types/update_go_high_level_calendar_availability_tool_dto.py +++ b/src/vapi/types/update_go_high_level_calendar_availability_tool_dto.py @@ -1,11 +1,15 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan from .update_go_high_level_calendar_availability_tool_dto_messages_item import ( UpdateGoHighLevelCalendarAvailabilityToolDtoMessagesItem, ) @@ -21,13 +25,88 @@ class UpdateGoHighLevelCalendarAvailabilityToolDto(UncheckedBaseModel): For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -38,3 +117,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(UpdateGoHighLevelCalendarAvailabilityToolDto) diff --git a/src/vapi/types/update_go_high_level_calendar_event_create_tool_dto.py b/src/vapi/types/update_go_high_level_calendar_event_create_tool_dto.py index 43f229d..45e13b7 100644 --- a/src/vapi/types/update_go_high_level_calendar_event_create_tool_dto.py +++ b/src/vapi/types/update_go_high_level_calendar_event_create_tool_dto.py @@ -1,11 +1,15 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan from .update_go_high_level_calendar_event_create_tool_dto_messages_item import ( UpdateGoHighLevelCalendarEventCreateToolDtoMessagesItem, ) @@ -21,13 +25,88 @@ class UpdateGoHighLevelCalendarEventCreateToolDto(UncheckedBaseModel): For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -38,3 +117,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(UpdateGoHighLevelCalendarEventCreateToolDto) diff --git a/src/vapi/types/update_go_high_level_contact_create_tool_dto.py b/src/vapi/types/update_go_high_level_contact_create_tool_dto.py index db1f0de..ab9260c 100644 --- a/src/vapi/types/update_go_high_level_contact_create_tool_dto.py +++ b/src/vapi/types/update_go_high_level_contact_create_tool_dto.py @@ -1,11 +1,15 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan from .update_go_high_level_contact_create_tool_dto_messages_item import ( UpdateGoHighLevelContactCreateToolDtoMessagesItem, ) @@ -21,13 +25,88 @@ class UpdateGoHighLevelContactCreateToolDto(UncheckedBaseModel): For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -38,3 +117,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(UpdateGoHighLevelContactCreateToolDto) diff --git a/src/vapi/types/update_go_high_level_contact_get_tool_dto.py b/src/vapi/types/update_go_high_level_contact_get_tool_dto.py index 237571c..b87abfd 100644 --- a/src/vapi/types/update_go_high_level_contact_get_tool_dto.py +++ b/src/vapi/types/update_go_high_level_contact_get_tool_dto.py @@ -1,11 +1,15 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan from .update_go_high_level_contact_get_tool_dto_messages_item import UpdateGoHighLevelContactGetToolDtoMessagesItem @@ -19,13 +23,88 @@ class UpdateGoHighLevelContactGetToolDto(UncheckedBaseModel): For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -36,3 +115,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(UpdateGoHighLevelContactGetToolDto) diff --git a/src/vapi/types/update_google_calendar_check_availability_tool_dto.py b/src/vapi/types/update_google_calendar_check_availability_tool_dto.py index c99bcca..2573481 100644 --- a/src/vapi/types/update_google_calendar_check_availability_tool_dto.py +++ b/src/vapi/types/update_google_calendar_check_availability_tool_dto.py @@ -1,11 +1,15 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan from .update_google_calendar_check_availability_tool_dto_messages_item import ( UpdateGoogleCalendarCheckAvailabilityToolDtoMessagesItem, ) @@ -21,13 +25,88 @@ class UpdateGoogleCalendarCheckAvailabilityToolDto(UncheckedBaseModel): For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -38,3 +117,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(UpdateGoogleCalendarCheckAvailabilityToolDto) diff --git a/src/vapi/types/update_google_calendar_create_event_tool_dto.py b/src/vapi/types/update_google_calendar_create_event_tool_dto.py index 9c29dc6..21675b9 100644 --- a/src/vapi/types/update_google_calendar_create_event_tool_dto.py +++ b/src/vapi/types/update_google_calendar_create_event_tool_dto.py @@ -1,11 +1,15 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan from .update_google_calendar_create_event_tool_dto_messages_item import ( UpdateGoogleCalendarCreateEventToolDtoMessagesItem, ) @@ -21,13 +25,88 @@ class UpdateGoogleCalendarCreateEventToolDto(UncheckedBaseModel): For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -38,3 +117,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(UpdateGoogleCalendarCreateEventToolDto) diff --git a/src/vapi/types/update_google_sheets_row_append_tool_dto.py b/src/vapi/types/update_google_sheets_row_append_tool_dto.py index 799a459..5597c65 100644 --- a/src/vapi/types/update_google_sheets_row_append_tool_dto.py +++ b/src/vapi/types/update_google_sheets_row_append_tool_dto.py @@ -1,11 +1,15 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan from .update_google_sheets_row_append_tool_dto_messages_item import UpdateGoogleSheetsRowAppendToolDtoMessagesItem @@ -19,13 +23,88 @@ class UpdateGoogleSheetsRowAppendToolDto(UncheckedBaseModel): For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -36,3 +115,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(UpdateGoogleSheetsRowAppendToolDto) diff --git a/src/vapi/types/update_handoff_tool_dto.py b/src/vapi/types/update_handoff_tool_dto.py new file mode 100644 index 0000000..56525c7 --- /dev/null +++ b/src/vapi/types/update_handoff_tool_dto.py @@ -0,0 +1,314 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel +from .tool_rejection_plan import ToolRejectionPlan +from .update_handoff_tool_dto_destinations_item import UpdateHandoffToolDtoDestinationsItem +from .update_handoff_tool_dto_messages_item import UpdateHandoffToolDtoMessagesItem + + +class UpdateHandoffToolDto(UncheckedBaseModel): + messages: typing.Optional[typing.List[UpdateHandoffToolDtoMessagesItem]] = pydantic.Field(default=None) + """ + These are the messages that will be spoken to the user as the tool is running. + + For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. + """ + + destinations: typing.Optional[typing.List[UpdateHandoffToolDtoDestinationsItem]] = pydantic.Field(default=None) + """ + These are the destinations that the call can be handed off to. + + Usage: + 1. Single destination + + Use `assistantId` to handoff the call to a saved assistant, or `assistantName` to handoff the call to an assistant in the same squad. + + ```json + { + "tools": [ + { + "type": "handoff", + "destinations": [ + { + "type": "assistant", + "assistantId": "assistant-123", // or "assistantName": "Assistant123" + "description": "customer wants to be handed off to assistant-123", + "contextEngineeringPlan": { + "type": "all" + } + } + ], + } + ] + } + ``` + + 2. Multiple destinations + + 2.1. Multiple Tools, Each With One Destination (OpenAI recommended) + + ```json + { + "tools": [ + { + "type": "handoff", + "destinations": [ + { + "type": "assistant", + "assistantId": "assistant-123", + "description": "customer wants to be handed off to assistant-123", + "contextEngineeringPlan": { + "type": "all" + } + }, + ], + }, + { + "type": "handoff", + "destinations": [ + { + "type": "assistant", + "assistantId": "assistant-456", + "description": "customer wants to be handed off to assistant-456", + "contextEngineeringPlan": { + "type": "all" + } + } + ], + } + ] + } + ``` + + 2.2. One Tool, Multiple Destinations (Anthropic recommended) + + ```json + { + "tools": [ + { + "type": "handoff", + "destinations": [ + { + "type": "assistant", + "assistantId": "assistant-123", + "description": "customer wants to be handed off to assistant-123", + "contextEngineeringPlan": { + "type": "all" + } + }, + { + "type": "assistant", + "assistantId": "assistant-456", + "description": "customer wants to be handed off to assistant-456", + "contextEngineeringPlan": { + "type": "all" + } + } + ], + } + ] + } + ``` + + 3. Dynamic destination + + 3.1 To determine the destination dynamically, supply a `dynamic` handoff destination type and a `server` object. + VAPI will send a handoff-destination-request webhook to the `server.url`. + The response from the server will be used as the destination (if valid). + + ```json + { + "tools": [ + { + "type": "handoff", + "destinations": [ + { + "type": "dynamic", + "server": { + "url": "https://example.com" + } + } + ], + } + ] + } + ``` + + 3.2. To pass custom parameters to the server, you can use the `function` object. + + ```json + { + "tools": [ + { + "type": "handoff", + "destinations": [ + { + "type": "dynamic", + "server": { + "url": "https://example.com" + }, + } + ], + "function": { + "name": "handoff", + "description": "Call this function when the customer is ready to be handed off to the next assistant", + "parameters": { + "type": "object", + "properties": { + "destination": { + "type": "string", + "description": "Use dynamic when customer is ready to be handed off to the next assistant", + "enum": ["dynamic"] + }, + "customerAreaCode": { + "type": "number", + "description": "Area code of the customer" + }, + "customerIntent": { + "type": "string", + "enum": ["new-customer", "existing-customer"], + "description": "Use new-customer when customer is a new customer, existing-customer when customer is an existing customer" + }, + "customerSentiment": { + "type": "string", + "enum": ["positive", "negative", "neutral"], + "description": "Use positive when customer is happy, negative when customer is unhappy, neutral when customer is neutral" + } + } + } + } + } + ] + } + ``` + + The properties `customerAreaCode`, `customerIntent`, and `customerSentiment` will be passed to the server in the webhook request body. + """ + + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) + """ + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` + + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` + + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(UpdateHandoffToolDto) diff --git a/src/vapi/types/update_handoff_tool_dto_destinations_item.py b/src/vapi/types/update_handoff_tool_dto_destinations_item.py new file mode 100644 index 0000000..d71e106 --- /dev/null +++ b/src/vapi/types/update_handoff_tool_dto_destinations_item.py @@ -0,0 +1,8 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .handoff_destination_assistant import HandoffDestinationAssistant +from .handoff_destination_dynamic import HandoffDestinationDynamic + +UpdateHandoffToolDtoDestinationsItem = typing.Union[HandoffDestinationAssistant, HandoffDestinationDynamic] diff --git a/src/vapi/types/update_handoff_tool_dto_messages_item.py b/src/vapi/types/update_handoff_tool_dto_messages_item.py new file mode 100644 index 0000000..c03d404 --- /dev/null +++ b/src/vapi/types/update_handoff_tool_dto_messages_item.py @@ -0,0 +1,12 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .tool_message_complete import ToolMessageComplete +from .tool_message_delayed import ToolMessageDelayed +from .tool_message_failed import ToolMessageFailed +from .tool_message_start import ToolMessageStart + +UpdateHandoffToolDtoMessagesItem = typing.Union[ + ToolMessageStart, ToolMessageComplete, ToolMessageFailed, ToolMessageDelayed +] diff --git a/src/vapi/types/update_inworld_credential_dto.py b/src/vapi/types/update_inworld_credential_dto.py new file mode 100644 index 0000000..0eb96ce --- /dev/null +++ b/src/vapi/types/update_inworld_credential_dto.py @@ -0,0 +1,32 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel + + +class UpdateInworldCredentialDto(UncheckedBaseModel): + api_key: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="apiKey")] = pydantic.Field( + default=None + ) + """ + This is the Inworld Basic (Base64) authentication token. This is not returned in the API. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of credential. This is just for your reference. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/update_make_tool_dto.py b/src/vapi/types/update_make_tool_dto.py index a4e8e76..45f79de 100644 --- a/src/vapi/types/update_make_tool_dto.py +++ b/src/vapi/types/update_make_tool_dto.py @@ -1,12 +1,16 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .make_tool_metadata import MakeToolMetadata -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan from .update_make_tool_dto_messages_item import UpdateMakeToolDtoMessagesItem @@ -18,13 +22,88 @@ class UpdateMakeToolDto(UncheckedBaseModel): For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ metadata: typing.Optional[MakeToolMetadata] = None @@ -37,3 +116,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(UpdateMakeToolDto) diff --git a/src/vapi/types/update_mcp_tool_dto.py b/src/vapi/types/update_mcp_tool_dto.py index 6cd3e62..075498e 100644 --- a/src/vapi/types/update_mcp_tool_dto.py +++ b/src/vapi/types/update_mcp_tool_dto.py @@ -1,13 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .mcp_tool_metadata import McpToolMetadata -from .open_ai_function import OpenAiFunction from .server import Server +from .tool_rejection_plan import ToolRejectionPlan from .update_mcp_tool_dto_messages_item import UpdateMcpToolDtoMessagesItem @@ -32,13 +36,88 @@ class UpdateMcpToolDto(UncheckedBaseModel): - Webhook expects a response with tool call result. """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ metadata: typing.Optional[McpToolMetadata] = None @@ -51,3 +130,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(UpdateMcpToolDto) diff --git a/src/vapi/types/update_output_tool_dto.py b/src/vapi/types/update_output_tool_dto.py index b6d2b52..2324c7f 100644 --- a/src/vapi/types/update_output_tool_dto.py +++ b/src/vapi/types/update_output_tool_dto.py @@ -1,11 +1,15 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan from .update_output_tool_dto_messages_item import UpdateOutputToolDtoMessagesItem @@ -17,13 +21,88 @@ class UpdateOutputToolDto(UncheckedBaseModel): For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -34,3 +113,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(UpdateOutputToolDto) diff --git a/src/vapi/types/update_query_tool_dto.py b/src/vapi/types/update_query_tool_dto.py index 42363ff..c0d7feb 100644 --- a/src/vapi/types/update_query_tool_dto.py +++ b/src/vapi/types/update_query_tool_dto.py @@ -1,14 +1,16 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .knowledge_base import KnowledgeBase -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan from .update_query_tool_dto_messages_item import UpdateQueryToolDtoMessagesItem @@ -27,13 +29,88 @@ class UpdateQueryToolDto(UncheckedBaseModel): The knowledge bases to query """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -44,3 +121,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(UpdateQueryToolDto) diff --git a/src/vapi/types/update_slack_send_message_tool_dto.py b/src/vapi/types/update_slack_send_message_tool_dto.py index 02492f8..2d1559a 100644 --- a/src/vapi/types/update_slack_send_message_tool_dto.py +++ b/src/vapi/types/update_slack_send_message_tool_dto.py @@ -1,11 +1,15 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan from .update_slack_send_message_tool_dto_messages_item import UpdateSlackSendMessageToolDtoMessagesItem @@ -17,13 +21,88 @@ class UpdateSlackSendMessageToolDto(UncheckedBaseModel): For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -34,3 +113,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(UpdateSlackSendMessageToolDto) diff --git a/src/vapi/types/update_sms_tool_dto.py b/src/vapi/types/update_sms_tool_dto.py index 291b9e0..d8be17e 100644 --- a/src/vapi/types/update_sms_tool_dto.py +++ b/src/vapi/types/update_sms_tool_dto.py @@ -1,11 +1,15 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan from .update_sms_tool_dto_messages_item import UpdateSmsToolDtoMessagesItem @@ -17,13 +21,88 @@ class UpdateSmsToolDto(UncheckedBaseModel): For some tools, this is auto-filled based on special fields like `tool.destinations`. For others like the function tool, these can be custom configured. """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -34,3 +113,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(UpdateSmsToolDto) diff --git a/src/vapi/types/update_telnyx_phone_number_dto.py b/src/vapi/types/update_telnyx_phone_number_dto.py index 0bc6fd5..c1e43e6 100644 --- a/src/vapi/types/update_telnyx_phone_number_dto.py +++ b/src/vapi/types/update_telnyx_phone_number_dto.py @@ -7,9 +7,9 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel -from .phone_number_hook_call_ringing import PhoneNumberHookCallRinging from .server import Server from .update_telnyx_phone_number_dto_fallback_destination import UpdateTelnyxPhoneNumberDtoFallbackDestination +from .update_telnyx_phone_number_dto_hooks_item import UpdateTelnyxPhoneNumberDtoHooksItem class UpdateTelnyxPhoneNumberDto(UncheckedBaseModel): @@ -25,7 +25,7 @@ class UpdateTelnyxPhoneNumberDto(UncheckedBaseModel): If this is not set and above conditions are met, the inbound call is hung up with an error message. """ - hooks: typing.Optional[typing.List[PhoneNumberHookCallRinging]] = pydantic.Field(default=None) + hooks: typing.Optional[typing.List[UpdateTelnyxPhoneNumberDtoHooksItem]] = pydantic.Field(default=None) """ This is the hooks that will be used for incoming calls to this phone number. """ diff --git a/src/vapi/types/update_telnyx_phone_number_dto_hooks_item.py b/src/vapi/types/update_telnyx_phone_number_dto_hooks_item.py new file mode 100644 index 0000000..31f166f --- /dev/null +++ b/src/vapi/types/update_telnyx_phone_number_dto_hooks_item.py @@ -0,0 +1,8 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .phone_number_hook_call_ending import PhoneNumberHookCallEnding +from .phone_number_hook_call_ringing import PhoneNumberHookCallRinging + +UpdateTelnyxPhoneNumberDtoHooksItem = typing.Union[PhoneNumberHookCallRinging, PhoneNumberHookCallEnding] diff --git a/src/vapi/types/update_test_suite_dto.py b/src/vapi/types/update_test_suite_dto.py new file mode 100644 index 0000000..61b6f34 --- /dev/null +++ b/src/vapi/types/update_test_suite_dto.py @@ -0,0 +1,79 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel +from .target_plan import TargetPlan +from .tester_plan import TesterPlan + + +class UpdateTestSuiteDto(UncheckedBaseModel): + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of the test suite. + """ + + phone_number_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="phoneNumberId")] = ( + pydantic.Field(default=None) + ) + """ + This is the phone number ID associated with this test suite. + """ + + tester_plan: typing_extensions.Annotated[typing.Optional[TesterPlan], FieldMetadata(alias="testerPlan")] = ( + pydantic.Field(default=None) + ) + """ + Override the default tester plan by providing custom assistant configuration for the test agent. + + We recommend only using this if you are confident, as we have already set sensible defaults on the tester plan. + """ + + target_plan: typing_extensions.Annotated[typing.Optional[TargetPlan], FieldMetadata(alias="targetPlan")] = ( + pydantic.Field(default=None) + ) + """ + These are the configuration for the assistant / phone number that is being tested. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(UpdateTestSuiteDto) diff --git a/src/vapi/types/update_test_suite_run_dto.py b/src/vapi/types/update_test_suite_run_dto.py new file mode 100644 index 0000000..d8e26df --- /dev/null +++ b/src/vapi/types/update_test_suite_run_dto.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.unchecked_base_model import UncheckedBaseModel + + +class UpdateTestSuiteRunDto(UncheckedBaseModel): + name: typing.Optional[str] = pydantic.Field(default=None) + """ + This is the name of the test suite run. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/types/update_test_suite_test_chat_dto.py b/src/vapi/types/update_test_suite_test_chat_dto.py index 1882a26..fbd1939 100644 --- a/src/vapi/types/update_test_suite_test_chat_dto.py +++ b/src/vapi/types/update_test_suite_test_chat_dto.py @@ -16,7 +16,11 @@ class UpdateTestSuiteTestChatDto(UncheckedBaseModel): These are the scorers used to evaluate the test. """ - type: typing.Literal["chat"] = "chat" + type: typing.Optional[typing.Literal["chat"]] = pydantic.Field(default=None) + """ + This is the type of the test, which must be chat. + """ + name: typing.Optional[str] = pydantic.Field(default=None) """ This is the name of the test. diff --git a/src/vapi/types/update_test_suite_test_voice_dto.py b/src/vapi/types/update_test_suite_test_voice_dto.py index b85fe37..574d01a 100644 --- a/src/vapi/types/update_test_suite_test_voice_dto.py +++ b/src/vapi/types/update_test_suite_test_voice_dto.py @@ -16,7 +16,11 @@ class UpdateTestSuiteTestVoiceDto(UncheckedBaseModel): These are the scorers used to evaluate the test. """ - type: typing.Literal["voice"] = "voice" + type: typing.Optional[typing.Literal["voice"]] = pydantic.Field(default=None) + """ + This is the type of the test, which must be voice. + """ + name: typing.Optional[str] = pydantic.Field(default=None) """ This is the name of the test. diff --git a/src/vapi/types/update_text_editor_tool_dto.py b/src/vapi/types/update_text_editor_tool_dto.py index 2b425b4..516f048 100644 --- a/src/vapi/types/update_text_editor_tool_dto.py +++ b/src/vapi/types/update_text_editor_tool_dto.py @@ -1,14 +1,16 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel -from .open_ai_function import OpenAiFunction from .server import Server +from .tool_rejection_plan import ToolRejectionPlan from .update_text_editor_tool_dto_messages_item import UpdateTextEditorToolDtoMessagesItem @@ -40,13 +42,88 @@ class UpdateTextEditorToolDto(UncheckedBaseModel): - Webhook expects a response with tool call result. """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ name: typing.Optional[typing.Literal["str_replace_editor"]] = pydantic.Field(default=None) @@ -62,3 +139,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(UpdateTextEditorToolDto) diff --git a/src/vapi/types/update_tool_template_dto.py b/src/vapi/types/update_tool_template_dto.py index 25f855e..6fbeb1c 100644 --- a/src/vapi/types/update_tool_template_dto.py +++ b/src/vapi/types/update_tool_template_dto.py @@ -1,10 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .tool_template_metadata import ToolTemplateMetadata @@ -37,3 +39,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(UpdateToolTemplateDto) diff --git a/src/vapi/types/update_tool_template_dto_details.py b/src/vapi/types/update_tool_template_dto_details.py index 7d577a2..af9c417 100644 --- a/src/vapi/types/update_tool_template_dto_details.py +++ b/src/vapi/types/update_tool_template_dto_details.py @@ -15,6 +15,7 @@ from .create_google_calendar_check_availability_tool_dto import CreateGoogleCalendarCheckAvailabilityToolDto from .create_google_calendar_create_event_tool_dto import CreateGoogleCalendarCreateEventToolDto from .create_google_sheets_row_append_tool_dto import CreateGoogleSheetsRowAppendToolDto +from .create_handoff_tool_dto import CreateHandoffToolDto from .create_mcp_tool_dto import CreateMcpToolDto from .create_query_tool_dto import CreateQueryToolDto from .create_slack_send_message_tool_dto import CreateSlackSendMessageToolDto @@ -36,6 +37,7 @@ CreateGoogleCalendarCheckAvailabilityToolDto, CreateGoogleCalendarCreateEventToolDto, CreateGoogleSheetsRowAppendToolDto, + CreateHandoffToolDto, CreateMcpToolDto, CreateQueryToolDto, CreateSlackSendMessageToolDto, diff --git a/src/vapi/types/update_transfer_call_tool_dto.py b/src/vapi/types/update_transfer_call_tool_dto.py index 7d890e8..960d3b4 100644 --- a/src/vapi/types/update_transfer_call_tool_dto.py +++ b/src/vapi/types/update_transfer_call_tool_dto.py @@ -1,11 +1,15 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel -from .open_ai_function import OpenAiFunction +from .tool_rejection_plan import ToolRejectionPlan from .update_transfer_call_tool_dto_destinations_item import UpdateTransferCallToolDtoDestinationsItem from .update_transfer_call_tool_dto_messages_item import UpdateTransferCallToolDtoMessagesItem @@ -23,13 +27,88 @@ class UpdateTransferCallToolDto(UncheckedBaseModel): These are the destinations that the call can be transferred to. If no destinations are provided, server.url will be used to get the transfer destination once the tool is called. """ - function: typing.Optional[OpenAiFunction] = pydantic.Field(default=None) + rejection_plan: typing_extensions.Annotated[ + typing.Optional[ToolRejectionPlan], FieldMetadata(alias="rejectionPlan") + ] = pydantic.Field(default=None) """ - This is the function definition of the tool. + This is the plan to reject a tool call based on the conversation state. + + // Example 1: Reject endCall if user didn't say goodbye + ```json + { + conditions: [{ + type: 'regex', + regex: '(?i)\\b(bye|goodbye|farewell|see you later|take care)\\b', + target: { position: -1, role: 'user' }, + negate: true // Reject if pattern does NOT match + }] + } + ``` + + // Example 2: Reject transfer if user is actually asking a question + ```json + { + conditions: [{ + type: 'regex', + regex: '\\?', + target: { position: -1, role: 'user' } + }] + } + ``` - For `endCall`, `transferCall`, and `dtmf` tools, this is auto-filled based on tool-specific fields like `tool.destinations`. But, even in those cases, you can provide a custom function definition for advanced use cases. + // Example 3: Reject transfer if user didn't mention transfer recently + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 5 %} + {% assign userMessages = recentMessages | where: 'role', 'user' %} + {% assign mentioned = false %} + {% for msg in userMessages %} + {% if msg.content contains 'transfer' or msg.content contains 'connect' or msg.content contains 'speak to' %} + {% assign mentioned = true %} + {% break %} + {% endif %} + {% endfor %} + {% if mentioned %} + false + {% else %} + true + {% endif %}` + }] + } + ``` - An example of an advanced use case is if you want to customize the message that's spoken for `endCall` tool. You can specify a function where it returns an argument "reason". Then, in `messages` array, you can have many "request-complete" messages. One of these messages will be triggered if the `messages[].conditions` matches the "reason" argument. + // Example 4: Reject endCall if the bot is looping and trying to exit + ```json + { + conditions: [{ + type: 'liquid', + liquid: `{% assign recentMessages = messages | last: 6 %} + {% assign userMessages = recentMessages | where: 'role', 'user' | reverse %} + {% if userMessages.size < 3 %} + false + {% else %} + {% assign msg1 = userMessages[0].content | downcase %} + {% assign msg2 = userMessages[1].content | downcase %} + {% assign msg3 = userMessages[2].content | downcase %} + {% comment %} Check for repetitive messages {% endcomment %} + {% if msg1 == msg2 or msg1 == msg3 or msg2 == msg3 %} + true + {% comment %} Check for common loop phrases {% endcomment %} + {% elsif msg1 contains 'cool thanks' or msg2 contains 'cool thanks' or msg3 contains 'cool thanks' %} + true + {% elsif msg1 contains 'okay thanks' or msg2 contains 'okay thanks' or msg3 contains 'okay thanks' %} + true + {% elsif msg1 contains 'got it' or msg2 contains 'got it' or msg3 contains 'got it' %} + true + {% else %} + false + {% endif %} + {% endif %}` + }] + } + ``` """ if IS_PYDANTIC_V2: @@ -40,3 +119,8 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .group_condition import GroupCondition # noqa: E402, F401, I001 + +update_forward_refs(UpdateTransferCallToolDto) diff --git a/src/vapi/types/update_twilio_phone_number_dto.py b/src/vapi/types/update_twilio_phone_number_dto.py index ef0802c..242601e 100644 --- a/src/vapi/types/update_twilio_phone_number_dto.py +++ b/src/vapi/types/update_twilio_phone_number_dto.py @@ -7,9 +7,9 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel -from .phone_number_hook_call_ringing import PhoneNumberHookCallRinging from .server import Server from .update_twilio_phone_number_dto_fallback_destination import UpdateTwilioPhoneNumberDtoFallbackDestination +from .update_twilio_phone_number_dto_hooks_item import UpdateTwilioPhoneNumberDtoHooksItem class UpdateTwilioPhoneNumberDto(UncheckedBaseModel): @@ -25,7 +25,7 @@ class UpdateTwilioPhoneNumberDto(UncheckedBaseModel): If this is not set and above conditions are met, the inbound call is hung up with an error message. """ - hooks: typing.Optional[typing.List[PhoneNumberHookCallRinging]] = pydantic.Field(default=None) + hooks: typing.Optional[typing.List[UpdateTwilioPhoneNumberDtoHooksItem]] = pydantic.Field(default=None) """ This is the hooks that will be used for incoming calls to this phone number. """ diff --git a/src/vapi/types/update_twilio_phone_number_dto_hooks_item.py b/src/vapi/types/update_twilio_phone_number_dto_hooks_item.py new file mode 100644 index 0000000..bc54e57 --- /dev/null +++ b/src/vapi/types/update_twilio_phone_number_dto_hooks_item.py @@ -0,0 +1,8 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .phone_number_hook_call_ending import PhoneNumberHookCallEnding +from .phone_number_hook_call_ringing import PhoneNumberHookCallRinging + +UpdateTwilioPhoneNumberDtoHooksItem = typing.Union[PhoneNumberHookCallRinging, PhoneNumberHookCallEnding] diff --git a/src/vapi/types/update_vapi_phone_number_dto.py b/src/vapi/types/update_vapi_phone_number_dto.py index 4e56096..8cae116 100644 --- a/src/vapi/types/update_vapi_phone_number_dto.py +++ b/src/vapi/types/update_vapi_phone_number_dto.py @@ -7,10 +7,10 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel -from .phone_number_hook_call_ringing import PhoneNumberHookCallRinging from .server import Server from .sip_authentication import SipAuthentication from .update_vapi_phone_number_dto_fallback_destination import UpdateVapiPhoneNumberDtoFallbackDestination +from .update_vapi_phone_number_dto_hooks_item import UpdateVapiPhoneNumberDtoHooksItem class UpdateVapiPhoneNumberDto(UncheckedBaseModel): @@ -26,7 +26,7 @@ class UpdateVapiPhoneNumberDto(UncheckedBaseModel): If this is not set and above conditions are met, the inbound call is hung up with an error message. """ - hooks: typing.Optional[typing.List[PhoneNumberHookCallRinging]] = pydantic.Field(default=None) + hooks: typing.Optional[typing.List[UpdateVapiPhoneNumberDtoHooksItem]] = pydantic.Field(default=None) """ This is the hooks that will be used for incoming calls to this phone number. """ diff --git a/src/vapi/types/update_vapi_phone_number_dto_hooks_item.py b/src/vapi/types/update_vapi_phone_number_dto_hooks_item.py new file mode 100644 index 0000000..1db1be2 --- /dev/null +++ b/src/vapi/types/update_vapi_phone_number_dto_hooks_item.py @@ -0,0 +1,8 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .phone_number_hook_call_ending import PhoneNumberHookCallEnding +from .phone_number_hook_call_ringing import PhoneNumberHookCallRinging + +UpdateVapiPhoneNumberDtoHooksItem = typing.Union[PhoneNumberHookCallRinging, PhoneNumberHookCallEnding] diff --git a/src/vapi/types/update_vonage_phone_number_dto.py b/src/vapi/types/update_vonage_phone_number_dto.py index d0311a0..1430032 100644 --- a/src/vapi/types/update_vonage_phone_number_dto.py +++ b/src/vapi/types/update_vonage_phone_number_dto.py @@ -7,9 +7,9 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel -from .phone_number_hook_call_ringing import PhoneNumberHookCallRinging from .server import Server from .update_vonage_phone_number_dto_fallback_destination import UpdateVonagePhoneNumberDtoFallbackDestination +from .update_vonage_phone_number_dto_hooks_item import UpdateVonagePhoneNumberDtoHooksItem class UpdateVonagePhoneNumberDto(UncheckedBaseModel): @@ -25,7 +25,7 @@ class UpdateVonagePhoneNumberDto(UncheckedBaseModel): If this is not set and above conditions are met, the inbound call is hung up with an error message. """ - hooks: typing.Optional[typing.List[PhoneNumberHookCallRinging]] = pydantic.Field(default=None) + hooks: typing.Optional[typing.List[UpdateVonagePhoneNumberDtoHooksItem]] = pydantic.Field(default=None) """ This is the hooks that will be used for incoming calls to this phone number. """ diff --git a/src/vapi/types/update_vonage_phone_number_dto_hooks_item.py b/src/vapi/types/update_vonage_phone_number_dto_hooks_item.py new file mode 100644 index 0000000..81a6fec --- /dev/null +++ b/src/vapi/types/update_vonage_phone_number_dto_hooks_item.py @@ -0,0 +1,8 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .phone_number_hook_call_ending import PhoneNumberHookCallEnding +from .phone_number_hook_call_ringing import PhoneNumberHookCallRinging + +UpdateVonagePhoneNumberDtoHooksItem = typing.Union[PhoneNumberHookCallRinging, PhoneNumberHookCallEnding] diff --git a/src/vapi/types/update_webhook_credential_dto.py b/src/vapi/types/update_webhook_credential_dto.py index 51260e6..36e7bef 100644 --- a/src/vapi/types/update_webhook_credential_dto.py +++ b/src/vapi/types/update_webhook_credential_dto.py @@ -15,7 +15,7 @@ class UpdateWebhookCredentialDto(UncheckedBaseModel): typing.Optional[UpdateWebhookCredentialDtoAuthenticationPlan], FieldMetadata(alias="authenticationPlan") ] = pydantic.Field(default=None) """ - This is the authentication plan. Supports OAuth2 RFC 6749 and HMAC signing. + This is the authentication plan. Supports OAuth2 RFC 6749, HMAC signing, and Bearer authentication. """ name: typing.Optional[str] = pydantic.Field(default=None) diff --git a/src/vapi/types/update_webhook_credential_dto_authentication_plan.py b/src/vapi/types/update_webhook_credential_dto_authentication_plan.py index 0d8aeb3..2692e69 100644 --- a/src/vapi/types/update_webhook_credential_dto_authentication_plan.py +++ b/src/vapi/types/update_webhook_credential_dto_authentication_plan.py @@ -2,7 +2,10 @@ import typing +from .bearer_authentication_plan import BearerAuthenticationPlan from .hmac_authentication_plan import HmacAuthenticationPlan from .o_auth_2_authentication_plan import OAuth2AuthenticationPlan -UpdateWebhookCredentialDtoAuthenticationPlan = typing.Union[OAuth2AuthenticationPlan, HmacAuthenticationPlan] +UpdateWebhookCredentialDtoAuthenticationPlan = typing.Union[ + OAuth2AuthenticationPlan, HmacAuthenticationPlan, BearerAuthenticationPlan +] diff --git a/src/vapi/types/update_workflow_dto.py b/src/vapi/types/update_workflow_dto.py new file mode 100644 index 0000000..67bf0b5 --- /dev/null +++ b/src/vapi/types/update_workflow_dto.py @@ -0,0 +1,218 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +import typing_extensions +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ..core.serialization import FieldMetadata +from ..core.unchecked_base_model import UncheckedBaseModel +from .analysis_plan import AnalysisPlan +from .artifact_plan import ArtifactPlan +from .background_speech_denoising_plan import BackgroundSpeechDenoisingPlan +from .compliance_plan import CompliancePlan +from .edge import Edge +from .keypad_input_plan import KeypadInputPlan +from .langfuse_observability_plan import LangfuseObservabilityPlan +from .monitor_plan import MonitorPlan +from .server import Server +from .start_speaking_plan import StartSpeakingPlan +from .stop_speaking_plan import StopSpeakingPlan +from .update_workflow_dto_background_sound import UpdateWorkflowDtoBackgroundSound +from .update_workflow_dto_credentials_item import UpdateWorkflowDtoCredentialsItem +from .update_workflow_dto_hooks_item import UpdateWorkflowDtoHooksItem +from .update_workflow_dto_model import UpdateWorkflowDtoModel +from .update_workflow_dto_nodes_item import UpdateWorkflowDtoNodesItem +from .update_workflow_dto_transcriber import UpdateWorkflowDtoTranscriber +from .update_workflow_dto_voice import UpdateWorkflowDtoVoice + + +class UpdateWorkflowDto(UncheckedBaseModel): + nodes: typing.Optional[typing.List[UpdateWorkflowDtoNodesItem]] = None + model: typing.Optional[UpdateWorkflowDtoModel] = pydantic.Field(default=None) + """ + This is the model for the workflow. + + This can be overridden at node level using `nodes[n].model`. + """ + + transcriber: typing.Optional[UpdateWorkflowDtoTranscriber] = pydantic.Field(default=None) + """ + This is the transcriber for the workflow. + + This can be overridden at node level using `nodes[n].transcriber`. + """ + + voice: typing.Optional[UpdateWorkflowDtoVoice] = pydantic.Field(default=None) + """ + This is the voice for the workflow. + + This can be overridden at node level using `nodes[n].voice`. + """ + + observability_plan: typing_extensions.Annotated[ + typing.Optional[LangfuseObservabilityPlan], FieldMetadata(alias="observabilityPlan") + ] = pydantic.Field(default=None) + """ + This is the plan for observability of workflow's calls. + + Currently, only Langfuse is supported. + """ + + background_sound: typing_extensions.Annotated[ + typing.Optional[UpdateWorkflowDtoBackgroundSound], FieldMetadata(alias="backgroundSound") + ] = pydantic.Field(default=None) + """ + This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'. + You can also provide a custom sound by providing a URL to an audio file. + """ + + hooks: typing.Optional[typing.List[UpdateWorkflowDtoHooksItem]] = pydantic.Field(default=None) + """ + This is a set of actions that will be performed on certain events. + """ + + credentials: typing.Optional[typing.List[UpdateWorkflowDtoCredentialsItem]] = pydantic.Field(default=None) + """ + These are dynamic credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can supplement an additional credentials using this. Dynamic credentials override existing credentials. + """ + + name: typing.Optional[str] = None + edges: typing.Optional[typing.List[Edge]] = None + global_prompt: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="globalPrompt")] = None + server: typing.Optional[Server] = pydantic.Field(default=None) + """ + This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema. + + The order of precedence is: + + 1. tool.server + 2. workflow.server / assistant.server + 3. phoneNumber.server + 4. org.server + """ + + compliance_plan: typing_extensions.Annotated[ + typing.Optional[CompliancePlan], FieldMetadata(alias="compliancePlan") + ] = pydantic.Field(default=None) + """ + This is the compliance plan for the workflow. It allows you to configure HIPAA and other compliance settings. + """ + + analysis_plan: typing_extensions.Annotated[typing.Optional[AnalysisPlan], FieldMetadata(alias="analysisPlan")] = ( + pydantic.Field(default=None) + ) + """ + This is the plan for analysis of workflow's calls. Stored in `call.analysis`. + """ + + artifact_plan: typing_extensions.Annotated[typing.Optional[ArtifactPlan], FieldMetadata(alias="artifactPlan")] = ( + pydantic.Field(default=None) + ) + """ + This is the plan for artifacts generated during workflow's calls. Stored in `call.artifact`. + """ + + start_speaking_plan: typing_extensions.Annotated[ + typing.Optional[StartSpeakingPlan], FieldMetadata(alias="startSpeakingPlan") + ] = pydantic.Field(default=None) + """ + This is the plan for when the workflow nodes should start talking. + + You should configure this if you're running into these issues: + - The assistant is too slow to start talking after the customer is done speaking. + - The assistant is too fast to start talking after the customer is done speaking. + - The assistant is so fast that it's actually interrupting the customer. + """ + + stop_speaking_plan: typing_extensions.Annotated[ + typing.Optional[StopSpeakingPlan], FieldMetadata(alias="stopSpeakingPlan") + ] = pydantic.Field(default=None) + """ + This is the plan for when workflow nodes should stop talking on customer interruption. + + You should configure this if you're running into these issues: + - The assistant is too slow to recognize customer's interruption. + - The assistant is too fast to recognize customer's interruption. + - The assistant is getting interrupted by phrases that are just acknowledgments. + - The assistant is getting interrupted by background noises. + - The assistant is not properly stopping -- it starts talking right after getting interrupted. + """ + + monitor_plan: typing_extensions.Annotated[typing.Optional[MonitorPlan], FieldMetadata(alias="monitorPlan")] = ( + pydantic.Field(default=None) + ) + """ + This is the plan for real-time monitoring of the workflow's calls. + + Usage: + - To enable live listening of the workflow's calls, set `monitorPlan.listenEnabled` to `true`. + - To enable live control of the workflow's calls, set `monitorPlan.controlEnabled` to `true`. + """ + + background_speech_denoising_plan: typing_extensions.Annotated[ + typing.Optional[BackgroundSpeechDenoisingPlan], FieldMetadata(alias="backgroundSpeechDenoisingPlan") + ] = pydantic.Field(default=None) + """ + This enables filtering of noise and background speech while the user is talking. + + Features: + - Smart denoising using Krisp + - Fourier denoising + + Both can be used together. Order of precedence: + - Smart denoising + - Fourier denoising + """ + + credential_ids: typing_extensions.Annotated[ + typing.Optional[typing.List[str]], FieldMetadata(alias="credentialIds") + ] = pydantic.Field(default=None) + """ + These are the credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can provide a subset using this. + """ + + keypad_input_plan: typing_extensions.Annotated[ + typing.Optional[KeypadInputPlan], FieldMetadata(alias="keypadInputPlan") + ] = pydantic.Field(default=None) + """ + This is the plan for keypad input handling during workflow calls. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(UpdateWorkflowDto) diff --git a/src/vapi/workflow/types/update_workflow_dto_background_sound.py b/src/vapi/types/update_workflow_dto_background_sound.py similarity index 100% rename from src/vapi/workflow/types/update_workflow_dto_background_sound.py rename to src/vapi/types/update_workflow_dto_background_sound.py diff --git a/src/vapi/workflow/types/update_workflow_dto_background_sound_zero.py b/src/vapi/types/update_workflow_dto_background_sound_zero.py similarity index 100% rename from src/vapi/workflow/types/update_workflow_dto_background_sound_zero.py rename to src/vapi/types/update_workflow_dto_background_sound_zero.py diff --git a/src/vapi/types/update_workflow_dto_credentials_item.py b/src/vapi/types/update_workflow_dto_credentials_item.py new file mode 100644 index 0000000..20626dc --- /dev/null +++ b/src/vapi/types/update_workflow_dto_credentials_item.py @@ -0,0 +1,113 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .create_anthropic_credential_dto import CreateAnthropicCredentialDto +from .create_anyscale_credential_dto import CreateAnyscaleCredentialDto +from .create_assembly_ai_credential_dto import CreateAssemblyAiCredentialDto +from .create_azure_credential_dto import CreateAzureCredentialDto +from .create_azure_open_ai_credential_dto import CreateAzureOpenAiCredentialDto +from .create_byo_sip_trunk_credential_dto import CreateByoSipTrunkCredentialDto +from .create_cartesia_credential_dto import CreateCartesiaCredentialDto +from .create_cerebras_credential_dto import CreateCerebrasCredentialDto +from .create_cloudflare_credential_dto import CreateCloudflareCredentialDto +from .create_custom_credential_dto import CreateCustomCredentialDto +from .create_custom_llm_credential_dto import CreateCustomLlmCredentialDto +from .create_deep_infra_credential_dto import CreateDeepInfraCredentialDto +from .create_deep_seek_credential_dto import CreateDeepSeekCredentialDto +from .create_deepgram_credential_dto import CreateDeepgramCredentialDto +from .create_eleven_labs_credential_dto import CreateElevenLabsCredentialDto +from .create_gcp_credential_dto import CreateGcpCredentialDto +from .create_gladia_credential_dto import CreateGladiaCredentialDto +from .create_go_high_level_credential_dto import CreateGoHighLevelCredentialDto +from .create_go_high_level_mcp_credential_dto import CreateGoHighLevelMcpCredentialDto +from .create_google_calendar_o_auth_2_authorization_credential_dto import ( + CreateGoogleCalendarOAuth2AuthorizationCredentialDto, +) +from .create_google_calendar_o_auth_2_client_credential_dto import CreateGoogleCalendarOAuth2ClientCredentialDto +from .create_google_credential_dto import CreateGoogleCredentialDto +from .create_google_sheets_o_auth_2_authorization_credential_dto import ( + CreateGoogleSheetsOAuth2AuthorizationCredentialDto, +) +from .create_groq_credential_dto import CreateGroqCredentialDto +from .create_hume_credential_dto import CreateHumeCredentialDto +from .create_inflection_ai_credential_dto import CreateInflectionAiCredentialDto +from .create_inworld_credential_dto import CreateInworldCredentialDto +from .create_langfuse_credential_dto import CreateLangfuseCredentialDto +from .create_lmnt_credential_dto import CreateLmntCredentialDto +from .create_make_credential_dto import CreateMakeCredentialDto +from .create_minimax_credential_dto import CreateMinimaxCredentialDto +from .create_mistral_credential_dto import CreateMistralCredentialDto +from .create_neuphonic_credential_dto import CreateNeuphonicCredentialDto +from .create_open_ai_credential_dto import CreateOpenAiCredentialDto +from .create_open_router_credential_dto import CreateOpenRouterCredentialDto +from .create_perplexity_ai_credential_dto import CreatePerplexityAiCredentialDto +from .create_play_ht_credential_dto import CreatePlayHtCredentialDto +from .create_rime_ai_credential_dto import CreateRimeAiCredentialDto +from .create_runpod_credential_dto import CreateRunpodCredentialDto +from .create_s_3_credential_dto import CreateS3CredentialDto +from .create_slack_o_auth_2_authorization_credential_dto import CreateSlackOAuth2AuthorizationCredentialDto +from .create_smallest_ai_credential_dto import CreateSmallestAiCredentialDto +from .create_speechmatics_credential_dto import CreateSpeechmaticsCredentialDto +from .create_supabase_credential_dto import CreateSupabaseCredentialDto +from .create_tavus_credential_dto import CreateTavusCredentialDto +from .create_together_ai_credential_dto import CreateTogetherAiCredentialDto +from .create_trieve_credential_dto import CreateTrieveCredentialDto +from .create_twilio_credential_dto import CreateTwilioCredentialDto +from .create_vonage_credential_dto import CreateVonageCredentialDto +from .create_webhook_credential_dto import CreateWebhookCredentialDto +from .create_x_ai_credential_dto import CreateXAiCredentialDto + +UpdateWorkflowDtoCredentialsItem = typing.Union[ + CreateElevenLabsCredentialDto, + CreateAnthropicCredentialDto, + CreateAnyscaleCredentialDto, + CreateAssemblyAiCredentialDto, + CreateAzureOpenAiCredentialDto, + CreateAzureCredentialDto, + CreateByoSipTrunkCredentialDto, + CreateCartesiaCredentialDto, + CreateCerebrasCredentialDto, + CreateCloudflareCredentialDto, + CreateCustomLlmCredentialDto, + CreateDeepgramCredentialDto, + CreateDeepInfraCredentialDto, + CreateDeepSeekCredentialDto, + CreateGcpCredentialDto, + CreateGladiaCredentialDto, + CreateGoHighLevelCredentialDto, + CreateGoogleCredentialDto, + CreateGroqCredentialDto, + CreateInflectionAiCredentialDto, + CreateLangfuseCredentialDto, + CreateLmntCredentialDto, + CreateMakeCredentialDto, + CreateOpenAiCredentialDto, + CreateOpenRouterCredentialDto, + CreatePerplexityAiCredentialDto, + CreatePlayHtCredentialDto, + CreateRimeAiCredentialDto, + CreateRunpodCredentialDto, + CreateS3CredentialDto, + CreateSupabaseCredentialDto, + CreateSmallestAiCredentialDto, + CreateTavusCredentialDto, + CreateTogetherAiCredentialDto, + CreateTwilioCredentialDto, + CreateVonageCredentialDto, + CreateWebhookCredentialDto, + CreateCustomCredentialDto, + CreateXAiCredentialDto, + CreateNeuphonicCredentialDto, + CreateHumeCredentialDto, + CreateMistralCredentialDto, + CreateSpeechmaticsCredentialDto, + CreateTrieveCredentialDto, + CreateGoogleCalendarOAuth2ClientCredentialDto, + CreateGoogleCalendarOAuth2AuthorizationCredentialDto, + CreateGoogleSheetsOAuth2AuthorizationCredentialDto, + CreateSlackOAuth2AuthorizationCredentialDto, + CreateGoHighLevelMcpCredentialDto, + CreateInworldCredentialDto, + CreateMinimaxCredentialDto, +] diff --git a/src/vapi/types/update_workflow_dto_hooks_item.py b/src/vapi/types/update_workflow_dto_hooks_item.py new file mode 100644 index 0000000..3954a71 --- /dev/null +++ b/src/vapi/types/update_workflow_dto_hooks_item.py @@ -0,0 +1,15 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted +from .call_hook_call_ending import CallHookCallEnding +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout + +UpdateWorkflowDtoHooksItem = typing.Union[ + CallHookCallEnding, + CallHookAssistantSpeechInterrupted, + CallHookCustomerSpeechInterrupted, + CallHookCustomerSpeechTimeout, +] diff --git a/src/vapi/types/update_workflow_dto_model.py b/src/vapi/types/update_workflow_dto_model.py new file mode 100644 index 0000000..27fb78c --- /dev/null +++ b/src/vapi/types/update_workflow_dto_model.py @@ -0,0 +1,12 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .workflow_anthropic_model import WorkflowAnthropicModel +from .workflow_custom_model import WorkflowCustomModel +from .workflow_google_model import WorkflowGoogleModel +from .workflow_open_ai_model import WorkflowOpenAiModel + +UpdateWorkflowDtoModel = typing.Union[ + WorkflowOpenAiModel, WorkflowAnthropicModel, WorkflowGoogleModel, WorkflowCustomModel +] diff --git a/src/vapi/workflow/types/update_workflow_dto_nodes_item.py b/src/vapi/types/update_workflow_dto_nodes_item.py similarity index 61% rename from src/vapi/workflow/types/update_workflow_dto_nodes_item.py rename to src/vapi/types/update_workflow_dto_nodes_item.py index 1c70b0b..e927c11 100644 --- a/src/vapi/workflow/types/update_workflow_dto_nodes_item.py +++ b/src/vapi/types/update_workflow_dto_nodes_item.py @@ -2,7 +2,7 @@ import typing -from ...types.conversation_node import ConversationNode -from ...types.tool_node import ToolNode +from .conversation_node import ConversationNode +from .tool_node import ToolNode UpdateWorkflowDtoNodesItem = typing.Union[ConversationNode, ToolNode] diff --git a/src/vapi/types/update_workflow_dto_transcriber.py b/src/vapi/types/update_workflow_dto_transcriber.py new file mode 100644 index 0000000..578a6e2 --- /dev/null +++ b/src/vapi/types/update_workflow_dto_transcriber.py @@ -0,0 +1,29 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .assembly_ai_transcriber import AssemblyAiTranscriber +from .azure_speech_transcriber import AzureSpeechTranscriber +from .cartesia_transcriber import CartesiaTranscriber +from .custom_transcriber import CustomTranscriber +from .deepgram_transcriber import DeepgramTranscriber +from .eleven_labs_transcriber import ElevenLabsTranscriber +from .gladia_transcriber import GladiaTranscriber +from .google_transcriber import GoogleTranscriber +from .open_ai_transcriber import OpenAiTranscriber +from .speechmatics_transcriber import SpeechmaticsTranscriber +from .talkscriber_transcriber import TalkscriberTranscriber + +UpdateWorkflowDtoTranscriber = typing.Union[ + AssemblyAiTranscriber, + AzureSpeechTranscriber, + CustomTranscriber, + DeepgramTranscriber, + ElevenLabsTranscriber, + GladiaTranscriber, + GoogleTranscriber, + SpeechmaticsTranscriber, + TalkscriberTranscriber, + OpenAiTranscriber, + CartesiaTranscriber, +] diff --git a/src/vapi/types/update_workflow_dto_voice.py b/src/vapi/types/update_workflow_dto_voice.py new file mode 100644 index 0000000..80cdf80 --- /dev/null +++ b/src/vapi/types/update_workflow_dto_voice.py @@ -0,0 +1,41 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .azure_voice import AzureVoice +from .cartesia_voice import CartesiaVoice +from .custom_voice import CustomVoice +from .deepgram_voice import DeepgramVoice +from .eleven_labs_voice import ElevenLabsVoice +from .hume_voice import HumeVoice +from .inworld_voice import InworldVoice +from .lmnt_voice import LmntVoice +from .minimax_voice import MinimaxVoice +from .neuphonic_voice import NeuphonicVoice +from .open_ai_voice import OpenAiVoice +from .play_ht_voice import PlayHtVoice +from .rime_ai_voice import RimeAiVoice +from .sesame_voice import SesameVoice +from .smallest_ai_voice import SmallestAiVoice +from .tavus_voice import TavusVoice +from .vapi_voice import VapiVoice + +UpdateWorkflowDtoVoice = typing.Union[ + AzureVoice, + CartesiaVoice, + CustomVoice, + DeepgramVoice, + ElevenLabsVoice, + HumeVoice, + LmntVoice, + NeuphonicVoice, + OpenAiVoice, + PlayHtVoice, + RimeAiVoice, + SmallestAiVoice, + TavusVoice, + VapiVoice, + SesameVoice, + InworldVoice, + MinimaxVoice, +] diff --git a/src/vapi/types/user_message.py b/src/vapi/types/user_message.py index f3db71c..069e5a1 100644 --- a/src/vapi/types/user_message.py +++ b/src/vapi/types/user_message.py @@ -40,6 +40,27 @@ class UserMessage(UncheckedBaseModel): The duration of the message in seconds. """ + is_filtered: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="isFiltered")] = pydantic.Field( + default=None + ) + """ + Indicates if the message was filtered for security reasons. + """ + + detected_threats: typing_extensions.Annotated[ + typing.Optional[typing.List[str]], FieldMetadata(alias="detectedThreats") + ] = pydantic.Field(default=None) + """ + List of detected security threats if the message was filtered. + """ + + original_message: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="originalMessage")] = ( + pydantic.Field(default=None) + ) + """ + The original message before filtering (only included if content was filtered). + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/vapi/types/vapi_model.py b/src/vapi/types/vapi_model.py index 71b375a..6463b19 100644 --- a/src/vapi/types/vapi_model.py +++ b/src/vapi/types/vapi_model.py @@ -1,10 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .create_custom_knowledge_base_dto import CreateCustomKnowledgeBaseDto @@ -42,13 +44,6 @@ class VapiModel(UncheckedBaseModel): These are the options for the knowledge base. """ - knowledge_base_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="knowledgeBaseId")] = ( - pydantic.Field(default=None) - ) - """ - This is the ID of the knowledge base the model will use. - """ - provider: typing.Literal["vapi"] = "vapi" workflow_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="workflowId")] = pydantic.Field( default=None @@ -109,3 +104,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(VapiModel) diff --git a/src/vapi/types/vapi_model_tools_item.py b/src/vapi/types/vapi_model_tools_item.py index 5cbb93f..e8ac6ca 100644 --- a/src/vapi/types/vapi_model_tools_item.py +++ b/src/vapi/types/vapi_model_tools_item.py @@ -15,6 +15,7 @@ from .create_google_calendar_check_availability_tool_dto import CreateGoogleCalendarCheckAvailabilityToolDto from .create_google_calendar_create_event_tool_dto import CreateGoogleCalendarCreateEventToolDto from .create_google_sheets_row_append_tool_dto import CreateGoogleSheetsRowAppendToolDto +from .create_handoff_tool_dto import CreateHandoffToolDto from .create_mcp_tool_dto import CreateMcpToolDto from .create_query_tool_dto import CreateQueryToolDto from .create_slack_send_message_tool_dto import CreateSlackSendMessageToolDto @@ -36,6 +37,7 @@ CreateGoogleCalendarCheckAvailabilityToolDto, CreateGoogleCalendarCreateEventToolDto, CreateGoogleSheetsRowAppendToolDto, + CreateHandoffToolDto, CreateMcpToolDto, CreateQueryToolDto, CreateSlackSendMessageToolDto, diff --git a/src/vapi/types/vapi_phone_number.py b/src/vapi/types/vapi_phone_number.py index df8b701..3bdea19 100644 --- a/src/vapi/types/vapi_phone_number.py +++ b/src/vapi/types/vapi_phone_number.py @@ -8,10 +8,10 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel -from .phone_number_hook_call_ringing import PhoneNumberHookCallRinging from .server import Server from .sip_authentication import SipAuthentication from .vapi_phone_number_fallback_destination import VapiPhoneNumberFallbackDestination +from .vapi_phone_number_hooks_item import VapiPhoneNumberHooksItem from .vapi_phone_number_status import VapiPhoneNumberStatus @@ -28,7 +28,7 @@ class VapiPhoneNumber(UncheckedBaseModel): If this is not set and above conditions are met, the inbound call is hung up with an error message. """ - hooks: typing.Optional[typing.List[PhoneNumberHookCallRinging]] = pydantic.Field(default=None) + hooks: typing.Optional[typing.List[VapiPhoneNumberHooksItem]] = pydantic.Field(default=None) """ This is the hooks that will be used for incoming calls to this phone number. """ diff --git a/src/vapi/types/vapi_phone_number_hooks_item.py b/src/vapi/types/vapi_phone_number_hooks_item.py new file mode 100644 index 0000000..5653d93 --- /dev/null +++ b/src/vapi/types/vapi_phone_number_hooks_item.py @@ -0,0 +1,8 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .phone_number_hook_call_ending import PhoneNumberHookCallEnding +from .phone_number_hook_call_ringing import PhoneNumberHookCallRinging + +VapiPhoneNumberHooksItem = typing.Union[PhoneNumberHookCallRinging, PhoneNumberHookCallEnding] diff --git a/src/vapi/types/vapi_voicemail_detection_plan.py b/src/vapi/types/vapi_voicemail_detection_plan.py index 797ed2b..c715f9a 100644 --- a/src/vapi/types/vapi_voicemail_detection_plan.py +++ b/src/vapi/types/vapi_voicemail_detection_plan.py @@ -7,6 +7,7 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel +from .vapi_voicemail_detection_plan_type import VapiVoicemailDetectionPlanType from .voicemail_detection_backoff_plan import VoicemailDetectionBackoffPlan @@ -38,6 +39,14 @@ class VapiVoicemailDetectionPlan(UncheckedBaseModel): This is the backoff plan for the voicemail detection. """ + type: typing.Optional[VapiVoicemailDetectionPlanType] = pydantic.Field(default=None) + """ + This is the detection type to use for voicemail detection. + - 'audio': Uses native audio models (default) + - 'transcript': Uses ASR/transcript-based detection + @default 'audio' (audio detection) + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/vapi/types/vapi_voicemail_detection_plan_type.py b/src/vapi/types/vapi_voicemail_detection_plan_type.py new file mode 100644 index 0000000..29d3512 --- /dev/null +++ b/src/vapi/types/vapi_voicemail_detection_plan_type.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +VapiVoicemailDetectionPlanType = typing.Union[typing.Literal["audio", "transcript"], typing.Any] diff --git a/src/vapi/types/variable_extraction_plan.py b/src/vapi/types/variable_extraction_plan.py index d3088c9..3f545b0 100644 --- a/src/vapi/types/variable_extraction_plan.py +++ b/src/vapi/types/variable_extraction_plan.py @@ -123,7 +123,7 @@ class VariableExtractionPlan(UncheckedBaseModel): "value": "Hello {{name}}, welcome to {{company}}!" }, { - "key": "customerEmail", + "key": "customerCity", "value": "{{addresses[0].city}}" }, { @@ -134,7 +134,7 @@ class VariableExtractionPlan(UncheckedBaseModel): } ``` - This will create variables `customerName`, `fullName`, `customerEmail`, `greeting`, and `something`. To access these variables, you can reference them as `{{customerName}}`, `{{fullName}}`, `{{customerEmail}}`, `{{greeting}}`, and `{{something}}`. + This will create variables `customerName`, `fullName`, `greeting`, `customerCity`, and `something`. To access these variables, you can reference them as `{{customerName}}`, `{{fullName}}`, `{{greeting}}`, `{{customerCity}}`, and `{{something}}`. """ if IS_PYDANTIC_V2: diff --git a/src/vapi/types/vonage_phone_number.py b/src/vapi/types/vonage_phone_number.py index d0b1157..31d6f94 100644 --- a/src/vapi/types/vonage_phone_number.py +++ b/src/vapi/types/vonage_phone_number.py @@ -8,9 +8,9 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel -from .phone_number_hook_call_ringing import PhoneNumberHookCallRinging from .server import Server from .vonage_phone_number_fallback_destination import VonagePhoneNumberFallbackDestination +from .vonage_phone_number_hooks_item import VonagePhoneNumberHooksItem from .vonage_phone_number_status import VonagePhoneNumberStatus @@ -27,7 +27,7 @@ class VonagePhoneNumber(UncheckedBaseModel): If this is not set and above conditions are met, the inbound call is hung up with an error message. """ - hooks: typing.Optional[typing.List[PhoneNumberHookCallRinging]] = pydantic.Field(default=None) + hooks: typing.Optional[typing.List[VonagePhoneNumberHooksItem]] = pydantic.Field(default=None) """ This is the hooks that will be used for incoming calls to this phone number. """ diff --git a/src/vapi/types/vonage_phone_number_hooks_item.py b/src/vapi/types/vonage_phone_number_hooks_item.py new file mode 100644 index 0000000..0215c6e --- /dev/null +++ b/src/vapi/types/vonage_phone_number_hooks_item.py @@ -0,0 +1,8 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .phone_number_hook_call_ending import PhoneNumberHookCallEnding +from .phone_number_hook_call_ringing import PhoneNumberHookCallRinging + +VonagePhoneNumberHooksItem = typing.Union[PhoneNumberHookCallRinging, PhoneNumberHookCallEnding] diff --git a/src/vapi/types/webhook_credential.py b/src/vapi/types/webhook_credential.py index b39992b..329357e 100644 --- a/src/vapi/types/webhook_credential.py +++ b/src/vapi/types/webhook_credential.py @@ -18,7 +18,7 @@ class WebhookCredential(UncheckedBaseModel): WebhookCredentialAuthenticationPlan, FieldMetadata(alias="authenticationPlan") ] = pydantic.Field() """ - This is the authentication plan. Supports OAuth2 RFC 6749 and HMAC signing. + This is the authentication plan. Supports OAuth2 RFC 6749, HMAC signing, and Bearer authentication. """ id: str = pydantic.Field() diff --git a/src/vapi/types/webhook_credential_authentication_plan.py b/src/vapi/types/webhook_credential_authentication_plan.py index 574cedc..2ef6f29 100644 --- a/src/vapi/types/webhook_credential_authentication_plan.py +++ b/src/vapi/types/webhook_credential_authentication_plan.py @@ -2,7 +2,10 @@ import typing +from .bearer_authentication_plan import BearerAuthenticationPlan from .hmac_authentication_plan import HmacAuthenticationPlan from .o_auth_2_authentication_plan import OAuth2AuthenticationPlan -WebhookCredentialAuthenticationPlan = typing.Union[OAuth2AuthenticationPlan, HmacAuthenticationPlan] +WebhookCredentialAuthenticationPlan = typing.Union[ + OAuth2AuthenticationPlan, HmacAuthenticationPlan, BearerAuthenticationPlan +] diff --git a/src/vapi/types/workflow.py b/src/vapi/types/workflow.py index f25d00b..c25897e 100644 --- a/src/vapi/types/workflow.py +++ b/src/vapi/types/workflow.py @@ -1,11 +1,13 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import datetime as dt import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .analysis_plan import AnalysisPlan @@ -13,6 +15,7 @@ from .background_speech_denoising_plan import BackgroundSpeechDenoisingPlan from .compliance_plan import CompliancePlan from .edge import Edge +from .keypad_input_plan import KeypadInputPlan from .langfuse_observability_plan import LangfuseObservabilityPlan from .monitor_plan import MonitorPlan from .server import Server @@ -20,6 +23,8 @@ from .stop_speaking_plan import StopSpeakingPlan from .workflow_background_sound import WorkflowBackgroundSound from .workflow_credentials_item import WorkflowCredentialsItem +from .workflow_hooks_item import WorkflowHooksItem +from .workflow_model import WorkflowModel from .workflow_nodes_item import WorkflowNodesItem from .workflow_transcriber import WorkflowTranscriber from .workflow_voice import WorkflowVoice @@ -27,6 +32,13 @@ class Workflow(UncheckedBaseModel): nodes: typing.List[WorkflowNodesItem] + model: typing.Optional[WorkflowModel] = pydantic.Field(default=None) + """ + This is the model for the workflow. + + This can be overridden at node level using `nodes[n].model`. + """ + transcriber: typing.Optional[WorkflowTranscriber] = pydantic.Field(default=None) """ This is the transcriber for the workflow. @@ -58,6 +70,11 @@ class Workflow(UncheckedBaseModel): You can also provide a custom sound by providing a URL to an audio file. """ + hooks: typing.Optional[typing.List[WorkflowHooksItem]] = pydantic.Field(default=None) + """ + This is a set of actions that will be performed on certain events. + """ + credentials: typing.Optional[typing.List[WorkflowCredentialsItem]] = pydantic.Field(default=None) """ These are dynamic credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can supplement an additional credentials using this. Dynamic credentials override existing credentials. @@ -162,6 +179,13 @@ class Workflow(UncheckedBaseModel): These are the credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can provide a subset using this. """ + keypad_input_plan: typing_extensions.Annotated[ + typing.Optional[KeypadInputPlan], FieldMetadata(alias="keypadInputPlan") + ] = pydantic.Field(default=None) + """ + This is the plan for keypad input handling during workflow calls. + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: @@ -170,3 +194,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(Workflow) diff --git a/src/vapi/types/workflow_credentials_item.py b/src/vapi/types/workflow_credentials_item.py index 29fb0ce..83ba37c 100644 --- a/src/vapi/types/workflow_credentials_item.py +++ b/src/vapi/types/workflow_credentials_item.py @@ -11,6 +11,7 @@ from .create_cartesia_credential_dto import CreateCartesiaCredentialDto from .create_cerebras_credential_dto import CreateCerebrasCredentialDto from .create_cloudflare_credential_dto import CreateCloudflareCredentialDto +from .create_custom_credential_dto import CreateCustomCredentialDto from .create_custom_llm_credential_dto import CreateCustomLlmCredentialDto from .create_deep_infra_credential_dto import CreateDeepInfraCredentialDto from .create_deep_seek_credential_dto import CreateDeepSeekCredentialDto @@ -31,9 +32,11 @@ from .create_groq_credential_dto import CreateGroqCredentialDto from .create_hume_credential_dto import CreateHumeCredentialDto from .create_inflection_ai_credential_dto import CreateInflectionAiCredentialDto +from .create_inworld_credential_dto import CreateInworldCredentialDto from .create_langfuse_credential_dto import CreateLangfuseCredentialDto from .create_lmnt_credential_dto import CreateLmntCredentialDto from .create_make_credential_dto import CreateMakeCredentialDto +from .create_minimax_credential_dto import CreateMinimaxCredentialDto from .create_mistral_credential_dto import CreateMistralCredentialDto from .create_neuphonic_credential_dto import CreateNeuphonicCredentialDto from .create_open_ai_credential_dto import CreateOpenAiCredentialDto @@ -93,6 +96,7 @@ CreateTwilioCredentialDto, CreateVonageCredentialDto, CreateWebhookCredentialDto, + CreateCustomCredentialDto, CreateXAiCredentialDto, CreateNeuphonicCredentialDto, CreateHumeCredentialDto, @@ -104,5 +108,6 @@ CreateGoogleSheetsOAuth2AuthorizationCredentialDto, CreateSlackOAuth2AuthorizationCredentialDto, CreateGoHighLevelMcpCredentialDto, - typing.Optional[typing.Any], + CreateInworldCredentialDto, + CreateMinimaxCredentialDto, ] diff --git a/src/vapi/types/workflow_custom_model.py b/src/vapi/types/workflow_custom_model.py index 5f4fa81..f3c69da 100644 --- a/src/vapi/types/workflow_custom_model.py +++ b/src/vapi/types/workflow_custom_model.py @@ -36,6 +36,11 @@ class WorkflowCustomModel(UncheckedBaseModel): These is the URL we'll use for the OpenAI client's `baseURL`. Ex. https://openrouter.ai/api/v1 """ + headers: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None) + """ + These are the headers we'll use for the OpenAI client's `headers`. + """ + timeout_seconds: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="timeoutSeconds")] = ( pydantic.Field(default=None) ) diff --git a/src/vapi/types/workflow_google_model_model.py b/src/vapi/types/workflow_google_model_model.py index 37a8c36..531fcf7 100644 --- a/src/vapi/types/workflow_google_model_model.py +++ b/src/vapi/types/workflow_google_model_model.py @@ -7,14 +7,10 @@ "gemini-2.5-pro", "gemini-2.5-flash", "gemini-2.5-flash-lite", - "gemini-2.5-pro-preview-05-06", - "gemini-2.5-flash-preview-05-20", - "gemini-2.5-flash-preview-04-17", "gemini-2.0-flash-thinking-exp", "gemini-2.0-pro-exp-02-05", "gemini-2.0-flash", "gemini-2.0-flash-lite", - "gemini-2.0-flash-lite-preview-02-05", "gemini-2.0-flash-exp", "gemini-2.0-flash-realtime-exp", "gemini-1.5-flash", diff --git a/src/vapi/types/workflow_hooks_item.py b/src/vapi/types/workflow_hooks_item.py new file mode 100644 index 0000000..d89ad74 --- /dev/null +++ b/src/vapi/types/workflow_hooks_item.py @@ -0,0 +1,15 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted +from .call_hook_call_ending import CallHookCallEnding +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout + +WorkflowHooksItem = typing.Union[ + CallHookCallEnding, + CallHookAssistantSpeechInterrupted, + CallHookCustomerSpeechInterrupted, + CallHookCustomerSpeechTimeout, +] diff --git a/src/vapi/types/workflow_model.py b/src/vapi/types/workflow_model.py new file mode 100644 index 0000000..5b7a671 --- /dev/null +++ b/src/vapi/types/workflow_model.py @@ -0,0 +1,10 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .workflow_anthropic_model import WorkflowAnthropicModel +from .workflow_custom_model import WorkflowCustomModel +from .workflow_google_model import WorkflowGoogleModel +from .workflow_open_ai_model import WorkflowOpenAiModel + +WorkflowModel = typing.Union[WorkflowOpenAiModel, WorkflowAnthropicModel, WorkflowGoogleModel, WorkflowCustomModel] diff --git a/src/vapi/types/workflow_open_ai_model_model.py b/src/vapi/types/workflow_open_ai_model_model.py index 55e91a7..8afb04e 100644 --- a/src/vapi/types/workflow_open_ai_model_model.py +++ b/src/vapi/types/workflow_open_ai_model_model.py @@ -4,19 +4,19 @@ WorkflowOpenAiModelModel = typing.Union[ typing.Literal[ + "gpt-5", + "gpt-5-mini", + "gpt-5-nano", "gpt-4.1-2025-04-14", "gpt-4.1-mini-2025-04-14", "gpt-4.1-nano-2025-04-14", "gpt-4.1", "gpt-4.1-mini", "gpt-4.1-nano", - "gpt-4.5-preview", "chatgpt-4o-latest", "o3", "o3-mini", "o4-mini", - "o1-preview", - "o1-preview-2024-09-12", "o1-mini", "o1-mini-2024-09-12", "gpt-4o-mini-2024-07-18", diff --git a/src/vapi/types/workflow_user_editable.py b/src/vapi/types/workflow_user_editable.py index ea53ada..b0972a3 100644 --- a/src/vapi/types/workflow_user_editable.py +++ b/src/vapi/types/workflow_user_editable.py @@ -1,10 +1,12 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .analysis_plan import AnalysisPlan @@ -12,6 +14,7 @@ from .background_speech_denoising_plan import BackgroundSpeechDenoisingPlan from .compliance_plan import CompliancePlan from .edge import Edge +from .keypad_input_plan import KeypadInputPlan from .langfuse_observability_plan import LangfuseObservabilityPlan from .monitor_plan import MonitorPlan from .server import Server @@ -19,6 +22,8 @@ from .stop_speaking_plan import StopSpeakingPlan from .workflow_user_editable_background_sound import WorkflowUserEditableBackgroundSound from .workflow_user_editable_credentials_item import WorkflowUserEditableCredentialsItem +from .workflow_user_editable_hooks_item import WorkflowUserEditableHooksItem +from .workflow_user_editable_model import WorkflowUserEditableModel from .workflow_user_editable_nodes_item import WorkflowUserEditableNodesItem from .workflow_user_editable_transcriber import WorkflowUserEditableTranscriber from .workflow_user_editable_voice import WorkflowUserEditableVoice @@ -26,6 +31,13 @@ class WorkflowUserEditable(UncheckedBaseModel): nodes: typing.List[WorkflowUserEditableNodesItem] + model: typing.Optional[WorkflowUserEditableModel] = pydantic.Field(default=None) + """ + This is the model for the workflow. + + This can be overridden at node level using `nodes[n].model`. + """ + transcriber: typing.Optional[WorkflowUserEditableTranscriber] = pydantic.Field(default=None) """ This is the transcriber for the workflow. @@ -57,6 +69,11 @@ class WorkflowUserEditable(UncheckedBaseModel): You can also provide a custom sound by providing a URL to an audio file. """ + hooks: typing.Optional[typing.List[WorkflowUserEditableHooksItem]] = pydantic.Field(default=None) + """ + This is a set of actions that will be performed on certain events. + """ + credentials: typing.Optional[typing.List[WorkflowUserEditableCredentialsItem]] = pydantic.Field(default=None) """ These are dynamic credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can supplement an additional credentials using this. Dynamic credentials override existing credentials. @@ -157,6 +174,13 @@ class WorkflowUserEditable(UncheckedBaseModel): These are the credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can provide a subset using this. """ + keypad_input_plan: typing_extensions.Annotated[ + typing.Optional[KeypadInputPlan], FieldMetadata(alias="keypadInputPlan") + ] = pydantic.Field(default=None) + """ + This is the plan for keypad input handling during workflow calls. + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: @@ -165,3 +189,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model import XaiModel # noqa: E402, F401, I001 + +update_forward_refs(WorkflowUserEditable) diff --git a/src/vapi/types/workflow_user_editable_credentials_item.py b/src/vapi/types/workflow_user_editable_credentials_item.py index 330a1c5..4edf35e 100644 --- a/src/vapi/types/workflow_user_editable_credentials_item.py +++ b/src/vapi/types/workflow_user_editable_credentials_item.py @@ -11,6 +11,7 @@ from .create_cartesia_credential_dto import CreateCartesiaCredentialDto from .create_cerebras_credential_dto import CreateCerebrasCredentialDto from .create_cloudflare_credential_dto import CreateCloudflareCredentialDto +from .create_custom_credential_dto import CreateCustomCredentialDto from .create_custom_llm_credential_dto import CreateCustomLlmCredentialDto from .create_deep_infra_credential_dto import CreateDeepInfraCredentialDto from .create_deep_seek_credential_dto import CreateDeepSeekCredentialDto @@ -31,9 +32,11 @@ from .create_groq_credential_dto import CreateGroqCredentialDto from .create_hume_credential_dto import CreateHumeCredentialDto from .create_inflection_ai_credential_dto import CreateInflectionAiCredentialDto +from .create_inworld_credential_dto import CreateInworldCredentialDto from .create_langfuse_credential_dto import CreateLangfuseCredentialDto from .create_lmnt_credential_dto import CreateLmntCredentialDto from .create_make_credential_dto import CreateMakeCredentialDto +from .create_minimax_credential_dto import CreateMinimaxCredentialDto from .create_mistral_credential_dto import CreateMistralCredentialDto from .create_neuphonic_credential_dto import CreateNeuphonicCredentialDto from .create_open_ai_credential_dto import CreateOpenAiCredentialDto @@ -93,6 +96,7 @@ CreateTwilioCredentialDto, CreateVonageCredentialDto, CreateWebhookCredentialDto, + CreateCustomCredentialDto, CreateXAiCredentialDto, CreateNeuphonicCredentialDto, CreateHumeCredentialDto, @@ -104,5 +108,6 @@ CreateGoogleSheetsOAuth2AuthorizationCredentialDto, CreateSlackOAuth2AuthorizationCredentialDto, CreateGoHighLevelMcpCredentialDto, - typing.Optional[typing.Any], + CreateInworldCredentialDto, + CreateMinimaxCredentialDto, ] diff --git a/src/vapi/types/workflow_user_editable_hooks_item.py b/src/vapi/types/workflow_user_editable_hooks_item.py new file mode 100644 index 0000000..17ebcd6 --- /dev/null +++ b/src/vapi/types/workflow_user_editable_hooks_item.py @@ -0,0 +1,15 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted +from .call_hook_call_ending import CallHookCallEnding +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout + +WorkflowUserEditableHooksItem = typing.Union[ + CallHookCallEnding, + CallHookAssistantSpeechInterrupted, + CallHookCustomerSpeechInterrupted, + CallHookCustomerSpeechTimeout, +] diff --git a/src/vapi/types/workflow_user_editable_model.py b/src/vapi/types/workflow_user_editable_model.py new file mode 100644 index 0000000..81e6ab8 --- /dev/null +++ b/src/vapi/types/workflow_user_editable_model.py @@ -0,0 +1,12 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .workflow_anthropic_model import WorkflowAnthropicModel +from .workflow_custom_model import WorkflowCustomModel +from .workflow_google_model import WorkflowGoogleModel +from .workflow_open_ai_model import WorkflowOpenAiModel + +WorkflowUserEditableModel = typing.Union[ + WorkflowOpenAiModel, WorkflowAnthropicModel, WorkflowGoogleModel, WorkflowCustomModel +] diff --git a/src/vapi/types/workflow_user_editable_voice.py b/src/vapi/types/workflow_user_editable_voice.py index 435a650..897483c 100644 --- a/src/vapi/types/workflow_user_editable_voice.py +++ b/src/vapi/types/workflow_user_editable_voice.py @@ -10,6 +10,7 @@ from .hume_voice import HumeVoice from .inworld_voice import InworldVoice from .lmnt_voice import LmntVoice +from .minimax_voice import MinimaxVoice from .neuphonic_voice import NeuphonicVoice from .open_ai_voice import OpenAiVoice from .play_ht_voice import PlayHtVoice @@ -36,4 +37,5 @@ VapiVoice, SesameVoice, InworldVoice, + MinimaxVoice, ] diff --git a/src/vapi/types/workflow_voice.py b/src/vapi/types/workflow_voice.py index b8f2403..af84d73 100644 --- a/src/vapi/types/workflow_voice.py +++ b/src/vapi/types/workflow_voice.py @@ -10,6 +10,7 @@ from .hume_voice import HumeVoice from .inworld_voice import InworldVoice from .lmnt_voice import LmntVoice +from .minimax_voice import MinimaxVoice from .neuphonic_voice import NeuphonicVoice from .open_ai_voice import OpenAiVoice from .play_ht_voice import PlayHtVoice @@ -36,4 +37,5 @@ VapiVoice, SesameVoice, InworldVoice, + MinimaxVoice, ] diff --git a/src/vapi/types/xai_model.py b/src/vapi/types/xai_model.py index 7a349bf..9f69c43 100644 --- a/src/vapi/types/xai_model.py +++ b/src/vapi/types/xai_model.py @@ -1,16 +1,17 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing import pydantic import typing_extensions -from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs from ..core.serialization import FieldMetadata from ..core.unchecked_base_model import UncheckedBaseModel from .create_custom_knowledge_base_dto import CreateCustomKnowledgeBaseDto from .open_ai_message import OpenAiMessage from .xai_model_model import XaiModelModel -from .xai_model_tools_item import XaiModelToolsItem class XaiModel(UncheckedBaseModel): @@ -19,7 +20,7 @@ class XaiModel(UncheckedBaseModel): This is the starting state for the conversation. """ - tools: typing.Optional[typing.List[XaiModelToolsItem]] = pydantic.Field(default=None) + tools: typing.Optional[typing.List["XaiModelToolsItem"]] = pydantic.Field(default=None) """ These are the tools that the assistant can use during the call. To use existing tools, use `toolIds`. @@ -42,13 +43,6 @@ class XaiModel(UncheckedBaseModel): These are the options for the knowledge base. """ - knowledge_base_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="knowledgeBaseId")] = ( - pydantic.Field(default=None) - ) - """ - This is the ID of the knowledge base the model will use. - """ - model: XaiModelModel = pydantic.Field() """ This is the name of the model. Ex. cognitivecomputations/dolphin-mixtral-8x7b @@ -97,3 +91,30 @@ class Config: frozen = True smart_union = True extra = pydantic.Extra.allow + + +from .anthropic_model import AnthropicModel # noqa: E402, F401, I001 +from .anyscale_model import AnyscaleModel # noqa: E402, F401, I001 +from .call_hook_assistant_speech_interrupted import CallHookAssistantSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_call_ending import CallHookCallEnding # noqa: E402, F401, I001 +from .call_hook_customer_speech_interrupted import CallHookCustomerSpeechInterrupted # noqa: E402, F401, I001 +from .call_hook_customer_speech_timeout import CallHookCustomerSpeechTimeout # noqa: E402, F401, I001 +from .cerebras_model import CerebrasModel # noqa: E402, F401, I001 +from .create_assistant_dto import CreateAssistantDto # noqa: E402, F401, I001 +from .create_handoff_tool_dto import CreateHandoffToolDto # noqa: E402, F401, I001 +from .custom_llm_model import CustomLlmModel # noqa: E402, F401, I001 +from .deep_infra_model import DeepInfraModel # noqa: E402, F401, I001 +from .deep_seek_model import DeepSeekModel # noqa: E402, F401, I001 +from .google_model import GoogleModel # noqa: E402, F401, I001 +from .groq_model import GroqModel # noqa: E402, F401, I001 +from .group_condition import GroupCondition # noqa: E402, F401, I001 +from .handoff_destination_assistant import HandoffDestinationAssistant # noqa: E402, F401, I001 +from .inflection_ai_model import InflectionAiModel # noqa: E402, F401, I001 +from .open_ai_model import OpenAiModel # noqa: E402, F401, I001 +from .open_router_model import OpenRouterModel # noqa: E402, F401, I001 +from .perplexity_ai_model import PerplexityAiModel # noqa: E402, F401, I001 +from .together_ai_model import TogetherAiModel # noqa: E402, F401, I001 +from .tool_call_hook_action import ToolCallHookAction # noqa: E402, F401, I001 +from .xai_model_tools_item import XaiModelToolsItem # noqa: E402, F401, I001 + +update_forward_refs(XaiModel) diff --git a/src/vapi/types/xai_model_tools_item.py b/src/vapi/types/xai_model_tools_item.py index c561604..4043e40 100644 --- a/src/vapi/types/xai_model_tools_item.py +++ b/src/vapi/types/xai_model_tools_item.py @@ -1,5 +1,7 @@ # This file was auto-generated by Fern from our API Definition. +from __future__ import annotations + import typing from .create_api_request_tool_dto import CreateApiRequestToolDto @@ -22,6 +24,8 @@ from .create_text_editor_tool_dto import CreateTextEditorToolDto from .create_transfer_call_tool_dto import CreateTransferCallToolDto +if typing.TYPE_CHECKING: + from .create_handoff_tool_dto import CreateHandoffToolDto XaiModelToolsItem = typing.Union[ CreateApiRequestToolDto, CreateBashToolDto, @@ -36,6 +40,7 @@ CreateGoogleCalendarCheckAvailabilityToolDto, CreateGoogleCalendarCreateEventToolDto, CreateGoogleSheetsRowAppendToolDto, + "CreateHandoffToolDto", CreateMcpToolDto, CreateQueryToolDto, CreateSlackSendMessageToolDto, diff --git a/src/vapi/types/xss_security_filter.py b/src/vapi/types/xss_security_filter.py new file mode 100644 index 0000000..dfae5f2 --- /dev/null +++ b/src/vapi/types/xss_security_filter.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.unchecked_base_model import UncheckedBaseModel + + +class XssSecurityFilter(UncheckedBaseModel): + type: typing.Literal["xss"] = pydantic.Field(default="xss") + """ + The type of security threat to filter. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vapi/workflow/__init__.py b/src/vapi/workflow/__init__.py deleted file mode 100644 index 507f5b5..0000000 --- a/src/vapi/workflow/__init__.py +++ /dev/null @@ -1,21 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - -from .types import ( - UpdateWorkflowDtoBackgroundSound, - UpdateWorkflowDtoBackgroundSoundZero, - UpdateWorkflowDtoCredentialsItem, - UpdateWorkflowDtoNodesItem, - UpdateWorkflowDtoTranscriber, - UpdateWorkflowDtoVoice, -) - -__all__ = [ - "UpdateWorkflowDtoBackgroundSound", - "UpdateWorkflowDtoBackgroundSoundZero", - "UpdateWorkflowDtoCredentialsItem", - "UpdateWorkflowDtoNodesItem", - "UpdateWorkflowDtoTranscriber", - "UpdateWorkflowDtoVoice", -] diff --git a/src/vapi/workflow/client.py b/src/vapi/workflow/client.py deleted file mode 100644 index d8b938d..0000000 --- a/src/vapi/workflow/client.py +++ /dev/null @@ -1,929 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.request_options import RequestOptions -from ..types.analysis_plan import AnalysisPlan -from ..types.artifact_plan import ArtifactPlan -from ..types.background_speech_denoising_plan import BackgroundSpeechDenoisingPlan -from ..types.compliance_plan import CompliancePlan -from ..types.create_workflow_dto_background_sound import CreateWorkflowDtoBackgroundSound -from ..types.create_workflow_dto_credentials_item import CreateWorkflowDtoCredentialsItem -from ..types.create_workflow_dto_nodes_item import CreateWorkflowDtoNodesItem -from ..types.create_workflow_dto_transcriber import CreateWorkflowDtoTranscriber -from ..types.create_workflow_dto_voice import CreateWorkflowDtoVoice -from ..types.edge import Edge -from ..types.langfuse_observability_plan import LangfuseObservabilityPlan -from ..types.monitor_plan import MonitorPlan -from ..types.server import Server -from ..types.start_speaking_plan import StartSpeakingPlan -from ..types.stop_speaking_plan import StopSpeakingPlan -from ..types.workflow import Workflow -from .raw_client import AsyncRawWorkflowClient, RawWorkflowClient -from .types.update_workflow_dto_background_sound import UpdateWorkflowDtoBackgroundSound -from .types.update_workflow_dto_credentials_item import UpdateWorkflowDtoCredentialsItem -from .types.update_workflow_dto_nodes_item import UpdateWorkflowDtoNodesItem -from .types.update_workflow_dto_transcriber import UpdateWorkflowDtoTranscriber -from .types.update_workflow_dto_voice import UpdateWorkflowDtoVoice - -# this is used as the default value for optional parameters -OMIT = typing.cast(typing.Any, ...) - - -class WorkflowClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._raw_client = RawWorkflowClient(client_wrapper=client_wrapper) - - @property - def with_raw_response(self) -> RawWorkflowClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - RawWorkflowClient - """ - return self._raw_client - - def workflow_controller_find_all( - self, *, request_options: typing.Optional[RequestOptions] = None - ) -> typing.List[Workflow]: - """ - Parameters - ---------- - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - typing.List[Workflow] - - - Examples - -------- - from vapi import Vapi - - client = Vapi( - token="YOUR_TOKEN", - ) - client.workflow.workflow_controller_find_all() - """ - _response = self._raw_client.workflow_controller_find_all(request_options=request_options) - return _response.data - - def workflow_controller_create( - self, - *, - nodes: typing.Sequence[CreateWorkflowDtoNodesItem], - name: str, - edges: typing.Sequence[Edge], - transcriber: typing.Optional[CreateWorkflowDtoTranscriber] = OMIT, - voice: typing.Optional[CreateWorkflowDtoVoice] = OMIT, - observability_plan: typing.Optional[LangfuseObservabilityPlan] = OMIT, - background_sound: typing.Optional[CreateWorkflowDtoBackgroundSound] = OMIT, - credentials: typing.Optional[typing.Sequence[CreateWorkflowDtoCredentialsItem]] = OMIT, - global_prompt: typing.Optional[str] = OMIT, - server: typing.Optional[Server] = OMIT, - compliance_plan: typing.Optional[CompliancePlan] = OMIT, - analysis_plan: typing.Optional[AnalysisPlan] = OMIT, - artifact_plan: typing.Optional[ArtifactPlan] = OMIT, - start_speaking_plan: typing.Optional[StartSpeakingPlan] = OMIT, - stop_speaking_plan: typing.Optional[StopSpeakingPlan] = OMIT, - monitor_plan: typing.Optional[MonitorPlan] = OMIT, - background_speech_denoising_plan: typing.Optional[BackgroundSpeechDenoisingPlan] = OMIT, - credential_ids: typing.Optional[typing.Sequence[str]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> Workflow: - """ - Parameters - ---------- - nodes : typing.Sequence[CreateWorkflowDtoNodesItem] - - name : str - - edges : typing.Sequence[Edge] - - transcriber : typing.Optional[CreateWorkflowDtoTranscriber] - This is the transcriber for the workflow. - - This can be overridden at node level using `nodes[n].transcriber`. - - voice : typing.Optional[CreateWorkflowDtoVoice] - This is the voice for the workflow. - - This can be overridden at node level using `nodes[n].voice`. - - observability_plan : typing.Optional[LangfuseObservabilityPlan] - This is the plan for observability of workflow's calls. - - Currently, only Langfuse is supported. - - background_sound : typing.Optional[CreateWorkflowDtoBackgroundSound] - This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'. - You can also provide a custom sound by providing a URL to an audio file. - - credentials : typing.Optional[typing.Sequence[CreateWorkflowDtoCredentialsItem]] - These are dynamic credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can supplement an additional credentials using this. Dynamic credentials override existing credentials. - - global_prompt : typing.Optional[str] - - server : typing.Optional[Server] - This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema. - - The order of precedence is: - - 1. tool.server - 2. workflow.server / assistant.server - 3. phoneNumber.server - 4. org.server - - compliance_plan : typing.Optional[CompliancePlan] - This is the compliance plan for the workflow. It allows you to configure HIPAA and other compliance settings. - - analysis_plan : typing.Optional[AnalysisPlan] - This is the plan for analysis of workflow's calls. Stored in `call.analysis`. - - artifact_plan : typing.Optional[ArtifactPlan] - This is the plan for artifacts generated during workflow's calls. Stored in `call.artifact`. - - start_speaking_plan : typing.Optional[StartSpeakingPlan] - This is the plan for when the workflow nodes should start talking. - - You should configure this if you're running into these issues: - - The assistant is too slow to start talking after the customer is done speaking. - - The assistant is too fast to start talking after the customer is done speaking. - - The assistant is so fast that it's actually interrupting the customer. - - stop_speaking_plan : typing.Optional[StopSpeakingPlan] - This is the plan for when workflow nodes should stop talking on customer interruption. - - You should configure this if you're running into these issues: - - The assistant is too slow to recognize customer's interruption. - - The assistant is too fast to recognize customer's interruption. - - The assistant is getting interrupted by phrases that are just acknowledgments. - - The assistant is getting interrupted by background noises. - - The assistant is not properly stopping -- it starts talking right after getting interrupted. - - monitor_plan : typing.Optional[MonitorPlan] - This is the plan for real-time monitoring of the workflow's calls. - - Usage: - - To enable live listening of the workflow's calls, set `monitorPlan.listenEnabled` to `true`. - - To enable live control of the workflow's calls, set `monitorPlan.controlEnabled` to `true`. - - background_speech_denoising_plan : typing.Optional[BackgroundSpeechDenoisingPlan] - This enables filtering of noise and background speech while the user is talking. - - Features: - - Smart denoising using Krisp - - Fourier denoising - - Both can be used together. Order of precedence: - - Smart denoising - - Fourier denoising - - credential_ids : typing.Optional[typing.Sequence[str]] - These are the credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can provide a subset using this. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - Workflow - - - Examples - -------- - from vapi import ConversationNode, Edge, Vapi - - client = Vapi( - token="YOUR_TOKEN", - ) - client.workflow.workflow_controller_create( - nodes=[ - ConversationNode( - name="name", - ) - ], - name="name", - edges=[ - Edge( - from_="from", - to="to", - ) - ], - ) - """ - _response = self._raw_client.workflow_controller_create( - nodes=nodes, - name=name, - edges=edges, - transcriber=transcriber, - voice=voice, - observability_plan=observability_plan, - background_sound=background_sound, - credentials=credentials, - global_prompt=global_prompt, - server=server, - compliance_plan=compliance_plan, - analysis_plan=analysis_plan, - artifact_plan=artifact_plan, - start_speaking_plan=start_speaking_plan, - stop_speaking_plan=stop_speaking_plan, - monitor_plan=monitor_plan, - background_speech_denoising_plan=background_speech_denoising_plan, - credential_ids=credential_ids, - request_options=request_options, - ) - return _response.data - - def workflow_controller_find_one( - self, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> Workflow: - """ - Parameters - ---------- - id : str - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - Workflow - - - Examples - -------- - from vapi import Vapi - - client = Vapi( - token="YOUR_TOKEN", - ) - client.workflow.workflow_controller_find_one( - id="id", - ) - """ - _response = self._raw_client.workflow_controller_find_one(id, request_options=request_options) - return _response.data - - def workflow_controller_delete( - self, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> Workflow: - """ - Parameters - ---------- - id : str - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - Workflow - - - Examples - -------- - from vapi import Vapi - - client = Vapi( - token="YOUR_TOKEN", - ) - client.workflow.workflow_controller_delete( - id="id", - ) - """ - _response = self._raw_client.workflow_controller_delete(id, request_options=request_options) - return _response.data - - def workflow_controller_update( - self, - id: str, - *, - nodes: typing.Optional[typing.Sequence[UpdateWorkflowDtoNodesItem]] = OMIT, - transcriber: typing.Optional[UpdateWorkflowDtoTranscriber] = OMIT, - voice: typing.Optional[UpdateWorkflowDtoVoice] = OMIT, - observability_plan: typing.Optional[LangfuseObservabilityPlan] = OMIT, - background_sound: typing.Optional[UpdateWorkflowDtoBackgroundSound] = OMIT, - credentials: typing.Optional[typing.Sequence[UpdateWorkflowDtoCredentialsItem]] = OMIT, - name: typing.Optional[str] = OMIT, - edges: typing.Optional[typing.Sequence[Edge]] = OMIT, - global_prompt: typing.Optional[str] = OMIT, - server: typing.Optional[Server] = OMIT, - compliance_plan: typing.Optional[CompliancePlan] = OMIT, - analysis_plan: typing.Optional[AnalysisPlan] = OMIT, - artifact_plan: typing.Optional[ArtifactPlan] = OMIT, - start_speaking_plan: typing.Optional[StartSpeakingPlan] = OMIT, - stop_speaking_plan: typing.Optional[StopSpeakingPlan] = OMIT, - monitor_plan: typing.Optional[MonitorPlan] = OMIT, - background_speech_denoising_plan: typing.Optional[BackgroundSpeechDenoisingPlan] = OMIT, - credential_ids: typing.Optional[typing.Sequence[str]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> Workflow: - """ - Parameters - ---------- - id : str - - nodes : typing.Optional[typing.Sequence[UpdateWorkflowDtoNodesItem]] - - transcriber : typing.Optional[UpdateWorkflowDtoTranscriber] - This is the transcriber for the workflow. - - This can be overridden at node level using `nodes[n].transcriber`. - - voice : typing.Optional[UpdateWorkflowDtoVoice] - This is the voice for the workflow. - - This can be overridden at node level using `nodes[n].voice`. - - observability_plan : typing.Optional[LangfuseObservabilityPlan] - This is the plan for observability of workflow's calls. - - Currently, only Langfuse is supported. - - background_sound : typing.Optional[UpdateWorkflowDtoBackgroundSound] - This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'. - You can also provide a custom sound by providing a URL to an audio file. - - credentials : typing.Optional[typing.Sequence[UpdateWorkflowDtoCredentialsItem]] - These are dynamic credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can supplement an additional credentials using this. Dynamic credentials override existing credentials. - - name : typing.Optional[str] - - edges : typing.Optional[typing.Sequence[Edge]] - - global_prompt : typing.Optional[str] - - server : typing.Optional[Server] - This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema. - - The order of precedence is: - - 1. tool.server - 2. workflow.server / assistant.server - 3. phoneNumber.server - 4. org.server - - compliance_plan : typing.Optional[CompliancePlan] - This is the compliance plan for the workflow. It allows you to configure HIPAA and other compliance settings. - - analysis_plan : typing.Optional[AnalysisPlan] - This is the plan for analysis of workflow's calls. Stored in `call.analysis`. - - artifact_plan : typing.Optional[ArtifactPlan] - This is the plan for artifacts generated during workflow's calls. Stored in `call.artifact`. - - start_speaking_plan : typing.Optional[StartSpeakingPlan] - This is the plan for when the workflow nodes should start talking. - - You should configure this if you're running into these issues: - - The assistant is too slow to start talking after the customer is done speaking. - - The assistant is too fast to start talking after the customer is done speaking. - - The assistant is so fast that it's actually interrupting the customer. - - stop_speaking_plan : typing.Optional[StopSpeakingPlan] - This is the plan for when workflow nodes should stop talking on customer interruption. - - You should configure this if you're running into these issues: - - The assistant is too slow to recognize customer's interruption. - - The assistant is too fast to recognize customer's interruption. - - The assistant is getting interrupted by phrases that are just acknowledgments. - - The assistant is getting interrupted by background noises. - - The assistant is not properly stopping -- it starts talking right after getting interrupted. - - monitor_plan : typing.Optional[MonitorPlan] - This is the plan for real-time monitoring of the workflow's calls. - - Usage: - - To enable live listening of the workflow's calls, set `monitorPlan.listenEnabled` to `true`. - - To enable live control of the workflow's calls, set `monitorPlan.controlEnabled` to `true`. - - background_speech_denoising_plan : typing.Optional[BackgroundSpeechDenoisingPlan] - This enables filtering of noise and background speech while the user is talking. - - Features: - - Smart denoising using Krisp - - Fourier denoising - - Both can be used together. Order of precedence: - - Smart denoising - - Fourier denoising - - credential_ids : typing.Optional[typing.Sequence[str]] - These are the credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can provide a subset using this. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - Workflow - - - Examples - -------- - from vapi import Vapi - - client = Vapi( - token="YOUR_TOKEN", - ) - client.workflow.workflow_controller_update( - id="id", - ) - """ - _response = self._raw_client.workflow_controller_update( - id, - nodes=nodes, - transcriber=transcriber, - voice=voice, - observability_plan=observability_plan, - background_sound=background_sound, - credentials=credentials, - name=name, - edges=edges, - global_prompt=global_prompt, - server=server, - compliance_plan=compliance_plan, - analysis_plan=analysis_plan, - artifact_plan=artifact_plan, - start_speaking_plan=start_speaking_plan, - stop_speaking_plan=stop_speaking_plan, - monitor_plan=monitor_plan, - background_speech_denoising_plan=background_speech_denoising_plan, - credential_ids=credential_ids, - request_options=request_options, - ) - return _response.data - - -class AsyncWorkflowClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._raw_client = AsyncRawWorkflowClient(client_wrapper=client_wrapper) - - @property - def with_raw_response(self) -> AsyncRawWorkflowClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - AsyncRawWorkflowClient - """ - return self._raw_client - - async def workflow_controller_find_all( - self, *, request_options: typing.Optional[RequestOptions] = None - ) -> typing.List[Workflow]: - """ - Parameters - ---------- - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - typing.List[Workflow] - - - Examples - -------- - import asyncio - - from vapi import AsyncVapi - - client = AsyncVapi( - token="YOUR_TOKEN", - ) - - - async def main() -> None: - await client.workflow.workflow_controller_find_all() - - - asyncio.run(main()) - """ - _response = await self._raw_client.workflow_controller_find_all(request_options=request_options) - return _response.data - - async def workflow_controller_create( - self, - *, - nodes: typing.Sequence[CreateWorkflowDtoNodesItem], - name: str, - edges: typing.Sequence[Edge], - transcriber: typing.Optional[CreateWorkflowDtoTranscriber] = OMIT, - voice: typing.Optional[CreateWorkflowDtoVoice] = OMIT, - observability_plan: typing.Optional[LangfuseObservabilityPlan] = OMIT, - background_sound: typing.Optional[CreateWorkflowDtoBackgroundSound] = OMIT, - credentials: typing.Optional[typing.Sequence[CreateWorkflowDtoCredentialsItem]] = OMIT, - global_prompt: typing.Optional[str] = OMIT, - server: typing.Optional[Server] = OMIT, - compliance_plan: typing.Optional[CompliancePlan] = OMIT, - analysis_plan: typing.Optional[AnalysisPlan] = OMIT, - artifact_plan: typing.Optional[ArtifactPlan] = OMIT, - start_speaking_plan: typing.Optional[StartSpeakingPlan] = OMIT, - stop_speaking_plan: typing.Optional[StopSpeakingPlan] = OMIT, - monitor_plan: typing.Optional[MonitorPlan] = OMIT, - background_speech_denoising_plan: typing.Optional[BackgroundSpeechDenoisingPlan] = OMIT, - credential_ids: typing.Optional[typing.Sequence[str]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> Workflow: - """ - Parameters - ---------- - nodes : typing.Sequence[CreateWorkflowDtoNodesItem] - - name : str - - edges : typing.Sequence[Edge] - - transcriber : typing.Optional[CreateWorkflowDtoTranscriber] - This is the transcriber for the workflow. - - This can be overridden at node level using `nodes[n].transcriber`. - - voice : typing.Optional[CreateWorkflowDtoVoice] - This is the voice for the workflow. - - This can be overridden at node level using `nodes[n].voice`. - - observability_plan : typing.Optional[LangfuseObservabilityPlan] - This is the plan for observability of workflow's calls. - - Currently, only Langfuse is supported. - - background_sound : typing.Optional[CreateWorkflowDtoBackgroundSound] - This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'. - You can also provide a custom sound by providing a URL to an audio file. - - credentials : typing.Optional[typing.Sequence[CreateWorkflowDtoCredentialsItem]] - These are dynamic credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can supplement an additional credentials using this. Dynamic credentials override existing credentials. - - global_prompt : typing.Optional[str] - - server : typing.Optional[Server] - This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema. - - The order of precedence is: - - 1. tool.server - 2. workflow.server / assistant.server - 3. phoneNumber.server - 4. org.server - - compliance_plan : typing.Optional[CompliancePlan] - This is the compliance plan for the workflow. It allows you to configure HIPAA and other compliance settings. - - analysis_plan : typing.Optional[AnalysisPlan] - This is the plan for analysis of workflow's calls. Stored in `call.analysis`. - - artifact_plan : typing.Optional[ArtifactPlan] - This is the plan for artifacts generated during workflow's calls. Stored in `call.artifact`. - - start_speaking_plan : typing.Optional[StartSpeakingPlan] - This is the plan for when the workflow nodes should start talking. - - You should configure this if you're running into these issues: - - The assistant is too slow to start talking after the customer is done speaking. - - The assistant is too fast to start talking after the customer is done speaking. - - The assistant is so fast that it's actually interrupting the customer. - - stop_speaking_plan : typing.Optional[StopSpeakingPlan] - This is the plan for when workflow nodes should stop talking on customer interruption. - - You should configure this if you're running into these issues: - - The assistant is too slow to recognize customer's interruption. - - The assistant is too fast to recognize customer's interruption. - - The assistant is getting interrupted by phrases that are just acknowledgments. - - The assistant is getting interrupted by background noises. - - The assistant is not properly stopping -- it starts talking right after getting interrupted. - - monitor_plan : typing.Optional[MonitorPlan] - This is the plan for real-time monitoring of the workflow's calls. - - Usage: - - To enable live listening of the workflow's calls, set `monitorPlan.listenEnabled` to `true`. - - To enable live control of the workflow's calls, set `monitorPlan.controlEnabled` to `true`. - - background_speech_denoising_plan : typing.Optional[BackgroundSpeechDenoisingPlan] - This enables filtering of noise and background speech while the user is talking. - - Features: - - Smart denoising using Krisp - - Fourier denoising - - Both can be used together. Order of precedence: - - Smart denoising - - Fourier denoising - - credential_ids : typing.Optional[typing.Sequence[str]] - These are the credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can provide a subset using this. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - Workflow - - - Examples - -------- - import asyncio - - from vapi import AsyncVapi, ConversationNode, Edge - - client = AsyncVapi( - token="YOUR_TOKEN", - ) - - - async def main() -> None: - await client.workflow.workflow_controller_create( - nodes=[ - ConversationNode( - name="name", - ) - ], - name="name", - edges=[ - Edge( - from_="from", - to="to", - ) - ], - ) - - - asyncio.run(main()) - """ - _response = await self._raw_client.workflow_controller_create( - nodes=nodes, - name=name, - edges=edges, - transcriber=transcriber, - voice=voice, - observability_plan=observability_plan, - background_sound=background_sound, - credentials=credentials, - global_prompt=global_prompt, - server=server, - compliance_plan=compliance_plan, - analysis_plan=analysis_plan, - artifact_plan=artifact_plan, - start_speaking_plan=start_speaking_plan, - stop_speaking_plan=stop_speaking_plan, - monitor_plan=monitor_plan, - background_speech_denoising_plan=background_speech_denoising_plan, - credential_ids=credential_ids, - request_options=request_options, - ) - return _response.data - - async def workflow_controller_find_one( - self, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> Workflow: - """ - Parameters - ---------- - id : str - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - Workflow - - - Examples - -------- - import asyncio - - from vapi import AsyncVapi - - client = AsyncVapi( - token="YOUR_TOKEN", - ) - - - async def main() -> None: - await client.workflow.workflow_controller_find_one( - id="id", - ) - - - asyncio.run(main()) - """ - _response = await self._raw_client.workflow_controller_find_one(id, request_options=request_options) - return _response.data - - async def workflow_controller_delete( - self, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> Workflow: - """ - Parameters - ---------- - id : str - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - Workflow - - - Examples - -------- - import asyncio - - from vapi import AsyncVapi - - client = AsyncVapi( - token="YOUR_TOKEN", - ) - - - async def main() -> None: - await client.workflow.workflow_controller_delete( - id="id", - ) - - - asyncio.run(main()) - """ - _response = await self._raw_client.workflow_controller_delete(id, request_options=request_options) - return _response.data - - async def workflow_controller_update( - self, - id: str, - *, - nodes: typing.Optional[typing.Sequence[UpdateWorkflowDtoNodesItem]] = OMIT, - transcriber: typing.Optional[UpdateWorkflowDtoTranscriber] = OMIT, - voice: typing.Optional[UpdateWorkflowDtoVoice] = OMIT, - observability_plan: typing.Optional[LangfuseObservabilityPlan] = OMIT, - background_sound: typing.Optional[UpdateWorkflowDtoBackgroundSound] = OMIT, - credentials: typing.Optional[typing.Sequence[UpdateWorkflowDtoCredentialsItem]] = OMIT, - name: typing.Optional[str] = OMIT, - edges: typing.Optional[typing.Sequence[Edge]] = OMIT, - global_prompt: typing.Optional[str] = OMIT, - server: typing.Optional[Server] = OMIT, - compliance_plan: typing.Optional[CompliancePlan] = OMIT, - analysis_plan: typing.Optional[AnalysisPlan] = OMIT, - artifact_plan: typing.Optional[ArtifactPlan] = OMIT, - start_speaking_plan: typing.Optional[StartSpeakingPlan] = OMIT, - stop_speaking_plan: typing.Optional[StopSpeakingPlan] = OMIT, - monitor_plan: typing.Optional[MonitorPlan] = OMIT, - background_speech_denoising_plan: typing.Optional[BackgroundSpeechDenoisingPlan] = OMIT, - credential_ids: typing.Optional[typing.Sequence[str]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> Workflow: - """ - Parameters - ---------- - id : str - - nodes : typing.Optional[typing.Sequence[UpdateWorkflowDtoNodesItem]] - - transcriber : typing.Optional[UpdateWorkflowDtoTranscriber] - This is the transcriber for the workflow. - - This can be overridden at node level using `nodes[n].transcriber`. - - voice : typing.Optional[UpdateWorkflowDtoVoice] - This is the voice for the workflow. - - This can be overridden at node level using `nodes[n].voice`. - - observability_plan : typing.Optional[LangfuseObservabilityPlan] - This is the plan for observability of workflow's calls. - - Currently, only Langfuse is supported. - - background_sound : typing.Optional[UpdateWorkflowDtoBackgroundSound] - This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'. - You can also provide a custom sound by providing a URL to an audio file. - - credentials : typing.Optional[typing.Sequence[UpdateWorkflowDtoCredentialsItem]] - These are dynamic credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can supplement an additional credentials using this. Dynamic credentials override existing credentials. - - name : typing.Optional[str] - - edges : typing.Optional[typing.Sequence[Edge]] - - global_prompt : typing.Optional[str] - - server : typing.Optional[Server] - This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema. - - The order of precedence is: - - 1. tool.server - 2. workflow.server / assistant.server - 3. phoneNumber.server - 4. org.server - - compliance_plan : typing.Optional[CompliancePlan] - This is the compliance plan for the workflow. It allows you to configure HIPAA and other compliance settings. - - analysis_plan : typing.Optional[AnalysisPlan] - This is the plan for analysis of workflow's calls. Stored in `call.analysis`. - - artifact_plan : typing.Optional[ArtifactPlan] - This is the plan for artifacts generated during workflow's calls. Stored in `call.artifact`. - - start_speaking_plan : typing.Optional[StartSpeakingPlan] - This is the plan for when the workflow nodes should start talking. - - You should configure this if you're running into these issues: - - The assistant is too slow to start talking after the customer is done speaking. - - The assistant is too fast to start talking after the customer is done speaking. - - The assistant is so fast that it's actually interrupting the customer. - - stop_speaking_plan : typing.Optional[StopSpeakingPlan] - This is the plan for when workflow nodes should stop talking on customer interruption. - - You should configure this if you're running into these issues: - - The assistant is too slow to recognize customer's interruption. - - The assistant is too fast to recognize customer's interruption. - - The assistant is getting interrupted by phrases that are just acknowledgments. - - The assistant is getting interrupted by background noises. - - The assistant is not properly stopping -- it starts talking right after getting interrupted. - - monitor_plan : typing.Optional[MonitorPlan] - This is the plan for real-time monitoring of the workflow's calls. - - Usage: - - To enable live listening of the workflow's calls, set `monitorPlan.listenEnabled` to `true`. - - To enable live control of the workflow's calls, set `monitorPlan.controlEnabled` to `true`. - - background_speech_denoising_plan : typing.Optional[BackgroundSpeechDenoisingPlan] - This enables filtering of noise and background speech while the user is talking. - - Features: - - Smart denoising using Krisp - - Fourier denoising - - Both can be used together. Order of precedence: - - Smart denoising - - Fourier denoising - - credential_ids : typing.Optional[typing.Sequence[str]] - These are the credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can provide a subset using this. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - Workflow - - - Examples - -------- - import asyncio - - from vapi import AsyncVapi - - client = AsyncVapi( - token="YOUR_TOKEN", - ) - - - async def main() -> None: - await client.workflow.workflow_controller_update( - id="id", - ) - - - asyncio.run(main()) - """ - _response = await self._raw_client.workflow_controller_update( - id, - nodes=nodes, - transcriber=transcriber, - voice=voice, - observability_plan=observability_plan, - background_sound=background_sound, - credentials=credentials, - name=name, - edges=edges, - global_prompt=global_prompt, - server=server, - compliance_plan=compliance_plan, - analysis_plan=analysis_plan, - artifact_plan=artifact_plan, - start_speaking_plan=start_speaking_plan, - stop_speaking_plan=stop_speaking_plan, - monitor_plan=monitor_plan, - background_speech_denoising_plan=background_speech_denoising_plan, - credential_ids=credential_ids, - request_options=request_options, - ) - return _response.data diff --git a/src/vapi/workflow/raw_client.py b/src/vapi/workflow/raw_client.py deleted file mode 100644 index 7fbe59b..0000000 --- a/src/vapi/workflow/raw_client.py +++ /dev/null @@ -1,1048 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing -from json.decoder import JSONDecodeError - -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.http_response import AsyncHttpResponse, HttpResponse -from ..core.jsonable_encoder import jsonable_encoder -from ..core.request_options import RequestOptions -from ..core.serialization import convert_and_respect_annotation_metadata -from ..core.unchecked_base_model import construct_type -from ..types.analysis_plan import AnalysisPlan -from ..types.artifact_plan import ArtifactPlan -from ..types.background_speech_denoising_plan import BackgroundSpeechDenoisingPlan -from ..types.compliance_plan import CompliancePlan -from ..types.create_workflow_dto_background_sound import CreateWorkflowDtoBackgroundSound -from ..types.create_workflow_dto_credentials_item import CreateWorkflowDtoCredentialsItem -from ..types.create_workflow_dto_nodes_item import CreateWorkflowDtoNodesItem -from ..types.create_workflow_dto_transcriber import CreateWorkflowDtoTranscriber -from ..types.create_workflow_dto_voice import CreateWorkflowDtoVoice -from ..types.edge import Edge -from ..types.langfuse_observability_plan import LangfuseObservabilityPlan -from ..types.monitor_plan import MonitorPlan -from ..types.server import Server -from ..types.start_speaking_plan import StartSpeakingPlan -from ..types.stop_speaking_plan import StopSpeakingPlan -from ..types.workflow import Workflow -from .types.update_workflow_dto_background_sound import UpdateWorkflowDtoBackgroundSound -from .types.update_workflow_dto_credentials_item import UpdateWorkflowDtoCredentialsItem -from .types.update_workflow_dto_nodes_item import UpdateWorkflowDtoNodesItem -from .types.update_workflow_dto_transcriber import UpdateWorkflowDtoTranscriber -from .types.update_workflow_dto_voice import UpdateWorkflowDtoVoice - -# this is used as the default value for optional parameters -OMIT = typing.cast(typing.Any, ...) - - -class RawWorkflowClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._client_wrapper = client_wrapper - - def workflow_controller_find_all( - self, *, request_options: typing.Optional[RequestOptions] = None - ) -> HttpResponse[typing.List[Workflow]]: - """ - Parameters - ---------- - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[typing.List[Workflow]] - - """ - _response = self._client_wrapper.httpx_client.request( - "workflow", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - typing.List[Workflow], - construct_type( - type_=typing.List[Workflow], # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def workflow_controller_create( - self, - *, - nodes: typing.Sequence[CreateWorkflowDtoNodesItem], - name: str, - edges: typing.Sequence[Edge], - transcriber: typing.Optional[CreateWorkflowDtoTranscriber] = OMIT, - voice: typing.Optional[CreateWorkflowDtoVoice] = OMIT, - observability_plan: typing.Optional[LangfuseObservabilityPlan] = OMIT, - background_sound: typing.Optional[CreateWorkflowDtoBackgroundSound] = OMIT, - credentials: typing.Optional[typing.Sequence[CreateWorkflowDtoCredentialsItem]] = OMIT, - global_prompt: typing.Optional[str] = OMIT, - server: typing.Optional[Server] = OMIT, - compliance_plan: typing.Optional[CompliancePlan] = OMIT, - analysis_plan: typing.Optional[AnalysisPlan] = OMIT, - artifact_plan: typing.Optional[ArtifactPlan] = OMIT, - start_speaking_plan: typing.Optional[StartSpeakingPlan] = OMIT, - stop_speaking_plan: typing.Optional[StopSpeakingPlan] = OMIT, - monitor_plan: typing.Optional[MonitorPlan] = OMIT, - background_speech_denoising_plan: typing.Optional[BackgroundSpeechDenoisingPlan] = OMIT, - credential_ids: typing.Optional[typing.Sequence[str]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[Workflow]: - """ - Parameters - ---------- - nodes : typing.Sequence[CreateWorkflowDtoNodesItem] - - name : str - - edges : typing.Sequence[Edge] - - transcriber : typing.Optional[CreateWorkflowDtoTranscriber] - This is the transcriber for the workflow. - - This can be overridden at node level using `nodes[n].transcriber`. - - voice : typing.Optional[CreateWorkflowDtoVoice] - This is the voice for the workflow. - - This can be overridden at node level using `nodes[n].voice`. - - observability_plan : typing.Optional[LangfuseObservabilityPlan] - This is the plan for observability of workflow's calls. - - Currently, only Langfuse is supported. - - background_sound : typing.Optional[CreateWorkflowDtoBackgroundSound] - This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'. - You can also provide a custom sound by providing a URL to an audio file. - - credentials : typing.Optional[typing.Sequence[CreateWorkflowDtoCredentialsItem]] - These are dynamic credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can supplement an additional credentials using this. Dynamic credentials override existing credentials. - - global_prompt : typing.Optional[str] - - server : typing.Optional[Server] - This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema. - - The order of precedence is: - - 1. tool.server - 2. workflow.server / assistant.server - 3. phoneNumber.server - 4. org.server - - compliance_plan : typing.Optional[CompliancePlan] - This is the compliance plan for the workflow. It allows you to configure HIPAA and other compliance settings. - - analysis_plan : typing.Optional[AnalysisPlan] - This is the plan for analysis of workflow's calls. Stored in `call.analysis`. - - artifact_plan : typing.Optional[ArtifactPlan] - This is the plan for artifacts generated during workflow's calls. Stored in `call.artifact`. - - start_speaking_plan : typing.Optional[StartSpeakingPlan] - This is the plan for when the workflow nodes should start talking. - - You should configure this if you're running into these issues: - - The assistant is too slow to start talking after the customer is done speaking. - - The assistant is too fast to start talking after the customer is done speaking. - - The assistant is so fast that it's actually interrupting the customer. - - stop_speaking_plan : typing.Optional[StopSpeakingPlan] - This is the plan for when workflow nodes should stop talking on customer interruption. - - You should configure this if you're running into these issues: - - The assistant is too slow to recognize customer's interruption. - - The assistant is too fast to recognize customer's interruption. - - The assistant is getting interrupted by phrases that are just acknowledgments. - - The assistant is getting interrupted by background noises. - - The assistant is not properly stopping -- it starts talking right after getting interrupted. - - monitor_plan : typing.Optional[MonitorPlan] - This is the plan for real-time monitoring of the workflow's calls. - - Usage: - - To enable live listening of the workflow's calls, set `monitorPlan.listenEnabled` to `true`. - - To enable live control of the workflow's calls, set `monitorPlan.controlEnabled` to `true`. - - background_speech_denoising_plan : typing.Optional[BackgroundSpeechDenoisingPlan] - This enables filtering of noise and background speech while the user is talking. - - Features: - - Smart denoising using Krisp - - Fourier denoising - - Both can be used together. Order of precedence: - - Smart denoising - - Fourier denoising - - credential_ids : typing.Optional[typing.Sequence[str]] - These are the credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can provide a subset using this. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[Workflow] - - """ - _response = self._client_wrapper.httpx_client.request( - "workflow", - method="POST", - json={ - "nodes": convert_and_respect_annotation_metadata( - object_=nodes, annotation=typing.Sequence[CreateWorkflowDtoNodesItem], direction="write" - ), - "transcriber": convert_and_respect_annotation_metadata( - object_=transcriber, annotation=CreateWorkflowDtoTranscriber, direction="write" - ), - "voice": convert_and_respect_annotation_metadata( - object_=voice, annotation=CreateWorkflowDtoVoice, direction="write" - ), - "observabilityPlan": convert_and_respect_annotation_metadata( - object_=observability_plan, annotation=LangfuseObservabilityPlan, direction="write" - ), - "backgroundSound": convert_and_respect_annotation_metadata( - object_=background_sound, annotation=CreateWorkflowDtoBackgroundSound, direction="write" - ), - "credentials": convert_and_respect_annotation_metadata( - object_=credentials, annotation=typing.Sequence[CreateWorkflowDtoCredentialsItem], direction="write" - ), - "name": name, - "edges": convert_and_respect_annotation_metadata( - object_=edges, annotation=typing.Sequence[Edge], direction="write" - ), - "globalPrompt": global_prompt, - "server": convert_and_respect_annotation_metadata(object_=server, annotation=Server, direction="write"), - "compliancePlan": convert_and_respect_annotation_metadata( - object_=compliance_plan, annotation=CompliancePlan, direction="write" - ), - "analysisPlan": convert_and_respect_annotation_metadata( - object_=analysis_plan, annotation=AnalysisPlan, direction="write" - ), - "artifactPlan": convert_and_respect_annotation_metadata( - object_=artifact_plan, annotation=ArtifactPlan, direction="write" - ), - "startSpeakingPlan": convert_and_respect_annotation_metadata( - object_=start_speaking_plan, annotation=StartSpeakingPlan, direction="write" - ), - "stopSpeakingPlan": convert_and_respect_annotation_metadata( - object_=stop_speaking_plan, annotation=StopSpeakingPlan, direction="write" - ), - "monitorPlan": convert_and_respect_annotation_metadata( - object_=monitor_plan, annotation=MonitorPlan, direction="write" - ), - "backgroundSpeechDenoisingPlan": convert_and_respect_annotation_metadata( - object_=background_speech_denoising_plan, - annotation=BackgroundSpeechDenoisingPlan, - direction="write", - ), - "credentialIds": credential_ids, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - Workflow, - construct_type( - type_=Workflow, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def workflow_controller_find_one( - self, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> HttpResponse[Workflow]: - """ - Parameters - ---------- - id : str - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[Workflow] - - """ - _response = self._client_wrapper.httpx_client.request( - f"workflow/{jsonable_encoder(id)}", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - Workflow, - construct_type( - type_=Workflow, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def workflow_controller_delete( - self, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> HttpResponse[Workflow]: - """ - Parameters - ---------- - id : str - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[Workflow] - - """ - _response = self._client_wrapper.httpx_client.request( - f"workflow/{jsonable_encoder(id)}", - method="DELETE", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - Workflow, - construct_type( - type_=Workflow, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def workflow_controller_update( - self, - id: str, - *, - nodes: typing.Optional[typing.Sequence[UpdateWorkflowDtoNodesItem]] = OMIT, - transcriber: typing.Optional[UpdateWorkflowDtoTranscriber] = OMIT, - voice: typing.Optional[UpdateWorkflowDtoVoice] = OMIT, - observability_plan: typing.Optional[LangfuseObservabilityPlan] = OMIT, - background_sound: typing.Optional[UpdateWorkflowDtoBackgroundSound] = OMIT, - credentials: typing.Optional[typing.Sequence[UpdateWorkflowDtoCredentialsItem]] = OMIT, - name: typing.Optional[str] = OMIT, - edges: typing.Optional[typing.Sequence[Edge]] = OMIT, - global_prompt: typing.Optional[str] = OMIT, - server: typing.Optional[Server] = OMIT, - compliance_plan: typing.Optional[CompliancePlan] = OMIT, - analysis_plan: typing.Optional[AnalysisPlan] = OMIT, - artifact_plan: typing.Optional[ArtifactPlan] = OMIT, - start_speaking_plan: typing.Optional[StartSpeakingPlan] = OMIT, - stop_speaking_plan: typing.Optional[StopSpeakingPlan] = OMIT, - monitor_plan: typing.Optional[MonitorPlan] = OMIT, - background_speech_denoising_plan: typing.Optional[BackgroundSpeechDenoisingPlan] = OMIT, - credential_ids: typing.Optional[typing.Sequence[str]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[Workflow]: - """ - Parameters - ---------- - id : str - - nodes : typing.Optional[typing.Sequence[UpdateWorkflowDtoNodesItem]] - - transcriber : typing.Optional[UpdateWorkflowDtoTranscriber] - This is the transcriber for the workflow. - - This can be overridden at node level using `nodes[n].transcriber`. - - voice : typing.Optional[UpdateWorkflowDtoVoice] - This is the voice for the workflow. - - This can be overridden at node level using `nodes[n].voice`. - - observability_plan : typing.Optional[LangfuseObservabilityPlan] - This is the plan for observability of workflow's calls. - - Currently, only Langfuse is supported. - - background_sound : typing.Optional[UpdateWorkflowDtoBackgroundSound] - This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'. - You can also provide a custom sound by providing a URL to an audio file. - - credentials : typing.Optional[typing.Sequence[UpdateWorkflowDtoCredentialsItem]] - These are dynamic credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can supplement an additional credentials using this. Dynamic credentials override existing credentials. - - name : typing.Optional[str] - - edges : typing.Optional[typing.Sequence[Edge]] - - global_prompt : typing.Optional[str] - - server : typing.Optional[Server] - This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema. - - The order of precedence is: - - 1. tool.server - 2. workflow.server / assistant.server - 3. phoneNumber.server - 4. org.server - - compliance_plan : typing.Optional[CompliancePlan] - This is the compliance plan for the workflow. It allows you to configure HIPAA and other compliance settings. - - analysis_plan : typing.Optional[AnalysisPlan] - This is the plan for analysis of workflow's calls. Stored in `call.analysis`. - - artifact_plan : typing.Optional[ArtifactPlan] - This is the plan for artifacts generated during workflow's calls. Stored in `call.artifact`. - - start_speaking_plan : typing.Optional[StartSpeakingPlan] - This is the plan for when the workflow nodes should start talking. - - You should configure this if you're running into these issues: - - The assistant is too slow to start talking after the customer is done speaking. - - The assistant is too fast to start talking after the customer is done speaking. - - The assistant is so fast that it's actually interrupting the customer. - - stop_speaking_plan : typing.Optional[StopSpeakingPlan] - This is the plan for when workflow nodes should stop talking on customer interruption. - - You should configure this if you're running into these issues: - - The assistant is too slow to recognize customer's interruption. - - The assistant is too fast to recognize customer's interruption. - - The assistant is getting interrupted by phrases that are just acknowledgments. - - The assistant is getting interrupted by background noises. - - The assistant is not properly stopping -- it starts talking right after getting interrupted. - - monitor_plan : typing.Optional[MonitorPlan] - This is the plan for real-time monitoring of the workflow's calls. - - Usage: - - To enable live listening of the workflow's calls, set `monitorPlan.listenEnabled` to `true`. - - To enable live control of the workflow's calls, set `monitorPlan.controlEnabled` to `true`. - - background_speech_denoising_plan : typing.Optional[BackgroundSpeechDenoisingPlan] - This enables filtering of noise and background speech while the user is talking. - - Features: - - Smart denoising using Krisp - - Fourier denoising - - Both can be used together. Order of precedence: - - Smart denoising - - Fourier denoising - - credential_ids : typing.Optional[typing.Sequence[str]] - These are the credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can provide a subset using this. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[Workflow] - - """ - _response = self._client_wrapper.httpx_client.request( - f"workflow/{jsonable_encoder(id)}", - method="PATCH", - json={ - "nodes": convert_and_respect_annotation_metadata( - object_=nodes, annotation=typing.Sequence[UpdateWorkflowDtoNodesItem], direction="write" - ), - "transcriber": convert_and_respect_annotation_metadata( - object_=transcriber, annotation=UpdateWorkflowDtoTranscriber, direction="write" - ), - "voice": convert_and_respect_annotation_metadata( - object_=voice, annotation=UpdateWorkflowDtoVoice, direction="write" - ), - "observabilityPlan": convert_and_respect_annotation_metadata( - object_=observability_plan, annotation=LangfuseObservabilityPlan, direction="write" - ), - "backgroundSound": convert_and_respect_annotation_metadata( - object_=background_sound, annotation=UpdateWorkflowDtoBackgroundSound, direction="write" - ), - "credentials": convert_and_respect_annotation_metadata( - object_=credentials, annotation=typing.Sequence[UpdateWorkflowDtoCredentialsItem], direction="write" - ), - "name": name, - "edges": convert_and_respect_annotation_metadata( - object_=edges, annotation=typing.Sequence[Edge], direction="write" - ), - "globalPrompt": global_prompt, - "server": convert_and_respect_annotation_metadata(object_=server, annotation=Server, direction="write"), - "compliancePlan": convert_and_respect_annotation_metadata( - object_=compliance_plan, annotation=CompliancePlan, direction="write" - ), - "analysisPlan": convert_and_respect_annotation_metadata( - object_=analysis_plan, annotation=AnalysisPlan, direction="write" - ), - "artifactPlan": convert_and_respect_annotation_metadata( - object_=artifact_plan, annotation=ArtifactPlan, direction="write" - ), - "startSpeakingPlan": convert_and_respect_annotation_metadata( - object_=start_speaking_plan, annotation=StartSpeakingPlan, direction="write" - ), - "stopSpeakingPlan": convert_and_respect_annotation_metadata( - object_=stop_speaking_plan, annotation=StopSpeakingPlan, direction="write" - ), - "monitorPlan": convert_and_respect_annotation_metadata( - object_=monitor_plan, annotation=MonitorPlan, direction="write" - ), - "backgroundSpeechDenoisingPlan": convert_and_respect_annotation_metadata( - object_=background_speech_denoising_plan, - annotation=BackgroundSpeechDenoisingPlan, - direction="write", - ), - "credentialIds": credential_ids, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - Workflow, - construct_type( - type_=Workflow, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - -class AsyncRawWorkflowClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._client_wrapper = client_wrapper - - async def workflow_controller_find_all( - self, *, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncHttpResponse[typing.List[Workflow]]: - """ - Parameters - ---------- - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[typing.List[Workflow]] - - """ - _response = await self._client_wrapper.httpx_client.request( - "workflow", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - typing.List[Workflow], - construct_type( - type_=typing.List[Workflow], # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def workflow_controller_create( - self, - *, - nodes: typing.Sequence[CreateWorkflowDtoNodesItem], - name: str, - edges: typing.Sequence[Edge], - transcriber: typing.Optional[CreateWorkflowDtoTranscriber] = OMIT, - voice: typing.Optional[CreateWorkflowDtoVoice] = OMIT, - observability_plan: typing.Optional[LangfuseObservabilityPlan] = OMIT, - background_sound: typing.Optional[CreateWorkflowDtoBackgroundSound] = OMIT, - credentials: typing.Optional[typing.Sequence[CreateWorkflowDtoCredentialsItem]] = OMIT, - global_prompt: typing.Optional[str] = OMIT, - server: typing.Optional[Server] = OMIT, - compliance_plan: typing.Optional[CompliancePlan] = OMIT, - analysis_plan: typing.Optional[AnalysisPlan] = OMIT, - artifact_plan: typing.Optional[ArtifactPlan] = OMIT, - start_speaking_plan: typing.Optional[StartSpeakingPlan] = OMIT, - stop_speaking_plan: typing.Optional[StopSpeakingPlan] = OMIT, - monitor_plan: typing.Optional[MonitorPlan] = OMIT, - background_speech_denoising_plan: typing.Optional[BackgroundSpeechDenoisingPlan] = OMIT, - credential_ids: typing.Optional[typing.Sequence[str]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[Workflow]: - """ - Parameters - ---------- - nodes : typing.Sequence[CreateWorkflowDtoNodesItem] - - name : str - - edges : typing.Sequence[Edge] - - transcriber : typing.Optional[CreateWorkflowDtoTranscriber] - This is the transcriber for the workflow. - - This can be overridden at node level using `nodes[n].transcriber`. - - voice : typing.Optional[CreateWorkflowDtoVoice] - This is the voice for the workflow. - - This can be overridden at node level using `nodes[n].voice`. - - observability_plan : typing.Optional[LangfuseObservabilityPlan] - This is the plan for observability of workflow's calls. - - Currently, only Langfuse is supported. - - background_sound : typing.Optional[CreateWorkflowDtoBackgroundSound] - This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'. - You can also provide a custom sound by providing a URL to an audio file. - - credentials : typing.Optional[typing.Sequence[CreateWorkflowDtoCredentialsItem]] - These are dynamic credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can supplement an additional credentials using this. Dynamic credentials override existing credentials. - - global_prompt : typing.Optional[str] - - server : typing.Optional[Server] - This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema. - - The order of precedence is: - - 1. tool.server - 2. workflow.server / assistant.server - 3. phoneNumber.server - 4. org.server - - compliance_plan : typing.Optional[CompliancePlan] - This is the compliance plan for the workflow. It allows you to configure HIPAA and other compliance settings. - - analysis_plan : typing.Optional[AnalysisPlan] - This is the plan for analysis of workflow's calls. Stored in `call.analysis`. - - artifact_plan : typing.Optional[ArtifactPlan] - This is the plan for artifacts generated during workflow's calls. Stored in `call.artifact`. - - start_speaking_plan : typing.Optional[StartSpeakingPlan] - This is the plan for when the workflow nodes should start talking. - - You should configure this if you're running into these issues: - - The assistant is too slow to start talking after the customer is done speaking. - - The assistant is too fast to start talking after the customer is done speaking. - - The assistant is so fast that it's actually interrupting the customer. - - stop_speaking_plan : typing.Optional[StopSpeakingPlan] - This is the plan for when workflow nodes should stop talking on customer interruption. - - You should configure this if you're running into these issues: - - The assistant is too slow to recognize customer's interruption. - - The assistant is too fast to recognize customer's interruption. - - The assistant is getting interrupted by phrases that are just acknowledgments. - - The assistant is getting interrupted by background noises. - - The assistant is not properly stopping -- it starts talking right after getting interrupted. - - monitor_plan : typing.Optional[MonitorPlan] - This is the plan for real-time monitoring of the workflow's calls. - - Usage: - - To enable live listening of the workflow's calls, set `monitorPlan.listenEnabled` to `true`. - - To enable live control of the workflow's calls, set `monitorPlan.controlEnabled` to `true`. - - background_speech_denoising_plan : typing.Optional[BackgroundSpeechDenoisingPlan] - This enables filtering of noise and background speech while the user is talking. - - Features: - - Smart denoising using Krisp - - Fourier denoising - - Both can be used together. Order of precedence: - - Smart denoising - - Fourier denoising - - credential_ids : typing.Optional[typing.Sequence[str]] - These are the credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can provide a subset using this. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[Workflow] - - """ - _response = await self._client_wrapper.httpx_client.request( - "workflow", - method="POST", - json={ - "nodes": convert_and_respect_annotation_metadata( - object_=nodes, annotation=typing.Sequence[CreateWorkflowDtoNodesItem], direction="write" - ), - "transcriber": convert_and_respect_annotation_metadata( - object_=transcriber, annotation=CreateWorkflowDtoTranscriber, direction="write" - ), - "voice": convert_and_respect_annotation_metadata( - object_=voice, annotation=CreateWorkflowDtoVoice, direction="write" - ), - "observabilityPlan": convert_and_respect_annotation_metadata( - object_=observability_plan, annotation=LangfuseObservabilityPlan, direction="write" - ), - "backgroundSound": convert_and_respect_annotation_metadata( - object_=background_sound, annotation=CreateWorkflowDtoBackgroundSound, direction="write" - ), - "credentials": convert_and_respect_annotation_metadata( - object_=credentials, annotation=typing.Sequence[CreateWorkflowDtoCredentialsItem], direction="write" - ), - "name": name, - "edges": convert_and_respect_annotation_metadata( - object_=edges, annotation=typing.Sequence[Edge], direction="write" - ), - "globalPrompt": global_prompt, - "server": convert_and_respect_annotation_metadata(object_=server, annotation=Server, direction="write"), - "compliancePlan": convert_and_respect_annotation_metadata( - object_=compliance_plan, annotation=CompliancePlan, direction="write" - ), - "analysisPlan": convert_and_respect_annotation_metadata( - object_=analysis_plan, annotation=AnalysisPlan, direction="write" - ), - "artifactPlan": convert_and_respect_annotation_metadata( - object_=artifact_plan, annotation=ArtifactPlan, direction="write" - ), - "startSpeakingPlan": convert_and_respect_annotation_metadata( - object_=start_speaking_plan, annotation=StartSpeakingPlan, direction="write" - ), - "stopSpeakingPlan": convert_and_respect_annotation_metadata( - object_=stop_speaking_plan, annotation=StopSpeakingPlan, direction="write" - ), - "monitorPlan": convert_and_respect_annotation_metadata( - object_=monitor_plan, annotation=MonitorPlan, direction="write" - ), - "backgroundSpeechDenoisingPlan": convert_and_respect_annotation_metadata( - object_=background_speech_denoising_plan, - annotation=BackgroundSpeechDenoisingPlan, - direction="write", - ), - "credentialIds": credential_ids, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - Workflow, - construct_type( - type_=Workflow, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def workflow_controller_find_one( - self, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncHttpResponse[Workflow]: - """ - Parameters - ---------- - id : str - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[Workflow] - - """ - _response = await self._client_wrapper.httpx_client.request( - f"workflow/{jsonable_encoder(id)}", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - Workflow, - construct_type( - type_=Workflow, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def workflow_controller_delete( - self, id: str, *, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncHttpResponse[Workflow]: - """ - Parameters - ---------- - id : str - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[Workflow] - - """ - _response = await self._client_wrapper.httpx_client.request( - f"workflow/{jsonable_encoder(id)}", - method="DELETE", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - Workflow, - construct_type( - type_=Workflow, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def workflow_controller_update( - self, - id: str, - *, - nodes: typing.Optional[typing.Sequence[UpdateWorkflowDtoNodesItem]] = OMIT, - transcriber: typing.Optional[UpdateWorkflowDtoTranscriber] = OMIT, - voice: typing.Optional[UpdateWorkflowDtoVoice] = OMIT, - observability_plan: typing.Optional[LangfuseObservabilityPlan] = OMIT, - background_sound: typing.Optional[UpdateWorkflowDtoBackgroundSound] = OMIT, - credentials: typing.Optional[typing.Sequence[UpdateWorkflowDtoCredentialsItem]] = OMIT, - name: typing.Optional[str] = OMIT, - edges: typing.Optional[typing.Sequence[Edge]] = OMIT, - global_prompt: typing.Optional[str] = OMIT, - server: typing.Optional[Server] = OMIT, - compliance_plan: typing.Optional[CompliancePlan] = OMIT, - analysis_plan: typing.Optional[AnalysisPlan] = OMIT, - artifact_plan: typing.Optional[ArtifactPlan] = OMIT, - start_speaking_plan: typing.Optional[StartSpeakingPlan] = OMIT, - stop_speaking_plan: typing.Optional[StopSpeakingPlan] = OMIT, - monitor_plan: typing.Optional[MonitorPlan] = OMIT, - background_speech_denoising_plan: typing.Optional[BackgroundSpeechDenoisingPlan] = OMIT, - credential_ids: typing.Optional[typing.Sequence[str]] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[Workflow]: - """ - Parameters - ---------- - id : str - - nodes : typing.Optional[typing.Sequence[UpdateWorkflowDtoNodesItem]] - - transcriber : typing.Optional[UpdateWorkflowDtoTranscriber] - This is the transcriber for the workflow. - - This can be overridden at node level using `nodes[n].transcriber`. - - voice : typing.Optional[UpdateWorkflowDtoVoice] - This is the voice for the workflow. - - This can be overridden at node level using `nodes[n].voice`. - - observability_plan : typing.Optional[LangfuseObservabilityPlan] - This is the plan for observability of workflow's calls. - - Currently, only Langfuse is supported. - - background_sound : typing.Optional[UpdateWorkflowDtoBackgroundSound] - This is the background sound in the call. Default for phone calls is 'office' and default for web calls is 'off'. - You can also provide a custom sound by providing a URL to an audio file. - - credentials : typing.Optional[typing.Sequence[UpdateWorkflowDtoCredentialsItem]] - These are dynamic credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can supplement an additional credentials using this. Dynamic credentials override existing credentials. - - name : typing.Optional[str] - - edges : typing.Optional[typing.Sequence[Edge]] - - global_prompt : typing.Optional[str] - - server : typing.Optional[Server] - This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema. - - The order of precedence is: - - 1. tool.server - 2. workflow.server / assistant.server - 3. phoneNumber.server - 4. org.server - - compliance_plan : typing.Optional[CompliancePlan] - This is the compliance plan for the workflow. It allows you to configure HIPAA and other compliance settings. - - analysis_plan : typing.Optional[AnalysisPlan] - This is the plan for analysis of workflow's calls. Stored in `call.analysis`. - - artifact_plan : typing.Optional[ArtifactPlan] - This is the plan for artifacts generated during workflow's calls. Stored in `call.artifact`. - - start_speaking_plan : typing.Optional[StartSpeakingPlan] - This is the plan for when the workflow nodes should start talking. - - You should configure this if you're running into these issues: - - The assistant is too slow to start talking after the customer is done speaking. - - The assistant is too fast to start talking after the customer is done speaking. - - The assistant is so fast that it's actually interrupting the customer. - - stop_speaking_plan : typing.Optional[StopSpeakingPlan] - This is the plan for when workflow nodes should stop talking on customer interruption. - - You should configure this if you're running into these issues: - - The assistant is too slow to recognize customer's interruption. - - The assistant is too fast to recognize customer's interruption. - - The assistant is getting interrupted by phrases that are just acknowledgments. - - The assistant is getting interrupted by background noises. - - The assistant is not properly stopping -- it starts talking right after getting interrupted. - - monitor_plan : typing.Optional[MonitorPlan] - This is the plan for real-time monitoring of the workflow's calls. - - Usage: - - To enable live listening of the workflow's calls, set `monitorPlan.listenEnabled` to `true`. - - To enable live control of the workflow's calls, set `monitorPlan.controlEnabled` to `true`. - - background_speech_denoising_plan : typing.Optional[BackgroundSpeechDenoisingPlan] - This enables filtering of noise and background speech while the user is talking. - - Features: - - Smart denoising using Krisp - - Fourier denoising - - Both can be used together. Order of precedence: - - Smart denoising - - Fourier denoising - - credential_ids : typing.Optional[typing.Sequence[str]] - These are the credentials that will be used for the workflow calls. By default, all the credentials are available for use in the call but you can provide a subset using this. - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[Workflow] - - """ - _response = await self._client_wrapper.httpx_client.request( - f"workflow/{jsonable_encoder(id)}", - method="PATCH", - json={ - "nodes": convert_and_respect_annotation_metadata( - object_=nodes, annotation=typing.Sequence[UpdateWorkflowDtoNodesItem], direction="write" - ), - "transcriber": convert_and_respect_annotation_metadata( - object_=transcriber, annotation=UpdateWorkflowDtoTranscriber, direction="write" - ), - "voice": convert_and_respect_annotation_metadata( - object_=voice, annotation=UpdateWorkflowDtoVoice, direction="write" - ), - "observabilityPlan": convert_and_respect_annotation_metadata( - object_=observability_plan, annotation=LangfuseObservabilityPlan, direction="write" - ), - "backgroundSound": convert_and_respect_annotation_metadata( - object_=background_sound, annotation=UpdateWorkflowDtoBackgroundSound, direction="write" - ), - "credentials": convert_and_respect_annotation_metadata( - object_=credentials, annotation=typing.Sequence[UpdateWorkflowDtoCredentialsItem], direction="write" - ), - "name": name, - "edges": convert_and_respect_annotation_metadata( - object_=edges, annotation=typing.Sequence[Edge], direction="write" - ), - "globalPrompt": global_prompt, - "server": convert_and_respect_annotation_metadata(object_=server, annotation=Server, direction="write"), - "compliancePlan": convert_and_respect_annotation_metadata( - object_=compliance_plan, annotation=CompliancePlan, direction="write" - ), - "analysisPlan": convert_and_respect_annotation_metadata( - object_=analysis_plan, annotation=AnalysisPlan, direction="write" - ), - "artifactPlan": convert_and_respect_annotation_metadata( - object_=artifact_plan, annotation=ArtifactPlan, direction="write" - ), - "startSpeakingPlan": convert_and_respect_annotation_metadata( - object_=start_speaking_plan, annotation=StartSpeakingPlan, direction="write" - ), - "stopSpeakingPlan": convert_and_respect_annotation_metadata( - object_=stop_speaking_plan, annotation=StopSpeakingPlan, direction="write" - ), - "monitorPlan": convert_and_respect_annotation_metadata( - object_=monitor_plan, annotation=MonitorPlan, direction="write" - ), - "backgroundSpeechDenoisingPlan": convert_and_respect_annotation_metadata( - object_=background_speech_denoising_plan, - annotation=BackgroundSpeechDenoisingPlan, - direction="write", - ), - "credentialIds": credential_ids, - }, - headers={ - "content-type": "application/json", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - Workflow, - construct_type( - type_=Workflow, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) diff --git a/src/vapi/workflow/types/__init__.py b/src/vapi/workflow/types/__init__.py deleted file mode 100644 index 87b423a..0000000 --- a/src/vapi/workflow/types/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - -from .update_workflow_dto_background_sound import UpdateWorkflowDtoBackgroundSound -from .update_workflow_dto_background_sound_zero import UpdateWorkflowDtoBackgroundSoundZero -from .update_workflow_dto_credentials_item import UpdateWorkflowDtoCredentialsItem -from .update_workflow_dto_nodes_item import UpdateWorkflowDtoNodesItem -from .update_workflow_dto_transcriber import UpdateWorkflowDtoTranscriber -from .update_workflow_dto_voice import UpdateWorkflowDtoVoice - -__all__ = [ - "UpdateWorkflowDtoBackgroundSound", - "UpdateWorkflowDtoBackgroundSoundZero", - "UpdateWorkflowDtoCredentialsItem", - "UpdateWorkflowDtoNodesItem", - "UpdateWorkflowDtoTranscriber", - "UpdateWorkflowDtoVoice", -] diff --git a/src/vapi/workflow/types/update_workflow_dto_credentials_item.py b/src/vapi/workflow/types/update_workflow_dto_credentials_item.py deleted file mode 100644 index ce4c23b..0000000 --- a/src/vapi/workflow/types/update_workflow_dto_credentials_item.py +++ /dev/null @@ -1,108 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from ...types.create_anthropic_credential_dto import CreateAnthropicCredentialDto -from ...types.create_anyscale_credential_dto import CreateAnyscaleCredentialDto -from ...types.create_assembly_ai_credential_dto import CreateAssemblyAiCredentialDto -from ...types.create_azure_credential_dto import CreateAzureCredentialDto -from ...types.create_azure_open_ai_credential_dto import CreateAzureOpenAiCredentialDto -from ...types.create_byo_sip_trunk_credential_dto import CreateByoSipTrunkCredentialDto -from ...types.create_cartesia_credential_dto import CreateCartesiaCredentialDto -from ...types.create_cerebras_credential_dto import CreateCerebrasCredentialDto -from ...types.create_cloudflare_credential_dto import CreateCloudflareCredentialDto -from ...types.create_custom_llm_credential_dto import CreateCustomLlmCredentialDto -from ...types.create_deep_infra_credential_dto import CreateDeepInfraCredentialDto -from ...types.create_deep_seek_credential_dto import CreateDeepSeekCredentialDto -from ...types.create_deepgram_credential_dto import CreateDeepgramCredentialDto -from ...types.create_eleven_labs_credential_dto import CreateElevenLabsCredentialDto -from ...types.create_gcp_credential_dto import CreateGcpCredentialDto -from ...types.create_gladia_credential_dto import CreateGladiaCredentialDto -from ...types.create_go_high_level_credential_dto import CreateGoHighLevelCredentialDto -from ...types.create_go_high_level_mcp_credential_dto import CreateGoHighLevelMcpCredentialDto -from ...types.create_google_calendar_o_auth_2_authorization_credential_dto import ( - CreateGoogleCalendarOAuth2AuthorizationCredentialDto, -) -from ...types.create_google_calendar_o_auth_2_client_credential_dto import CreateGoogleCalendarOAuth2ClientCredentialDto -from ...types.create_google_credential_dto import CreateGoogleCredentialDto -from ...types.create_google_sheets_o_auth_2_authorization_credential_dto import ( - CreateGoogleSheetsOAuth2AuthorizationCredentialDto, -) -from ...types.create_groq_credential_dto import CreateGroqCredentialDto -from ...types.create_hume_credential_dto import CreateHumeCredentialDto -from ...types.create_inflection_ai_credential_dto import CreateInflectionAiCredentialDto -from ...types.create_langfuse_credential_dto import CreateLangfuseCredentialDto -from ...types.create_lmnt_credential_dto import CreateLmntCredentialDto -from ...types.create_make_credential_dto import CreateMakeCredentialDto -from ...types.create_mistral_credential_dto import CreateMistralCredentialDto -from ...types.create_neuphonic_credential_dto import CreateNeuphonicCredentialDto -from ...types.create_open_ai_credential_dto import CreateOpenAiCredentialDto -from ...types.create_open_router_credential_dto import CreateOpenRouterCredentialDto -from ...types.create_perplexity_ai_credential_dto import CreatePerplexityAiCredentialDto -from ...types.create_play_ht_credential_dto import CreatePlayHtCredentialDto -from ...types.create_rime_ai_credential_dto import CreateRimeAiCredentialDto -from ...types.create_runpod_credential_dto import CreateRunpodCredentialDto -from ...types.create_s_3_credential_dto import CreateS3CredentialDto -from ...types.create_slack_o_auth_2_authorization_credential_dto import CreateSlackOAuth2AuthorizationCredentialDto -from ...types.create_smallest_ai_credential_dto import CreateSmallestAiCredentialDto -from ...types.create_speechmatics_credential_dto import CreateSpeechmaticsCredentialDto -from ...types.create_supabase_credential_dto import CreateSupabaseCredentialDto -from ...types.create_tavus_credential_dto import CreateTavusCredentialDto -from ...types.create_together_ai_credential_dto import CreateTogetherAiCredentialDto -from ...types.create_trieve_credential_dto import CreateTrieveCredentialDto -from ...types.create_twilio_credential_dto import CreateTwilioCredentialDto -from ...types.create_vonage_credential_dto import CreateVonageCredentialDto -from ...types.create_webhook_credential_dto import CreateWebhookCredentialDto -from ...types.create_x_ai_credential_dto import CreateXAiCredentialDto - -UpdateWorkflowDtoCredentialsItem = typing.Union[ - CreateElevenLabsCredentialDto, - CreateAnthropicCredentialDto, - CreateAnyscaleCredentialDto, - CreateAssemblyAiCredentialDto, - CreateAzureOpenAiCredentialDto, - CreateAzureCredentialDto, - CreateByoSipTrunkCredentialDto, - CreateCartesiaCredentialDto, - CreateCerebrasCredentialDto, - CreateCloudflareCredentialDto, - CreateCustomLlmCredentialDto, - CreateDeepgramCredentialDto, - CreateDeepInfraCredentialDto, - CreateDeepSeekCredentialDto, - CreateGcpCredentialDto, - CreateGladiaCredentialDto, - CreateGoHighLevelCredentialDto, - CreateGoogleCredentialDto, - CreateGroqCredentialDto, - CreateInflectionAiCredentialDto, - CreateLangfuseCredentialDto, - CreateLmntCredentialDto, - CreateMakeCredentialDto, - CreateOpenAiCredentialDto, - CreateOpenRouterCredentialDto, - CreatePerplexityAiCredentialDto, - CreatePlayHtCredentialDto, - CreateRimeAiCredentialDto, - CreateRunpodCredentialDto, - CreateS3CredentialDto, - CreateSupabaseCredentialDto, - CreateSmallestAiCredentialDto, - CreateTavusCredentialDto, - CreateTogetherAiCredentialDto, - CreateTwilioCredentialDto, - CreateVonageCredentialDto, - CreateWebhookCredentialDto, - CreateXAiCredentialDto, - CreateNeuphonicCredentialDto, - CreateHumeCredentialDto, - CreateMistralCredentialDto, - CreateSpeechmaticsCredentialDto, - CreateTrieveCredentialDto, - CreateGoogleCalendarOAuth2ClientCredentialDto, - CreateGoogleCalendarOAuth2AuthorizationCredentialDto, - CreateGoogleSheetsOAuth2AuthorizationCredentialDto, - CreateSlackOAuth2AuthorizationCredentialDto, - CreateGoHighLevelMcpCredentialDto, - typing.Optional[typing.Any], -] diff --git a/src/vapi/workflow/types/update_workflow_dto_transcriber.py b/src/vapi/workflow/types/update_workflow_dto_transcriber.py deleted file mode 100644 index c2e50f9..0000000 --- a/src/vapi/workflow/types/update_workflow_dto_transcriber.py +++ /dev/null @@ -1,29 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from ...types.assembly_ai_transcriber import AssemblyAiTranscriber -from ...types.azure_speech_transcriber import AzureSpeechTranscriber -from ...types.cartesia_transcriber import CartesiaTranscriber -from ...types.custom_transcriber import CustomTranscriber -from ...types.deepgram_transcriber import DeepgramTranscriber -from ...types.eleven_labs_transcriber import ElevenLabsTranscriber -from ...types.gladia_transcriber import GladiaTranscriber -from ...types.google_transcriber import GoogleTranscriber -from ...types.open_ai_transcriber import OpenAiTranscriber -from ...types.speechmatics_transcriber import SpeechmaticsTranscriber -from ...types.talkscriber_transcriber import TalkscriberTranscriber - -UpdateWorkflowDtoTranscriber = typing.Union[ - AssemblyAiTranscriber, - AzureSpeechTranscriber, - CustomTranscriber, - DeepgramTranscriber, - ElevenLabsTranscriber, - GladiaTranscriber, - GoogleTranscriber, - SpeechmaticsTranscriber, - TalkscriberTranscriber, - OpenAiTranscriber, - CartesiaTranscriber, -] diff --git a/src/vapi/workflow/types/update_workflow_dto_voice.py b/src/vapi/workflow/types/update_workflow_dto_voice.py deleted file mode 100644 index 141c474..0000000 --- a/src/vapi/workflow/types/update_workflow_dto_voice.py +++ /dev/null @@ -1,39 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from ...types.azure_voice import AzureVoice -from ...types.cartesia_voice import CartesiaVoice -from ...types.custom_voice import CustomVoice -from ...types.deepgram_voice import DeepgramVoice -from ...types.eleven_labs_voice import ElevenLabsVoice -from ...types.hume_voice import HumeVoice -from ...types.inworld_voice import InworldVoice -from ...types.lmnt_voice import LmntVoice -from ...types.neuphonic_voice import NeuphonicVoice -from ...types.open_ai_voice import OpenAiVoice -from ...types.play_ht_voice import PlayHtVoice -from ...types.rime_ai_voice import RimeAiVoice -from ...types.sesame_voice import SesameVoice -from ...types.smallest_ai_voice import SmallestAiVoice -from ...types.tavus_voice import TavusVoice -from ...types.vapi_voice import VapiVoice - -UpdateWorkflowDtoVoice = typing.Union[ - AzureVoice, - CartesiaVoice, - CustomVoice, - DeepgramVoice, - ElevenLabsVoice, - HumeVoice, - LmntVoice, - NeuphonicVoice, - OpenAiVoice, - PlayHtVoice, - RimeAiVoice, - SmallestAiVoice, - TavusVoice, - VapiVoice, - SesameVoice, - InworldVoice, -]