Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/__init__.py +84 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/__pycache__/conversation_item.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/__pycache__/conversation_item_delete_event.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/__pycache__/conversation_item_delete_event_param.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/__pycache__/rate_limits_updated_event.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/__pycache__/response_create_event_param.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/__pycache__/session_update_event.cpython-311.pyc +0 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/conversation_created_event.py +27 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/conversation_item.py +61 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/conversation_item_content.py +29 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/conversation_item_content_param.py +28 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/conversation_item_create_event.py +29 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/conversation_item_create_event_param.py +29 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/conversation_item_created_event.py +25 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/conversation_item_delete_event.py +19 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/conversation_item_delete_event_param.py +18 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/conversation_item_deleted_event.py +18 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/conversation_item_input_audio_transcription_completed_event.py +26 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/conversation_item_input_audio_transcription_failed_event.py +39 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/conversation_item_param.py +62 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/conversation_item_truncate_event.py +32 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/conversation_item_truncate_event_param.py +31 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/conversation_item_truncated_event.py +24 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/conversation_item_with_reference.py +67 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/conversation_item_with_reference_param.py +68 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/error_event.py +36 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/input_audio_buffer_append_event.py +23 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/input_audio_buffer_append_event_param.py +22 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/input_audio_buffer_clear_event.py +16 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/input_audio_buffer_clear_event_param.py +15 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/input_audio_buffer_cleared_event.py +15 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/input_audio_buffer_commit_event.py +16 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/input_audio_buffer_commit_event_param.py +15 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/input_audio_buffer_committed_event.py +21 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/input_audio_buffer_speech_started_event.py +26 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/input_audio_buffer_speech_stopped_event.py +25 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/rate_limits_updated_event.py +33 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/realtime_client_event.py +32 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/realtime_client_event_param.py +30 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/realtime_connect_params.py +11 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/realtime_response.py +87 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/realtime_response_status.py +39 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/realtime_response_usage.py +52 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/realtime_server_event.py +72 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/response_audio_delta_event.py +30 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/response_audio_done_event.py +27 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/response_audio_transcript_delta_event.py +30 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/response_audio_transcript_done_event.py +30 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/response_cancel_event.py +22 -0
- .venv/lib/python3.11/site-packages/openai/types/beta/realtime/response_cancel_event_param.py +21 -0
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/__init__.py
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from .session import Session as Session
|
| 6 |
+
from .error_event import ErrorEvent as ErrorEvent
|
| 7 |
+
from .conversation_item import ConversationItem as ConversationItem
|
| 8 |
+
from .realtime_response import RealtimeResponse as RealtimeResponse
|
| 9 |
+
from .response_done_event import ResponseDoneEvent as ResponseDoneEvent
|
| 10 |
+
from .session_update_event import SessionUpdateEvent as SessionUpdateEvent
|
| 11 |
+
from .realtime_client_event import RealtimeClientEvent as RealtimeClientEvent
|
| 12 |
+
from .realtime_server_event import RealtimeServerEvent as RealtimeServerEvent
|
| 13 |
+
from .response_cancel_event import ResponseCancelEvent as ResponseCancelEvent
|
| 14 |
+
from .response_create_event import ResponseCreateEvent as ResponseCreateEvent
|
| 15 |
+
from .session_create_params import SessionCreateParams as SessionCreateParams
|
| 16 |
+
from .session_created_event import SessionCreatedEvent as SessionCreatedEvent
|
| 17 |
+
from .session_updated_event import SessionUpdatedEvent as SessionUpdatedEvent
|
| 18 |
+
from .response_created_event import ResponseCreatedEvent as ResponseCreatedEvent
|
| 19 |
+
from .conversation_item_param import ConversationItemParam as ConversationItemParam
|
| 20 |
+
from .realtime_connect_params import RealtimeConnectParams as RealtimeConnectParams
|
| 21 |
+
from .realtime_response_usage import RealtimeResponseUsage as RealtimeResponseUsage
|
| 22 |
+
from .session_create_response import SessionCreateResponse as SessionCreateResponse
|
| 23 |
+
from .realtime_response_status import RealtimeResponseStatus as RealtimeResponseStatus
|
| 24 |
+
from .response_text_done_event import ResponseTextDoneEvent as ResponseTextDoneEvent
|
| 25 |
+
from .conversation_item_content import ConversationItemContent as ConversationItemContent
|
| 26 |
+
from .rate_limits_updated_event import RateLimitsUpdatedEvent as RateLimitsUpdatedEvent
|
| 27 |
+
from .response_audio_done_event import ResponseAudioDoneEvent as ResponseAudioDoneEvent
|
| 28 |
+
from .response_text_delta_event import ResponseTextDeltaEvent as ResponseTextDeltaEvent
|
| 29 |
+
from .conversation_created_event import ConversationCreatedEvent as ConversationCreatedEvent
|
| 30 |
+
from .response_audio_delta_event import ResponseAudioDeltaEvent as ResponseAudioDeltaEvent
|
| 31 |
+
from .session_update_event_param import SessionUpdateEventParam as SessionUpdateEventParam
|
| 32 |
+
from .realtime_client_event_param import RealtimeClientEventParam as RealtimeClientEventParam
|
| 33 |
+
from .response_cancel_event_param import ResponseCancelEventParam as ResponseCancelEventParam
|
| 34 |
+
from .response_create_event_param import ResponseCreateEventParam as ResponseCreateEventParam
|
| 35 |
+
from .conversation_item_create_event import ConversationItemCreateEvent as ConversationItemCreateEvent
|
| 36 |
+
from .conversation_item_delete_event import ConversationItemDeleteEvent as ConversationItemDeleteEvent
|
| 37 |
+
from .input_audio_buffer_clear_event import InputAudioBufferClearEvent as InputAudioBufferClearEvent
|
| 38 |
+
from .conversation_item_content_param import ConversationItemContentParam as ConversationItemContentParam
|
| 39 |
+
from .conversation_item_created_event import ConversationItemCreatedEvent as ConversationItemCreatedEvent
|
| 40 |
+
from .conversation_item_deleted_event import ConversationItemDeletedEvent as ConversationItemDeletedEvent
|
| 41 |
+
from .input_audio_buffer_append_event import InputAudioBufferAppendEvent as InputAudioBufferAppendEvent
|
| 42 |
+
from .input_audio_buffer_commit_event import InputAudioBufferCommitEvent as InputAudioBufferCommitEvent
|
| 43 |
+
from .response_output_item_done_event import ResponseOutputItemDoneEvent as ResponseOutputItemDoneEvent
|
| 44 |
+
from .conversation_item_truncate_event import ConversationItemTruncateEvent as ConversationItemTruncateEvent
|
| 45 |
+
from .conversation_item_with_reference import ConversationItemWithReference as ConversationItemWithReference
|
| 46 |
+
from .input_audio_buffer_cleared_event import InputAudioBufferClearedEvent as InputAudioBufferClearedEvent
|
| 47 |
+
from .response_content_part_done_event import ResponseContentPartDoneEvent as ResponseContentPartDoneEvent
|
| 48 |
+
from .response_output_item_added_event import ResponseOutputItemAddedEvent as ResponseOutputItemAddedEvent
|
| 49 |
+
from .conversation_item_truncated_event import ConversationItemTruncatedEvent as ConversationItemTruncatedEvent
|
| 50 |
+
from .response_content_part_added_event import ResponseContentPartAddedEvent as ResponseContentPartAddedEvent
|
| 51 |
+
from .input_audio_buffer_committed_event import InputAudioBufferCommittedEvent as InputAudioBufferCommittedEvent
|
| 52 |
+
from .conversation_item_create_event_param import ConversationItemCreateEventParam as ConversationItemCreateEventParam
|
| 53 |
+
from .conversation_item_delete_event_param import ConversationItemDeleteEventParam as ConversationItemDeleteEventParam
|
| 54 |
+
from .input_audio_buffer_clear_event_param import InputAudioBufferClearEventParam as InputAudioBufferClearEventParam
|
| 55 |
+
from .response_audio_transcript_done_event import ResponseAudioTranscriptDoneEvent as ResponseAudioTranscriptDoneEvent
|
| 56 |
+
from .input_audio_buffer_append_event_param import InputAudioBufferAppendEventParam as InputAudioBufferAppendEventParam
|
| 57 |
+
from .input_audio_buffer_commit_event_param import InputAudioBufferCommitEventParam as InputAudioBufferCommitEventParam
|
| 58 |
+
from .response_audio_transcript_delta_event import (
|
| 59 |
+
ResponseAudioTranscriptDeltaEvent as ResponseAudioTranscriptDeltaEvent,
|
| 60 |
+
)
|
| 61 |
+
from .conversation_item_truncate_event_param import (
|
| 62 |
+
ConversationItemTruncateEventParam as ConversationItemTruncateEventParam,
|
| 63 |
+
)
|
| 64 |
+
from .conversation_item_with_reference_param import (
|
| 65 |
+
ConversationItemWithReferenceParam as ConversationItemWithReferenceParam,
|
| 66 |
+
)
|
| 67 |
+
from .input_audio_buffer_speech_started_event import (
|
| 68 |
+
InputAudioBufferSpeechStartedEvent as InputAudioBufferSpeechStartedEvent,
|
| 69 |
+
)
|
| 70 |
+
from .input_audio_buffer_speech_stopped_event import (
|
| 71 |
+
InputAudioBufferSpeechStoppedEvent as InputAudioBufferSpeechStoppedEvent,
|
| 72 |
+
)
|
| 73 |
+
from .response_function_call_arguments_done_event import (
|
| 74 |
+
ResponseFunctionCallArgumentsDoneEvent as ResponseFunctionCallArgumentsDoneEvent,
|
| 75 |
+
)
|
| 76 |
+
from .response_function_call_arguments_delta_event import (
|
| 77 |
+
ResponseFunctionCallArgumentsDeltaEvent as ResponseFunctionCallArgumentsDeltaEvent,
|
| 78 |
+
)
|
| 79 |
+
from .conversation_item_input_audio_transcription_failed_event import (
|
| 80 |
+
ConversationItemInputAudioTranscriptionFailedEvent as ConversationItemInputAudioTranscriptionFailedEvent,
|
| 81 |
+
)
|
| 82 |
+
from .conversation_item_input_audio_transcription_completed_event import (
|
| 83 |
+
ConversationItemInputAudioTranscriptionCompletedEvent as ConversationItemInputAudioTranscriptionCompletedEvent,
|
| 84 |
+
)
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/__pycache__/conversation_item.cpython-311.pyc
ADDED
|
Binary file (1.68 kB). View file
|
|
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/__pycache__/conversation_item_delete_event.cpython-311.pyc
ADDED
|
Binary file (892 Bytes). View file
|
|
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/__pycache__/conversation_item_delete_event_param.cpython-311.pyc
ADDED
|
Binary file (900 Bytes). View file
|
|
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/__pycache__/rate_limits_updated_event.cpython-311.pyc
ADDED
|
Binary file (1.42 kB). View file
|
|
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/__pycache__/response_create_event_param.cpython-311.pyc
ADDED
|
Binary file (2.59 kB). View file
|
|
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/__pycache__/session_update_event.cpython-311.pyc
ADDED
|
Binary file (4.18 kB). View file
|
|
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/conversation_created_event.py
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing import Optional
|
| 4 |
+
from typing_extensions import Literal
|
| 5 |
+
|
| 6 |
+
from ...._models import BaseModel
|
| 7 |
+
|
| 8 |
+
__all__ = ["ConversationCreatedEvent", "Conversation"]
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
class Conversation(BaseModel):
|
| 12 |
+
id: Optional[str] = None
|
| 13 |
+
"""The unique ID of the conversation."""
|
| 14 |
+
|
| 15 |
+
object: Optional[Literal["realtime.conversation"]] = None
|
| 16 |
+
"""The object type, must be `realtime.conversation`."""
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
class ConversationCreatedEvent(BaseModel):
|
| 20 |
+
conversation: Conversation
|
| 21 |
+
"""The conversation resource."""
|
| 22 |
+
|
| 23 |
+
event_id: str
|
| 24 |
+
"""The unique ID of the server event."""
|
| 25 |
+
|
| 26 |
+
type: Literal["conversation.created"]
|
| 27 |
+
"""The event type, must be `conversation.created`."""
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/conversation_item.py
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing import List, Optional
|
| 4 |
+
from typing_extensions import Literal
|
| 5 |
+
|
| 6 |
+
from ...._models import BaseModel
|
| 7 |
+
from .conversation_item_content import ConversationItemContent
|
| 8 |
+
|
| 9 |
+
__all__ = ["ConversationItem"]
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
class ConversationItem(BaseModel):
|
| 13 |
+
id: Optional[str] = None
|
| 14 |
+
"""
|
| 15 |
+
The unique ID of the item, this can be generated by the client to help manage
|
| 16 |
+
server-side context, but is not required because the server will generate one if
|
| 17 |
+
not provided.
|
| 18 |
+
"""
|
| 19 |
+
|
| 20 |
+
arguments: Optional[str] = None
|
| 21 |
+
"""The arguments of the function call (for `function_call` items)."""
|
| 22 |
+
|
| 23 |
+
call_id: Optional[str] = None
|
| 24 |
+
"""
|
| 25 |
+
The ID of the function call (for `function_call` and `function_call_output`
|
| 26 |
+
items). If passed on a `function_call_output` item, the server will check that a
|
| 27 |
+
`function_call` item with the same ID exists in the conversation history.
|
| 28 |
+
"""
|
| 29 |
+
|
| 30 |
+
content: Optional[List[ConversationItemContent]] = None
|
| 31 |
+
"""The content of the message, applicable for `message` items.
|
| 32 |
+
|
| 33 |
+
- Message items of role `system` support only `input_text` content
|
| 34 |
+
- Message items of role `user` support `input_text` and `input_audio` content
|
| 35 |
+
- Message items of role `assistant` support `text` content.
|
| 36 |
+
"""
|
| 37 |
+
|
| 38 |
+
name: Optional[str] = None
|
| 39 |
+
"""The name of the function being called (for `function_call` items)."""
|
| 40 |
+
|
| 41 |
+
object: Optional[Literal["realtime.item"]] = None
|
| 42 |
+
"""Identifier for the API object being returned - always `realtime.item`."""
|
| 43 |
+
|
| 44 |
+
output: Optional[str] = None
|
| 45 |
+
"""The output of the function call (for `function_call_output` items)."""
|
| 46 |
+
|
| 47 |
+
role: Optional[Literal["user", "assistant", "system"]] = None
|
| 48 |
+
"""
|
| 49 |
+
The role of the message sender (`user`, `assistant`, `system`), only applicable
|
| 50 |
+
for `message` items.
|
| 51 |
+
"""
|
| 52 |
+
|
| 53 |
+
status: Optional[Literal["completed", "incomplete"]] = None
|
| 54 |
+
"""The status of the item (`completed`, `incomplete`).
|
| 55 |
+
|
| 56 |
+
These have no effect on the conversation, but are accepted for consistency with
|
| 57 |
+
the `conversation.item.created` event.
|
| 58 |
+
"""
|
| 59 |
+
|
| 60 |
+
type: Optional[Literal["message", "function_call", "function_call_output"]] = None
|
| 61 |
+
"""The type of the item (`message`, `function_call`, `function_call_output`)."""
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/conversation_item_content.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing import Optional
|
| 4 |
+
from typing_extensions import Literal
|
| 5 |
+
|
| 6 |
+
from ...._models import BaseModel
|
| 7 |
+
|
| 8 |
+
__all__ = ["ConversationItemContent"]
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
class ConversationItemContent(BaseModel):
|
| 12 |
+
id: Optional[str] = None
|
| 13 |
+
"""
|
| 14 |
+
ID of a previous conversation item to reference (for `item_reference` content
|
| 15 |
+
types in `response.create` events). These can reference both client and server
|
| 16 |
+
created items.
|
| 17 |
+
"""
|
| 18 |
+
|
| 19 |
+
audio: Optional[str] = None
|
| 20 |
+
"""Base64-encoded audio bytes, used for `input_audio` content type."""
|
| 21 |
+
|
| 22 |
+
text: Optional[str] = None
|
| 23 |
+
"""The text content, used for `input_text` and `text` content types."""
|
| 24 |
+
|
| 25 |
+
transcript: Optional[str] = None
|
| 26 |
+
"""The transcript of the audio, used for `input_audio` content type."""
|
| 27 |
+
|
| 28 |
+
type: Optional[Literal["input_text", "input_audio", "item_reference", "text"]] = None
|
| 29 |
+
"""The content type (`input_text`, `input_audio`, `item_reference`, `text`)."""
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/conversation_item_content_param.py
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from typing_extensions import Literal, TypedDict
|
| 6 |
+
|
| 7 |
+
__all__ = ["ConversationItemContentParam"]
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
class ConversationItemContentParam(TypedDict, total=False):
|
| 11 |
+
id: str
|
| 12 |
+
"""
|
| 13 |
+
ID of a previous conversation item to reference (for `item_reference` content
|
| 14 |
+
types in `response.create` events). These can reference both client and server
|
| 15 |
+
created items.
|
| 16 |
+
"""
|
| 17 |
+
|
| 18 |
+
audio: str
|
| 19 |
+
"""Base64-encoded audio bytes, used for `input_audio` content type."""
|
| 20 |
+
|
| 21 |
+
text: str
|
| 22 |
+
"""The text content, used for `input_text` and `text` content types."""
|
| 23 |
+
|
| 24 |
+
transcript: str
|
| 25 |
+
"""The transcript of the audio, used for `input_audio` content type."""
|
| 26 |
+
|
| 27 |
+
type: Literal["input_text", "input_audio", "item_reference", "text"]
|
| 28 |
+
"""The content type (`input_text`, `input_audio`, `item_reference`, `text`)."""
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/conversation_item_create_event.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing import Optional
|
| 4 |
+
from typing_extensions import Literal
|
| 5 |
+
|
| 6 |
+
from ...._models import BaseModel
|
| 7 |
+
from .conversation_item import ConversationItem
|
| 8 |
+
|
| 9 |
+
__all__ = ["ConversationItemCreateEvent"]
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
class ConversationItemCreateEvent(BaseModel):
|
| 13 |
+
item: ConversationItem
|
| 14 |
+
"""The item to add to the conversation."""
|
| 15 |
+
|
| 16 |
+
type: Literal["conversation.item.create"]
|
| 17 |
+
"""The event type, must be `conversation.item.create`."""
|
| 18 |
+
|
| 19 |
+
event_id: Optional[str] = None
|
| 20 |
+
"""Optional client-generated ID used to identify this event."""
|
| 21 |
+
|
| 22 |
+
previous_item_id: Optional[str] = None
|
| 23 |
+
"""The ID of the preceding item after which the new item will be inserted.
|
| 24 |
+
|
| 25 |
+
If not set, the new item will be appended to the end of the conversation. If set
|
| 26 |
+
to `root`, the new item will be added to the beginning of the conversation. If
|
| 27 |
+
set to an existing ID, it allows an item to be inserted mid-conversation. If the
|
| 28 |
+
ID cannot be found, an error will be returned and the item will not be added.
|
| 29 |
+
"""
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/conversation_item_create_event_param.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from typing_extensions import Literal, Required, TypedDict
|
| 6 |
+
|
| 7 |
+
from .conversation_item_param import ConversationItemParam
|
| 8 |
+
|
| 9 |
+
__all__ = ["ConversationItemCreateEventParam"]
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
class ConversationItemCreateEventParam(TypedDict, total=False):
|
| 13 |
+
item: Required[ConversationItemParam]
|
| 14 |
+
"""The item to add to the conversation."""
|
| 15 |
+
|
| 16 |
+
type: Required[Literal["conversation.item.create"]]
|
| 17 |
+
"""The event type, must be `conversation.item.create`."""
|
| 18 |
+
|
| 19 |
+
event_id: str
|
| 20 |
+
"""Optional client-generated ID used to identify this event."""
|
| 21 |
+
|
| 22 |
+
previous_item_id: str
|
| 23 |
+
"""The ID of the preceding item after which the new item will be inserted.
|
| 24 |
+
|
| 25 |
+
If not set, the new item will be appended to the end of the conversation. If set
|
| 26 |
+
to `root`, the new item will be added to the beginning of the conversation. If
|
| 27 |
+
set to an existing ID, it allows an item to be inserted mid-conversation. If the
|
| 28 |
+
ID cannot be found, an error will be returned and the item will not be added.
|
| 29 |
+
"""
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/conversation_item_created_event.py
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing_extensions import Literal
|
| 4 |
+
|
| 5 |
+
from ...._models import BaseModel
|
| 6 |
+
from .conversation_item import ConversationItem
|
| 7 |
+
|
| 8 |
+
__all__ = ["ConversationItemCreatedEvent"]
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
class ConversationItemCreatedEvent(BaseModel):
|
| 12 |
+
event_id: str
|
| 13 |
+
"""The unique ID of the server event."""
|
| 14 |
+
|
| 15 |
+
item: ConversationItem
|
| 16 |
+
"""The item to add to the conversation."""
|
| 17 |
+
|
| 18 |
+
previous_item_id: str
|
| 19 |
+
"""
|
| 20 |
+
The ID of the preceding item in the Conversation context, allows the client to
|
| 21 |
+
understand the order of the conversation.
|
| 22 |
+
"""
|
| 23 |
+
|
| 24 |
+
type: Literal["conversation.item.created"]
|
| 25 |
+
"""The event type, must be `conversation.item.created`."""
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/conversation_item_delete_event.py
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing import Optional
|
| 4 |
+
from typing_extensions import Literal
|
| 5 |
+
|
| 6 |
+
from ...._models import BaseModel
|
| 7 |
+
|
| 8 |
+
__all__ = ["ConversationItemDeleteEvent"]
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
class ConversationItemDeleteEvent(BaseModel):
|
| 12 |
+
item_id: str
|
| 13 |
+
"""The ID of the item to delete."""
|
| 14 |
+
|
| 15 |
+
type: Literal["conversation.item.delete"]
|
| 16 |
+
"""The event type, must be `conversation.item.delete`."""
|
| 17 |
+
|
| 18 |
+
event_id: Optional[str] = None
|
| 19 |
+
"""Optional client-generated ID used to identify this event."""
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/conversation_item_delete_event_param.py
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from typing_extensions import Literal, Required, TypedDict
|
| 6 |
+
|
| 7 |
+
__all__ = ["ConversationItemDeleteEventParam"]
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
class ConversationItemDeleteEventParam(TypedDict, total=False):
|
| 11 |
+
item_id: Required[str]
|
| 12 |
+
"""The ID of the item to delete."""
|
| 13 |
+
|
| 14 |
+
type: Required[Literal["conversation.item.delete"]]
|
| 15 |
+
"""The event type, must be `conversation.item.delete`."""
|
| 16 |
+
|
| 17 |
+
event_id: str
|
| 18 |
+
"""Optional client-generated ID used to identify this event."""
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/conversation_item_deleted_event.py
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing_extensions import Literal
|
| 4 |
+
|
| 5 |
+
from ...._models import BaseModel
|
| 6 |
+
|
| 7 |
+
__all__ = ["ConversationItemDeletedEvent"]
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
class ConversationItemDeletedEvent(BaseModel):
|
| 11 |
+
event_id: str
|
| 12 |
+
"""The unique ID of the server event."""
|
| 13 |
+
|
| 14 |
+
item_id: str
|
| 15 |
+
"""The ID of the item that was deleted."""
|
| 16 |
+
|
| 17 |
+
type: Literal["conversation.item.deleted"]
|
| 18 |
+
"""The event type, must be `conversation.item.deleted`."""
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/conversation_item_input_audio_transcription_completed_event.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing_extensions import Literal
|
| 4 |
+
|
| 5 |
+
from ...._models import BaseModel
|
| 6 |
+
|
| 7 |
+
__all__ = ["ConversationItemInputAudioTranscriptionCompletedEvent"]
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
class ConversationItemInputAudioTranscriptionCompletedEvent(BaseModel):
|
| 11 |
+
content_index: int
|
| 12 |
+
"""The index of the content part containing the audio."""
|
| 13 |
+
|
| 14 |
+
event_id: str
|
| 15 |
+
"""The unique ID of the server event."""
|
| 16 |
+
|
| 17 |
+
item_id: str
|
| 18 |
+
"""The ID of the user message item containing the audio."""
|
| 19 |
+
|
| 20 |
+
transcript: str
|
| 21 |
+
"""The transcribed text."""
|
| 22 |
+
|
| 23 |
+
type: Literal["conversation.item.input_audio_transcription.completed"]
|
| 24 |
+
"""
|
| 25 |
+
The event type, must be `conversation.item.input_audio_transcription.completed`.
|
| 26 |
+
"""
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/conversation_item_input_audio_transcription_failed_event.py
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing import Optional
|
| 4 |
+
from typing_extensions import Literal
|
| 5 |
+
|
| 6 |
+
from ...._models import BaseModel
|
| 7 |
+
|
| 8 |
+
__all__ = ["ConversationItemInputAudioTranscriptionFailedEvent", "Error"]
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
class Error(BaseModel):
|
| 12 |
+
code: Optional[str] = None
|
| 13 |
+
"""Error code, if any."""
|
| 14 |
+
|
| 15 |
+
message: Optional[str] = None
|
| 16 |
+
"""A human-readable error message."""
|
| 17 |
+
|
| 18 |
+
param: Optional[str] = None
|
| 19 |
+
"""Parameter related to the error, if any."""
|
| 20 |
+
|
| 21 |
+
type: Optional[str] = None
|
| 22 |
+
"""The type of error."""
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
class ConversationItemInputAudioTranscriptionFailedEvent(BaseModel):
|
| 26 |
+
content_index: int
|
| 27 |
+
"""The index of the content part containing the audio."""
|
| 28 |
+
|
| 29 |
+
error: Error
|
| 30 |
+
"""Details of the transcription error."""
|
| 31 |
+
|
| 32 |
+
event_id: str
|
| 33 |
+
"""The unique ID of the server event."""
|
| 34 |
+
|
| 35 |
+
item_id: str
|
| 36 |
+
"""The ID of the user message item."""
|
| 37 |
+
|
| 38 |
+
type: Literal["conversation.item.input_audio_transcription.failed"]
|
| 39 |
+
"""The event type, must be `conversation.item.input_audio_transcription.failed`."""
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/conversation_item_param.py
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from typing import Iterable
|
| 6 |
+
from typing_extensions import Literal, TypedDict
|
| 7 |
+
|
| 8 |
+
from .conversation_item_content_param import ConversationItemContentParam
|
| 9 |
+
|
| 10 |
+
__all__ = ["ConversationItemParam"]
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
class ConversationItemParam(TypedDict, total=False):
|
| 14 |
+
id: str
|
| 15 |
+
"""
|
| 16 |
+
The unique ID of the item, this can be generated by the client to help manage
|
| 17 |
+
server-side context, but is not required because the server will generate one if
|
| 18 |
+
not provided.
|
| 19 |
+
"""
|
| 20 |
+
|
| 21 |
+
arguments: str
|
| 22 |
+
"""The arguments of the function call (for `function_call` items)."""
|
| 23 |
+
|
| 24 |
+
call_id: str
|
| 25 |
+
"""
|
| 26 |
+
The ID of the function call (for `function_call` and `function_call_output`
|
| 27 |
+
items). If passed on a `function_call_output` item, the server will check that a
|
| 28 |
+
`function_call` item with the same ID exists in the conversation history.
|
| 29 |
+
"""
|
| 30 |
+
|
| 31 |
+
content: Iterable[ConversationItemContentParam]
|
| 32 |
+
"""The content of the message, applicable for `message` items.
|
| 33 |
+
|
| 34 |
+
- Message items of role `system` support only `input_text` content
|
| 35 |
+
- Message items of role `user` support `input_text` and `input_audio` content
|
| 36 |
+
- Message items of role `assistant` support `text` content.
|
| 37 |
+
"""
|
| 38 |
+
|
| 39 |
+
name: str
|
| 40 |
+
"""The name of the function being called (for `function_call` items)."""
|
| 41 |
+
|
| 42 |
+
object: Literal["realtime.item"]
|
| 43 |
+
"""Identifier for the API object being returned - always `realtime.item`."""
|
| 44 |
+
|
| 45 |
+
output: str
|
| 46 |
+
"""The output of the function call (for `function_call_output` items)."""
|
| 47 |
+
|
| 48 |
+
role: Literal["user", "assistant", "system"]
|
| 49 |
+
"""
|
| 50 |
+
The role of the message sender (`user`, `assistant`, `system`), only applicable
|
| 51 |
+
for `message` items.
|
| 52 |
+
"""
|
| 53 |
+
|
| 54 |
+
status: Literal["completed", "incomplete"]
|
| 55 |
+
"""The status of the item (`completed`, `incomplete`).
|
| 56 |
+
|
| 57 |
+
These have no effect on the conversation, but are accepted for consistency with
|
| 58 |
+
the `conversation.item.created` event.
|
| 59 |
+
"""
|
| 60 |
+
|
| 61 |
+
type: Literal["message", "function_call", "function_call_output"]
|
| 62 |
+
"""The type of the item (`message`, `function_call`, `function_call_output`)."""
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/conversation_item_truncate_event.py
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing import Optional
|
| 4 |
+
from typing_extensions import Literal
|
| 5 |
+
|
| 6 |
+
from ...._models import BaseModel
|
| 7 |
+
|
| 8 |
+
__all__ = ["ConversationItemTruncateEvent"]
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
class ConversationItemTruncateEvent(BaseModel):
|
| 12 |
+
audio_end_ms: int
|
| 13 |
+
"""Inclusive duration up to which audio is truncated, in milliseconds.
|
| 14 |
+
|
| 15 |
+
If the audio_end_ms is greater than the actual audio duration, the server will
|
| 16 |
+
respond with an error.
|
| 17 |
+
"""
|
| 18 |
+
|
| 19 |
+
content_index: int
|
| 20 |
+
"""The index of the content part to truncate. Set this to 0."""
|
| 21 |
+
|
| 22 |
+
item_id: str
|
| 23 |
+
"""The ID of the assistant message item to truncate.
|
| 24 |
+
|
| 25 |
+
Only assistant message items can be truncated.
|
| 26 |
+
"""
|
| 27 |
+
|
| 28 |
+
type: Literal["conversation.item.truncate"]
|
| 29 |
+
"""The event type, must be `conversation.item.truncate`."""
|
| 30 |
+
|
| 31 |
+
event_id: Optional[str] = None
|
| 32 |
+
"""Optional client-generated ID used to identify this event."""
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/conversation_item_truncate_event_param.py
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from typing_extensions import Literal, Required, TypedDict
|
| 6 |
+
|
| 7 |
+
__all__ = ["ConversationItemTruncateEventParam"]
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
class ConversationItemTruncateEventParam(TypedDict, total=False):
|
| 11 |
+
audio_end_ms: Required[int]
|
| 12 |
+
"""Inclusive duration up to which audio is truncated, in milliseconds.
|
| 13 |
+
|
| 14 |
+
If the audio_end_ms is greater than the actual audio duration, the server will
|
| 15 |
+
respond with an error.
|
| 16 |
+
"""
|
| 17 |
+
|
| 18 |
+
content_index: Required[int]
|
| 19 |
+
"""The index of the content part to truncate. Set this to 0."""
|
| 20 |
+
|
| 21 |
+
item_id: Required[str]
|
| 22 |
+
"""The ID of the assistant message item to truncate.
|
| 23 |
+
|
| 24 |
+
Only assistant message items can be truncated.
|
| 25 |
+
"""
|
| 26 |
+
|
| 27 |
+
type: Required[Literal["conversation.item.truncate"]]
|
| 28 |
+
"""The event type, must be `conversation.item.truncate`."""
|
| 29 |
+
|
| 30 |
+
event_id: str
|
| 31 |
+
"""Optional client-generated ID used to identify this event."""
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/conversation_item_truncated_event.py
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing_extensions import Literal
|
| 4 |
+
|
| 5 |
+
from ...._models import BaseModel
|
| 6 |
+
|
| 7 |
+
__all__ = ["ConversationItemTruncatedEvent"]
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
class ConversationItemTruncatedEvent(BaseModel):
|
| 11 |
+
audio_end_ms: int
|
| 12 |
+
"""The duration up to which the audio was truncated, in milliseconds."""
|
| 13 |
+
|
| 14 |
+
content_index: int
|
| 15 |
+
"""The index of the content part that was truncated."""
|
| 16 |
+
|
| 17 |
+
event_id: str
|
| 18 |
+
"""The unique ID of the server event."""
|
| 19 |
+
|
| 20 |
+
item_id: str
|
| 21 |
+
"""The ID of the assistant message item that was truncated."""
|
| 22 |
+
|
| 23 |
+
type: Literal["conversation.item.truncated"]
|
| 24 |
+
"""The event type, must be `conversation.item.truncated`."""
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/conversation_item_with_reference.py
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing import List, Optional
|
| 4 |
+
from typing_extensions import Literal
|
| 5 |
+
|
| 6 |
+
from ...._models import BaseModel
|
| 7 |
+
from .conversation_item_content import ConversationItemContent
|
| 8 |
+
|
| 9 |
+
__all__ = ["ConversationItemWithReference"]
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
class ConversationItemWithReference(BaseModel):
|
| 13 |
+
id: Optional[str] = None
|
| 14 |
+
"""
|
| 15 |
+
For an item of type (`message` | `function_call` | `function_call_output`) this
|
| 16 |
+
field allows the client to assign the unique ID of the item. It is not required
|
| 17 |
+
because the server will generate one if not provided.
|
| 18 |
+
|
| 19 |
+
For an item of type `item_reference`, this field is required and is a reference
|
| 20 |
+
to any item that has previously existed in the conversation.
|
| 21 |
+
"""
|
| 22 |
+
|
| 23 |
+
arguments: Optional[str] = None
|
| 24 |
+
"""The arguments of the function call (for `function_call` items)."""
|
| 25 |
+
|
| 26 |
+
call_id: Optional[str] = None
|
| 27 |
+
"""
|
| 28 |
+
The ID of the function call (for `function_call` and `function_call_output`
|
| 29 |
+
items). If passed on a `function_call_output` item, the server will check that a
|
| 30 |
+
`function_call` item with the same ID exists in the conversation history.
|
| 31 |
+
"""
|
| 32 |
+
|
| 33 |
+
content: Optional[List[ConversationItemContent]] = None
|
| 34 |
+
"""The content of the message, applicable for `message` items.
|
| 35 |
+
|
| 36 |
+
- Message items of role `system` support only `input_text` content
|
| 37 |
+
- Message items of role `user` support `input_text` and `input_audio` content
|
| 38 |
+
- Message items of role `assistant` support `text` content.
|
| 39 |
+
"""
|
| 40 |
+
|
| 41 |
+
name: Optional[str] = None
|
| 42 |
+
"""The name of the function being called (for `function_call` items)."""
|
| 43 |
+
|
| 44 |
+
object: Optional[Literal["realtime.item"]] = None
|
| 45 |
+
"""Identifier for the API object being returned - always `realtime.item`."""
|
| 46 |
+
|
| 47 |
+
output: Optional[str] = None
|
| 48 |
+
"""The output of the function call (for `function_call_output` items)."""
|
| 49 |
+
|
| 50 |
+
role: Optional[Literal["user", "assistant", "system"]] = None
|
| 51 |
+
"""
|
| 52 |
+
The role of the message sender (`user`, `assistant`, `system`), only applicable
|
| 53 |
+
for `message` items.
|
| 54 |
+
"""
|
| 55 |
+
|
| 56 |
+
status: Optional[Literal["completed", "incomplete"]] = None
|
| 57 |
+
"""The status of the item (`completed`, `incomplete`).
|
| 58 |
+
|
| 59 |
+
These have no effect on the conversation, but are accepted for consistency with
|
| 60 |
+
the `conversation.item.created` event.
|
| 61 |
+
"""
|
| 62 |
+
|
| 63 |
+
type: Optional[Literal["message", "function_call", "function_call_output", "item_reference"]] = None
|
| 64 |
+
"""
|
| 65 |
+
The type of the item (`message`, `function_call`, `function_call_output`,
|
| 66 |
+
`item_reference`).
|
| 67 |
+
"""
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/conversation_item_with_reference_param.py
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from typing import Iterable
|
| 6 |
+
from typing_extensions import Literal, TypedDict
|
| 7 |
+
|
| 8 |
+
from .conversation_item_content_param import ConversationItemContentParam
|
| 9 |
+
|
| 10 |
+
__all__ = ["ConversationItemWithReferenceParam"]
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
class ConversationItemWithReferenceParam(TypedDict, total=False):
|
| 14 |
+
id: str
|
| 15 |
+
"""
|
| 16 |
+
For an item of type (`message` | `function_call` | `function_call_output`) this
|
| 17 |
+
field allows the client to assign the unique ID of the item. It is not required
|
| 18 |
+
because the server will generate one if not provided.
|
| 19 |
+
|
| 20 |
+
For an item of type `item_reference`, this field is required and is a reference
|
| 21 |
+
to any item that has previously existed in the conversation.
|
| 22 |
+
"""
|
| 23 |
+
|
| 24 |
+
arguments: str
|
| 25 |
+
"""The arguments of the function call (for `function_call` items)."""
|
| 26 |
+
|
| 27 |
+
call_id: str
|
| 28 |
+
"""
|
| 29 |
+
The ID of the function call (for `function_call` and `function_call_output`
|
| 30 |
+
items). If passed on a `function_call_output` item, the server will check that a
|
| 31 |
+
`function_call` item with the same ID exists in the conversation history.
|
| 32 |
+
"""
|
| 33 |
+
|
| 34 |
+
content: Iterable[ConversationItemContentParam]
|
| 35 |
+
"""The content of the message, applicable for `message` items.
|
| 36 |
+
|
| 37 |
+
- Message items of role `system` support only `input_text` content
|
| 38 |
+
- Message items of role `user` support `input_text` and `input_audio` content
|
| 39 |
+
- Message items of role `assistant` support `text` content.
|
| 40 |
+
"""
|
| 41 |
+
|
| 42 |
+
name: str
|
| 43 |
+
"""The name of the function being called (for `function_call` items)."""
|
| 44 |
+
|
| 45 |
+
object: Literal["realtime.item"]
|
| 46 |
+
"""Identifier for the API object being returned - always `realtime.item`."""
|
| 47 |
+
|
| 48 |
+
output: str
|
| 49 |
+
"""The output of the function call (for `function_call_output` items)."""
|
| 50 |
+
|
| 51 |
+
role: Literal["user", "assistant", "system"]
|
| 52 |
+
"""
|
| 53 |
+
The role of the message sender (`user`, `assistant`, `system`), only applicable
|
| 54 |
+
for `message` items.
|
| 55 |
+
"""
|
| 56 |
+
|
| 57 |
+
status: Literal["completed", "incomplete"]
|
| 58 |
+
"""The status of the item (`completed`, `incomplete`).
|
| 59 |
+
|
| 60 |
+
These have no effect on the conversation, but are accepted for consistency with
|
| 61 |
+
the `conversation.item.created` event.
|
| 62 |
+
"""
|
| 63 |
+
|
| 64 |
+
type: Literal["message", "function_call", "function_call_output", "item_reference"]
|
| 65 |
+
"""
|
| 66 |
+
The type of the item (`message`, `function_call`, `function_call_output`,
|
| 67 |
+
`item_reference`).
|
| 68 |
+
"""
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/error_event.py
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing import Optional
|
| 4 |
+
from typing_extensions import Literal
|
| 5 |
+
|
| 6 |
+
from ...._models import BaseModel
|
| 7 |
+
|
| 8 |
+
__all__ = ["ErrorEvent", "Error"]
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
class Error(BaseModel):
|
| 12 |
+
message: str
|
| 13 |
+
"""A human-readable error message."""
|
| 14 |
+
|
| 15 |
+
type: str
|
| 16 |
+
"""The type of error (e.g., "invalid_request_error", "server_error")."""
|
| 17 |
+
|
| 18 |
+
code: Optional[str] = None
|
| 19 |
+
"""Error code, if any."""
|
| 20 |
+
|
| 21 |
+
event_id: Optional[str] = None
|
| 22 |
+
"""The event_id of the client event that caused the error, if applicable."""
|
| 23 |
+
|
| 24 |
+
param: Optional[str] = None
|
| 25 |
+
"""Parameter related to the error, if any."""
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
class ErrorEvent(BaseModel):
|
| 29 |
+
error: Error
|
| 30 |
+
"""Details of the error."""
|
| 31 |
+
|
| 32 |
+
event_id: str
|
| 33 |
+
"""The unique ID of the server event."""
|
| 34 |
+
|
| 35 |
+
type: Literal["error"]
|
| 36 |
+
"""The event type, must be `error`."""
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/input_audio_buffer_append_event.py
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing import Optional
|
| 4 |
+
from typing_extensions import Literal
|
| 5 |
+
|
| 6 |
+
from ...._models import BaseModel
|
| 7 |
+
|
| 8 |
+
__all__ = ["InputAudioBufferAppendEvent"]
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
class InputAudioBufferAppendEvent(BaseModel):
|
| 12 |
+
audio: str
|
| 13 |
+
"""Base64-encoded audio bytes.
|
| 14 |
+
|
| 15 |
+
This must be in the format specified by the `input_audio_format` field in the
|
| 16 |
+
session configuration.
|
| 17 |
+
"""
|
| 18 |
+
|
| 19 |
+
type: Literal["input_audio_buffer.append"]
|
| 20 |
+
"""The event type, must be `input_audio_buffer.append`."""
|
| 21 |
+
|
| 22 |
+
event_id: Optional[str] = None
|
| 23 |
+
"""Optional client-generated ID used to identify this event."""
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/input_audio_buffer_append_event_param.py
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from typing_extensions import Literal, Required, TypedDict
|
| 6 |
+
|
| 7 |
+
__all__ = ["InputAudioBufferAppendEventParam"]
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
class InputAudioBufferAppendEventParam(TypedDict, total=False):
|
| 11 |
+
audio: Required[str]
|
| 12 |
+
"""Base64-encoded audio bytes.
|
| 13 |
+
|
| 14 |
+
This must be in the format specified by the `input_audio_format` field in the
|
| 15 |
+
session configuration.
|
| 16 |
+
"""
|
| 17 |
+
|
| 18 |
+
type: Required[Literal["input_audio_buffer.append"]]
|
| 19 |
+
"""The event type, must be `input_audio_buffer.append`."""
|
| 20 |
+
|
| 21 |
+
event_id: str
|
| 22 |
+
"""Optional client-generated ID used to identify this event."""
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/input_audio_buffer_clear_event.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing import Optional
|
| 4 |
+
from typing_extensions import Literal
|
| 5 |
+
|
| 6 |
+
from ...._models import BaseModel
|
| 7 |
+
|
| 8 |
+
__all__ = ["InputAudioBufferClearEvent"]
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
class InputAudioBufferClearEvent(BaseModel):
|
| 12 |
+
type: Literal["input_audio_buffer.clear"]
|
| 13 |
+
"""The event type, must be `input_audio_buffer.clear`."""
|
| 14 |
+
|
| 15 |
+
event_id: Optional[str] = None
|
| 16 |
+
"""Optional client-generated ID used to identify this event."""
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/input_audio_buffer_clear_event_param.py
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from typing_extensions import Literal, Required, TypedDict
|
| 6 |
+
|
| 7 |
+
__all__ = ["InputAudioBufferClearEventParam"]
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
class InputAudioBufferClearEventParam(TypedDict, total=False):
|
| 11 |
+
type: Required[Literal["input_audio_buffer.clear"]]
|
| 12 |
+
"""The event type, must be `input_audio_buffer.clear`."""
|
| 13 |
+
|
| 14 |
+
event_id: str
|
| 15 |
+
"""Optional client-generated ID used to identify this event."""
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/input_audio_buffer_cleared_event.py
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing_extensions import Literal
|
| 4 |
+
|
| 5 |
+
from ...._models import BaseModel
|
| 6 |
+
|
| 7 |
+
__all__ = ["InputAudioBufferClearedEvent"]
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
class InputAudioBufferClearedEvent(BaseModel):
|
| 11 |
+
event_id: str
|
| 12 |
+
"""The unique ID of the server event."""
|
| 13 |
+
|
| 14 |
+
type: Literal["input_audio_buffer.cleared"]
|
| 15 |
+
"""The event type, must be `input_audio_buffer.cleared`."""
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/input_audio_buffer_commit_event.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing import Optional
|
| 4 |
+
from typing_extensions import Literal
|
| 5 |
+
|
| 6 |
+
from ...._models import BaseModel
|
| 7 |
+
|
| 8 |
+
__all__ = ["InputAudioBufferCommitEvent"]
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
class InputAudioBufferCommitEvent(BaseModel):
|
| 12 |
+
type: Literal["input_audio_buffer.commit"]
|
| 13 |
+
"""The event type, must be `input_audio_buffer.commit`."""
|
| 14 |
+
|
| 15 |
+
event_id: Optional[str] = None
|
| 16 |
+
"""Optional client-generated ID used to identify this event."""
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/input_audio_buffer_commit_event_param.py
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from typing_extensions import Literal, Required, TypedDict
|
| 6 |
+
|
| 7 |
+
__all__ = ["InputAudioBufferCommitEventParam"]
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
class InputAudioBufferCommitEventParam(TypedDict, total=False):
|
| 11 |
+
type: Required[Literal["input_audio_buffer.commit"]]
|
| 12 |
+
"""The event type, must be `input_audio_buffer.commit`."""
|
| 13 |
+
|
| 14 |
+
event_id: str
|
| 15 |
+
"""Optional client-generated ID used to identify this event."""
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/input_audio_buffer_committed_event.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing_extensions import Literal
|
| 4 |
+
|
| 5 |
+
from ...._models import BaseModel
|
| 6 |
+
|
| 7 |
+
__all__ = ["InputAudioBufferCommittedEvent"]
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
class InputAudioBufferCommittedEvent(BaseModel):
|
| 11 |
+
event_id: str
|
| 12 |
+
"""The unique ID of the server event."""
|
| 13 |
+
|
| 14 |
+
item_id: str
|
| 15 |
+
"""The ID of the user message item that will be created."""
|
| 16 |
+
|
| 17 |
+
previous_item_id: str
|
| 18 |
+
"""The ID of the preceding item after which the new item will be inserted."""
|
| 19 |
+
|
| 20 |
+
type: Literal["input_audio_buffer.committed"]
|
| 21 |
+
"""The event type, must be `input_audio_buffer.committed`."""
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/input_audio_buffer_speech_started_event.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing_extensions import Literal
|
| 4 |
+
|
| 5 |
+
from ...._models import BaseModel
|
| 6 |
+
|
| 7 |
+
__all__ = ["InputAudioBufferSpeechStartedEvent"]
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
class InputAudioBufferSpeechStartedEvent(BaseModel):
|
| 11 |
+
audio_start_ms: int
|
| 12 |
+
"""
|
| 13 |
+
Milliseconds from the start of all audio written to the buffer during the
|
| 14 |
+
session when speech was first detected. This will correspond to the beginning of
|
| 15 |
+
audio sent to the model, and thus includes the `prefix_padding_ms` configured in
|
| 16 |
+
the Session.
|
| 17 |
+
"""
|
| 18 |
+
|
| 19 |
+
event_id: str
|
| 20 |
+
"""The unique ID of the server event."""
|
| 21 |
+
|
| 22 |
+
item_id: str
|
| 23 |
+
"""The ID of the user message item that will be created when speech stops."""
|
| 24 |
+
|
| 25 |
+
type: Literal["input_audio_buffer.speech_started"]
|
| 26 |
+
"""The event type, must be `input_audio_buffer.speech_started`."""
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/input_audio_buffer_speech_stopped_event.py
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing_extensions import Literal
|
| 4 |
+
|
| 5 |
+
from ...._models import BaseModel
|
| 6 |
+
|
| 7 |
+
__all__ = ["InputAudioBufferSpeechStoppedEvent"]
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
class InputAudioBufferSpeechStoppedEvent(BaseModel):
|
| 11 |
+
audio_end_ms: int
|
| 12 |
+
"""Milliseconds since the session started when speech stopped.
|
| 13 |
+
|
| 14 |
+
This will correspond to the end of audio sent to the model, and thus includes
|
| 15 |
+
the `min_silence_duration_ms` configured in the Session.
|
| 16 |
+
"""
|
| 17 |
+
|
| 18 |
+
event_id: str
|
| 19 |
+
"""The unique ID of the server event."""
|
| 20 |
+
|
| 21 |
+
item_id: str
|
| 22 |
+
"""The ID of the user message item that will be created."""
|
| 23 |
+
|
| 24 |
+
type: Literal["input_audio_buffer.speech_stopped"]
|
| 25 |
+
"""The event type, must be `input_audio_buffer.speech_stopped`."""
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/rate_limits_updated_event.py
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing import List, Optional
|
| 4 |
+
from typing_extensions import Literal
|
| 5 |
+
|
| 6 |
+
from ...._models import BaseModel
|
| 7 |
+
|
| 8 |
+
__all__ = ["RateLimitsUpdatedEvent", "RateLimit"]
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
class RateLimit(BaseModel):
|
| 12 |
+
limit: Optional[int] = None
|
| 13 |
+
"""The maximum allowed value for the rate limit."""
|
| 14 |
+
|
| 15 |
+
name: Optional[Literal["requests", "tokens"]] = None
|
| 16 |
+
"""The name of the rate limit (`requests`, `tokens`)."""
|
| 17 |
+
|
| 18 |
+
remaining: Optional[int] = None
|
| 19 |
+
"""The remaining value before the limit is reached."""
|
| 20 |
+
|
| 21 |
+
reset_seconds: Optional[float] = None
|
| 22 |
+
"""Seconds until the rate limit resets."""
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
class RateLimitsUpdatedEvent(BaseModel):
|
| 26 |
+
event_id: str
|
| 27 |
+
"""The unique ID of the server event."""
|
| 28 |
+
|
| 29 |
+
rate_limits: List[RateLimit]
|
| 30 |
+
"""List of rate limit information."""
|
| 31 |
+
|
| 32 |
+
type: Literal["rate_limits.updated"]
|
| 33 |
+
"""The event type, must be `rate_limits.updated`."""
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/realtime_client_event.py
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing import Union
|
| 4 |
+
from typing_extensions import Annotated, TypeAlias
|
| 5 |
+
|
| 6 |
+
from ...._utils import PropertyInfo
|
| 7 |
+
from .session_update_event import SessionUpdateEvent
|
| 8 |
+
from .response_cancel_event import ResponseCancelEvent
|
| 9 |
+
from .response_create_event import ResponseCreateEvent
|
| 10 |
+
from .conversation_item_create_event import ConversationItemCreateEvent
|
| 11 |
+
from .conversation_item_delete_event import ConversationItemDeleteEvent
|
| 12 |
+
from .input_audio_buffer_clear_event import InputAudioBufferClearEvent
|
| 13 |
+
from .input_audio_buffer_append_event import InputAudioBufferAppendEvent
|
| 14 |
+
from .input_audio_buffer_commit_event import InputAudioBufferCommitEvent
|
| 15 |
+
from .conversation_item_truncate_event import ConversationItemTruncateEvent
|
| 16 |
+
|
| 17 |
+
__all__ = ["RealtimeClientEvent"]
|
| 18 |
+
|
| 19 |
+
RealtimeClientEvent: TypeAlias = Annotated[
|
| 20 |
+
Union[
|
| 21 |
+
SessionUpdateEvent,
|
| 22 |
+
InputAudioBufferAppendEvent,
|
| 23 |
+
InputAudioBufferCommitEvent,
|
| 24 |
+
InputAudioBufferClearEvent,
|
| 25 |
+
ConversationItemCreateEvent,
|
| 26 |
+
ConversationItemTruncateEvent,
|
| 27 |
+
ConversationItemDeleteEvent,
|
| 28 |
+
ResponseCreateEvent,
|
| 29 |
+
ResponseCancelEvent,
|
| 30 |
+
],
|
| 31 |
+
PropertyInfo(discriminator="type"),
|
| 32 |
+
]
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/realtime_client_event_param.py
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from typing import Union
|
| 6 |
+
from typing_extensions import TypeAlias
|
| 7 |
+
|
| 8 |
+
from .session_update_event_param import SessionUpdateEventParam
|
| 9 |
+
from .response_cancel_event_param import ResponseCancelEventParam
|
| 10 |
+
from .response_create_event_param import ResponseCreateEventParam
|
| 11 |
+
from .conversation_item_create_event_param import ConversationItemCreateEventParam
|
| 12 |
+
from .conversation_item_delete_event_param import ConversationItemDeleteEventParam
|
| 13 |
+
from .input_audio_buffer_clear_event_param import InputAudioBufferClearEventParam
|
| 14 |
+
from .input_audio_buffer_append_event_param import InputAudioBufferAppendEventParam
|
| 15 |
+
from .input_audio_buffer_commit_event_param import InputAudioBufferCommitEventParam
|
| 16 |
+
from .conversation_item_truncate_event_param import ConversationItemTruncateEventParam
|
| 17 |
+
|
| 18 |
+
__all__ = ["RealtimeClientEventParam"]
|
| 19 |
+
|
| 20 |
+
RealtimeClientEventParam: TypeAlias = Union[
|
| 21 |
+
SessionUpdateEventParam,
|
| 22 |
+
InputAudioBufferAppendEventParam,
|
| 23 |
+
InputAudioBufferCommitEventParam,
|
| 24 |
+
InputAudioBufferClearEventParam,
|
| 25 |
+
ConversationItemCreateEventParam,
|
| 26 |
+
ConversationItemTruncateEventParam,
|
| 27 |
+
ConversationItemDeleteEventParam,
|
| 28 |
+
ResponseCreateEventParam,
|
| 29 |
+
ResponseCancelEventParam,
|
| 30 |
+
]
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/realtime_connect_params.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from typing_extensions import Required, TypedDict
|
| 6 |
+
|
| 7 |
+
__all__ = ["RealtimeConnectParams"]
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
class RealtimeConnectParams(TypedDict, total=False):
|
| 11 |
+
model: Required[str]
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/realtime_response.py
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing import List, Union, Optional
|
| 4 |
+
from typing_extensions import Literal
|
| 5 |
+
|
| 6 |
+
from ...._models import BaseModel
|
| 7 |
+
from ...shared.metadata import Metadata
|
| 8 |
+
from .conversation_item import ConversationItem
|
| 9 |
+
from .realtime_response_usage import RealtimeResponseUsage
|
| 10 |
+
from .realtime_response_status import RealtimeResponseStatus
|
| 11 |
+
|
| 12 |
+
__all__ = ["RealtimeResponse"]
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
class RealtimeResponse(BaseModel):
|
| 16 |
+
id: Optional[str] = None
|
| 17 |
+
"""The unique ID of the response."""
|
| 18 |
+
|
| 19 |
+
conversation_id: Optional[str] = None
|
| 20 |
+
"""
|
| 21 |
+
Which conversation the response is added to, determined by the `conversation`
|
| 22 |
+
field in the `response.create` event. If `auto`, the response will be added to
|
| 23 |
+
the default conversation and the value of `conversation_id` will be an id like
|
| 24 |
+
`conv_1234`. If `none`, the response will not be added to any conversation and
|
| 25 |
+
the value of `conversation_id` will be `null`. If responses are being triggered
|
| 26 |
+
by server VAD, the response will be added to the default conversation, thus the
|
| 27 |
+
`conversation_id` will be an id like `conv_1234`.
|
| 28 |
+
"""
|
| 29 |
+
|
| 30 |
+
max_output_tokens: Union[int, Literal["inf"], None] = None
|
| 31 |
+
"""
|
| 32 |
+
Maximum number of output tokens for a single assistant response, inclusive of
|
| 33 |
+
tool calls, that was used in this response.
|
| 34 |
+
"""
|
| 35 |
+
|
| 36 |
+
metadata: Optional[Metadata] = None
|
| 37 |
+
"""Set of 16 key-value pairs that can be attached to an object.
|
| 38 |
+
|
| 39 |
+
This can be useful for storing additional information about the object in a
|
| 40 |
+
structured format, and querying for objects via API or the dashboard.
|
| 41 |
+
|
| 42 |
+
Keys are strings with a maximum length of 64 characters. Values are strings with
|
| 43 |
+
a maximum length of 512 characters.
|
| 44 |
+
"""
|
| 45 |
+
|
| 46 |
+
modalities: Optional[List[Literal["text", "audio"]]] = None
|
| 47 |
+
"""The set of modalities the model used to respond.
|
| 48 |
+
|
| 49 |
+
If there are multiple modalities, the model will pick one, for example if
|
| 50 |
+
`modalities` is `["text", "audio"]`, the model could be responding in either
|
| 51 |
+
text or audio.
|
| 52 |
+
"""
|
| 53 |
+
|
| 54 |
+
object: Optional[Literal["realtime.response"]] = None
|
| 55 |
+
"""The object type, must be `realtime.response`."""
|
| 56 |
+
|
| 57 |
+
output: Optional[List[ConversationItem]] = None
|
| 58 |
+
"""The list of output items generated by the response."""
|
| 59 |
+
|
| 60 |
+
output_audio_format: Optional[Literal["pcm16", "g711_ulaw", "g711_alaw"]] = None
|
| 61 |
+
"""The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`."""
|
| 62 |
+
|
| 63 |
+
status: Optional[Literal["completed", "cancelled", "failed", "incomplete"]] = None
|
| 64 |
+
"""
|
| 65 |
+
The final status of the response (`completed`, `cancelled`, `failed`, or
|
| 66 |
+
`incomplete`).
|
| 67 |
+
"""
|
| 68 |
+
|
| 69 |
+
status_details: Optional[RealtimeResponseStatus] = None
|
| 70 |
+
"""Additional details about the status."""
|
| 71 |
+
|
| 72 |
+
temperature: Optional[float] = None
|
| 73 |
+
"""Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8."""
|
| 74 |
+
|
| 75 |
+
usage: Optional[RealtimeResponseUsage] = None
|
| 76 |
+
"""Usage statistics for the Response, this will correspond to billing.
|
| 77 |
+
|
| 78 |
+
A Realtime API session will maintain a conversation context and append new Items
|
| 79 |
+
to the Conversation, thus output from previous turns (text and audio tokens)
|
| 80 |
+
will become the input for later turns.
|
| 81 |
+
"""
|
| 82 |
+
|
| 83 |
+
voice: Optional[Literal["alloy", "ash", "ballad", "coral", "echo", "sage", "shimmer", "verse"]] = None
|
| 84 |
+
"""
|
| 85 |
+
The voice the model used to respond. Current voice options are `alloy`, `ash`,
|
| 86 |
+
`ballad`, `coral`, `echo` `sage`, `shimmer` and `verse`.
|
| 87 |
+
"""
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/realtime_response_status.py
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing import Optional
|
| 4 |
+
from typing_extensions import Literal
|
| 5 |
+
|
| 6 |
+
from ...._models import BaseModel
|
| 7 |
+
|
| 8 |
+
__all__ = ["RealtimeResponseStatus", "Error"]
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
class Error(BaseModel):
|
| 12 |
+
code: Optional[str] = None
|
| 13 |
+
"""Error code, if any."""
|
| 14 |
+
|
| 15 |
+
type: Optional[str] = None
|
| 16 |
+
"""The type of error."""
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
class RealtimeResponseStatus(BaseModel):
|
| 20 |
+
error: Optional[Error] = None
|
| 21 |
+
"""
|
| 22 |
+
A description of the error that caused the response to fail, populated when the
|
| 23 |
+
`status` is `failed`.
|
| 24 |
+
"""
|
| 25 |
+
|
| 26 |
+
reason: Optional[Literal["turn_detected", "client_cancelled", "max_output_tokens", "content_filter"]] = None
|
| 27 |
+
"""The reason the Response did not complete.
|
| 28 |
+
|
| 29 |
+
For a `cancelled` Response, one of `turn_detected` (the server VAD detected a
|
| 30 |
+
new start of speech) or `client_cancelled` (the client sent a cancel event). For
|
| 31 |
+
an `incomplete` Response, one of `max_output_tokens` or `content_filter` (the
|
| 32 |
+
server-side safety filter activated and cut off the response).
|
| 33 |
+
"""
|
| 34 |
+
|
| 35 |
+
type: Optional[Literal["completed", "cancelled", "incomplete", "failed"]] = None
|
| 36 |
+
"""
|
| 37 |
+
The type of error that caused the response to fail, corresponding with the
|
| 38 |
+
`status` field (`completed`, `cancelled`, `incomplete`, `failed`).
|
| 39 |
+
"""
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/realtime_response_usage.py
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing import Optional
|
| 4 |
+
|
| 5 |
+
from ...._models import BaseModel
|
| 6 |
+
|
| 7 |
+
__all__ = ["RealtimeResponseUsage", "InputTokenDetails", "OutputTokenDetails"]
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
class InputTokenDetails(BaseModel):
|
| 11 |
+
audio_tokens: Optional[int] = None
|
| 12 |
+
"""The number of audio tokens used in the Response."""
|
| 13 |
+
|
| 14 |
+
cached_tokens: Optional[int] = None
|
| 15 |
+
"""The number of cached tokens used in the Response."""
|
| 16 |
+
|
| 17 |
+
text_tokens: Optional[int] = None
|
| 18 |
+
"""The number of text tokens used in the Response."""
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
class OutputTokenDetails(BaseModel):
|
| 22 |
+
audio_tokens: Optional[int] = None
|
| 23 |
+
"""The number of audio tokens used in the Response."""
|
| 24 |
+
|
| 25 |
+
text_tokens: Optional[int] = None
|
| 26 |
+
"""The number of text tokens used in the Response."""
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
class RealtimeResponseUsage(BaseModel):
|
| 30 |
+
input_token_details: Optional[InputTokenDetails] = None
|
| 31 |
+
"""Details about the input tokens used in the Response."""
|
| 32 |
+
|
| 33 |
+
input_tokens: Optional[int] = None
|
| 34 |
+
"""
|
| 35 |
+
The number of input tokens used in the Response, including text and audio
|
| 36 |
+
tokens.
|
| 37 |
+
"""
|
| 38 |
+
|
| 39 |
+
output_token_details: Optional[OutputTokenDetails] = None
|
| 40 |
+
"""Details about the output tokens used in the Response."""
|
| 41 |
+
|
| 42 |
+
output_tokens: Optional[int] = None
|
| 43 |
+
"""
|
| 44 |
+
The number of output tokens sent in the Response, including text and audio
|
| 45 |
+
tokens.
|
| 46 |
+
"""
|
| 47 |
+
|
| 48 |
+
total_tokens: Optional[int] = None
|
| 49 |
+
"""
|
| 50 |
+
The total number of tokens in the Response including input and output text and
|
| 51 |
+
audio tokens.
|
| 52 |
+
"""
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/realtime_server_event.py
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing import Union
|
| 4 |
+
from typing_extensions import Annotated, TypeAlias
|
| 5 |
+
|
| 6 |
+
from ...._utils import PropertyInfo
|
| 7 |
+
from .error_event import ErrorEvent
|
| 8 |
+
from .response_done_event import ResponseDoneEvent
|
| 9 |
+
from .session_created_event import SessionCreatedEvent
|
| 10 |
+
from .session_updated_event import SessionUpdatedEvent
|
| 11 |
+
from .response_created_event import ResponseCreatedEvent
|
| 12 |
+
from .response_text_done_event import ResponseTextDoneEvent
|
| 13 |
+
from .rate_limits_updated_event import RateLimitsUpdatedEvent
|
| 14 |
+
from .response_audio_done_event import ResponseAudioDoneEvent
|
| 15 |
+
from .response_text_delta_event import ResponseTextDeltaEvent
|
| 16 |
+
from .conversation_created_event import ConversationCreatedEvent
|
| 17 |
+
from .response_audio_delta_event import ResponseAudioDeltaEvent
|
| 18 |
+
from .conversation_item_created_event import ConversationItemCreatedEvent
|
| 19 |
+
from .conversation_item_deleted_event import ConversationItemDeletedEvent
|
| 20 |
+
from .response_output_item_done_event import ResponseOutputItemDoneEvent
|
| 21 |
+
from .input_audio_buffer_cleared_event import InputAudioBufferClearedEvent
|
| 22 |
+
from .response_content_part_done_event import ResponseContentPartDoneEvent
|
| 23 |
+
from .response_output_item_added_event import ResponseOutputItemAddedEvent
|
| 24 |
+
from .conversation_item_truncated_event import ConversationItemTruncatedEvent
|
| 25 |
+
from .response_content_part_added_event import ResponseContentPartAddedEvent
|
| 26 |
+
from .input_audio_buffer_committed_event import InputAudioBufferCommittedEvent
|
| 27 |
+
from .response_audio_transcript_done_event import ResponseAudioTranscriptDoneEvent
|
| 28 |
+
from .response_audio_transcript_delta_event import ResponseAudioTranscriptDeltaEvent
|
| 29 |
+
from .input_audio_buffer_speech_started_event import InputAudioBufferSpeechStartedEvent
|
| 30 |
+
from .input_audio_buffer_speech_stopped_event import InputAudioBufferSpeechStoppedEvent
|
| 31 |
+
from .response_function_call_arguments_done_event import ResponseFunctionCallArgumentsDoneEvent
|
| 32 |
+
from .response_function_call_arguments_delta_event import ResponseFunctionCallArgumentsDeltaEvent
|
| 33 |
+
from .conversation_item_input_audio_transcription_failed_event import ConversationItemInputAudioTranscriptionFailedEvent
|
| 34 |
+
from .conversation_item_input_audio_transcription_completed_event import (
|
| 35 |
+
ConversationItemInputAudioTranscriptionCompletedEvent,
|
| 36 |
+
)
|
| 37 |
+
|
| 38 |
+
__all__ = ["RealtimeServerEvent"]
|
| 39 |
+
|
| 40 |
+
RealtimeServerEvent: TypeAlias = Annotated[
|
| 41 |
+
Union[
|
| 42 |
+
ErrorEvent,
|
| 43 |
+
SessionCreatedEvent,
|
| 44 |
+
SessionUpdatedEvent,
|
| 45 |
+
ConversationCreatedEvent,
|
| 46 |
+
InputAudioBufferCommittedEvent,
|
| 47 |
+
InputAudioBufferClearedEvent,
|
| 48 |
+
InputAudioBufferSpeechStartedEvent,
|
| 49 |
+
InputAudioBufferSpeechStoppedEvent,
|
| 50 |
+
ConversationItemCreatedEvent,
|
| 51 |
+
ConversationItemInputAudioTranscriptionCompletedEvent,
|
| 52 |
+
ConversationItemInputAudioTranscriptionFailedEvent,
|
| 53 |
+
ConversationItemTruncatedEvent,
|
| 54 |
+
ConversationItemDeletedEvent,
|
| 55 |
+
ResponseCreatedEvent,
|
| 56 |
+
ResponseDoneEvent,
|
| 57 |
+
ResponseOutputItemAddedEvent,
|
| 58 |
+
ResponseOutputItemDoneEvent,
|
| 59 |
+
ResponseContentPartAddedEvent,
|
| 60 |
+
ResponseContentPartDoneEvent,
|
| 61 |
+
ResponseTextDeltaEvent,
|
| 62 |
+
ResponseTextDoneEvent,
|
| 63 |
+
ResponseAudioTranscriptDeltaEvent,
|
| 64 |
+
ResponseAudioTranscriptDoneEvent,
|
| 65 |
+
ResponseAudioDeltaEvent,
|
| 66 |
+
ResponseAudioDoneEvent,
|
| 67 |
+
ResponseFunctionCallArgumentsDeltaEvent,
|
| 68 |
+
ResponseFunctionCallArgumentsDoneEvent,
|
| 69 |
+
RateLimitsUpdatedEvent,
|
| 70 |
+
],
|
| 71 |
+
PropertyInfo(discriminator="type"),
|
| 72 |
+
]
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/response_audio_delta_event.py
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing_extensions import Literal
|
| 4 |
+
|
| 5 |
+
from ...._models import BaseModel
|
| 6 |
+
|
| 7 |
+
__all__ = ["ResponseAudioDeltaEvent"]
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
class ResponseAudioDeltaEvent(BaseModel):
|
| 11 |
+
content_index: int
|
| 12 |
+
"""The index of the content part in the item's content array."""
|
| 13 |
+
|
| 14 |
+
delta: str
|
| 15 |
+
"""Base64-encoded audio data delta."""
|
| 16 |
+
|
| 17 |
+
event_id: str
|
| 18 |
+
"""The unique ID of the server event."""
|
| 19 |
+
|
| 20 |
+
item_id: str
|
| 21 |
+
"""The ID of the item."""
|
| 22 |
+
|
| 23 |
+
output_index: int
|
| 24 |
+
"""The index of the output item in the response."""
|
| 25 |
+
|
| 26 |
+
response_id: str
|
| 27 |
+
"""The ID of the response."""
|
| 28 |
+
|
| 29 |
+
type: Literal["response.audio.delta"]
|
| 30 |
+
"""The event type, must be `response.audio.delta`."""
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/response_audio_done_event.py
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing_extensions import Literal
|
| 4 |
+
|
| 5 |
+
from ...._models import BaseModel
|
| 6 |
+
|
| 7 |
+
__all__ = ["ResponseAudioDoneEvent"]
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
class ResponseAudioDoneEvent(BaseModel):
|
| 11 |
+
content_index: int
|
| 12 |
+
"""The index of the content part in the item's content array."""
|
| 13 |
+
|
| 14 |
+
event_id: str
|
| 15 |
+
"""The unique ID of the server event."""
|
| 16 |
+
|
| 17 |
+
item_id: str
|
| 18 |
+
"""The ID of the item."""
|
| 19 |
+
|
| 20 |
+
output_index: int
|
| 21 |
+
"""The index of the output item in the response."""
|
| 22 |
+
|
| 23 |
+
response_id: str
|
| 24 |
+
"""The ID of the response."""
|
| 25 |
+
|
| 26 |
+
type: Literal["response.audio.done"]
|
| 27 |
+
"""The event type, must be `response.audio.done`."""
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/response_audio_transcript_delta_event.py
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing_extensions import Literal
|
| 4 |
+
|
| 5 |
+
from ...._models import BaseModel
|
| 6 |
+
|
| 7 |
+
__all__ = ["ResponseAudioTranscriptDeltaEvent"]
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
class ResponseAudioTranscriptDeltaEvent(BaseModel):
|
| 11 |
+
content_index: int
|
| 12 |
+
"""The index of the content part in the item's content array."""
|
| 13 |
+
|
| 14 |
+
delta: str
|
| 15 |
+
"""The transcript delta."""
|
| 16 |
+
|
| 17 |
+
event_id: str
|
| 18 |
+
"""The unique ID of the server event."""
|
| 19 |
+
|
| 20 |
+
item_id: str
|
| 21 |
+
"""The ID of the item."""
|
| 22 |
+
|
| 23 |
+
output_index: int
|
| 24 |
+
"""The index of the output item in the response."""
|
| 25 |
+
|
| 26 |
+
response_id: str
|
| 27 |
+
"""The ID of the response."""
|
| 28 |
+
|
| 29 |
+
type: Literal["response.audio_transcript.delta"]
|
| 30 |
+
"""The event type, must be `response.audio_transcript.delta`."""
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/response_audio_transcript_done_event.py
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing_extensions import Literal
|
| 4 |
+
|
| 5 |
+
from ...._models import BaseModel
|
| 6 |
+
|
| 7 |
+
__all__ = ["ResponseAudioTranscriptDoneEvent"]
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
class ResponseAudioTranscriptDoneEvent(BaseModel):
|
| 11 |
+
content_index: int
|
| 12 |
+
"""The index of the content part in the item's content array."""
|
| 13 |
+
|
| 14 |
+
event_id: str
|
| 15 |
+
"""The unique ID of the server event."""
|
| 16 |
+
|
| 17 |
+
item_id: str
|
| 18 |
+
"""The ID of the item."""
|
| 19 |
+
|
| 20 |
+
output_index: int
|
| 21 |
+
"""The index of the output item in the response."""
|
| 22 |
+
|
| 23 |
+
response_id: str
|
| 24 |
+
"""The ID of the response."""
|
| 25 |
+
|
| 26 |
+
transcript: str
|
| 27 |
+
"""The final transcript of the audio."""
|
| 28 |
+
|
| 29 |
+
type: Literal["response.audio_transcript.done"]
|
| 30 |
+
"""The event type, must be `response.audio_transcript.done`."""
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/response_cancel_event.py
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing import Optional
|
| 4 |
+
from typing_extensions import Literal
|
| 5 |
+
|
| 6 |
+
from ...._models import BaseModel
|
| 7 |
+
|
| 8 |
+
__all__ = ["ResponseCancelEvent"]
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
class ResponseCancelEvent(BaseModel):
|
| 12 |
+
type: Literal["response.cancel"]
|
| 13 |
+
"""The event type, must be `response.cancel`."""
|
| 14 |
+
|
| 15 |
+
event_id: Optional[str] = None
|
| 16 |
+
"""Optional client-generated ID used to identify this event."""
|
| 17 |
+
|
| 18 |
+
response_id: Optional[str] = None
|
| 19 |
+
"""
|
| 20 |
+
A specific response ID to cancel - if not provided, will cancel an in-progress
|
| 21 |
+
response in the default conversation.
|
| 22 |
+
"""
|
.venv/lib/python3.11/site-packages/openai/types/beta/realtime/response_cancel_event_param.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from typing_extensions import Literal, Required, TypedDict
|
| 6 |
+
|
| 7 |
+
__all__ = ["ResponseCancelEventParam"]
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
class ResponseCancelEventParam(TypedDict, total=False):
|
| 11 |
+
type: Required[Literal["response.cancel"]]
|
| 12 |
+
"""The event type, must be `response.cancel`."""
|
| 13 |
+
|
| 14 |
+
event_id: str
|
| 15 |
+
"""Optional client-generated ID used to identify this event."""
|
| 16 |
+
|
| 17 |
+
response_id: str
|
| 18 |
+
"""
|
| 19 |
+
A specific response ID to cancel - if not provided, will cancel an in-progress
|
| 20 |
+
response in the default conversation.
|
| 21 |
+
"""
|