From c6c2aeaff513f8b465fd2e5b8becc88b75b07eda Mon Sep 17 00:00:00 2001 From: yoni-oai <338284798+yoni-oai@users.noreply.github.com> Date: Fri, 16 Oct 2026 02:51:12 +0000 Subject: [PATCH] feat(api): support Decisions in Live sessions Castiron-Internal-PR: https://github.com/openai/openai-python-internal/pull/263 Castiron-Source-SHA: 2e98884f07a5c944ca3d2a7416e9a402ca4fadcd Castiron-Public-Base-SHA: 325da45934ddb1c1b6a0bed1681a8cf46c9a8712 --- .castiron.stats.yml | 14 +- api_reference/openapi.transformed.yml | 737 +++++++++++++++++- scripts/castiron/generated-files.json | 112 ++- src/openai/resources/live/api.md | 9 + src/openai/resources/live/forks.py | 91 ++- src/openai/resources/live/live.py | 90 ++- src/openai/resources/live/sideband.py | 91 ++- src/openai/types/live/__init__.py | 17 + src/openai/types/live/client_event.py | 6 + src/openai/types/live/client_event_param.py | 6 + src/openai/types/live/connect_client_event.py | 6 + .../types/live/connect_client_event_param.py | 6 + src/openai/types/live/connect_server_event.py | 6 + .../types/live/decision_create_event.py | 17 + .../types/live/decision_create_event_param.py | 17 + src/openai/types/live/decision_event.py | 47 ++ .../types/live/decision_item_create_event.py | 71 ++ .../live/decision_item_create_event_param.py | 68 ++ .../types/live/decision_item_created_event.py | 72 ++ .../types/live/decision_item_delete_event.py | 24 + .../live/decision_item_delete_event_param.py | 24 + .../types/live/decision_item_deleted_event.py | 25 + src/openai/types/live/decision_trigger.py | 104 +++ .../types/live/decision_trigger_param.py | 96 +++ .../types/live/decisions_delegation_config.py | 85 ++ .../live/decisions_delegation_config_param.py | 79 ++ .../decisions_delegation_update_config.py | 85 ++ ...ecisions_delegation_update_config_param.py | 79 ++ .../types/live/delegation_created_event.py | 11 +- src/openai/types/live/fork_client_event.py | 6 + .../types/live/fork_client_event_param.py | 6 + src/openai/types/live/fork_server_event.py | 6 + .../types/live/media_session_config_param.py | 32 +- src/openai/types/live/server_event.py | 6 + .../types/live/session_accept_params.py | 23 +- src/openai/types/live/session_config.py | 32 +- src/openai/types/live/session_config_param.py | 32 +- src/openai/types/live/session_resource.py | 32 +- .../types/live/session_update_config.py | 27 +- .../types/live/session_update_config_param.py | 27 +- src/openai/types/live/session_update_event.py | 9 +- .../types/live/session_update_event_param.py | 9 +- tests/api_resources/live/test_sessions.py | 30 + tests/api_resources/test_live.py | 30 + 44 files changed, 2304 insertions(+), 98 deletions(-) create mode 100644 src/openai/types/live/decision_create_event.py create mode 100644 src/openai/types/live/decision_create_event_param.py create mode 100644 src/openai/types/live/decision_event.py create mode 100644 src/openai/types/live/decision_item_create_event.py create mode 100644 src/openai/types/live/decision_item_create_event_param.py create mode 100644 src/openai/types/live/decision_item_created_event.py create mode 100644 src/openai/types/live/decision_item_delete_event.py create mode 100644 src/openai/types/live/decision_item_delete_event_param.py create mode 100644 src/openai/types/live/decision_item_deleted_event.py create mode 100644 src/openai/types/live/decision_trigger.py create mode 100644 src/openai/types/live/decision_trigger_param.py create mode 100644 src/openai/types/live/decisions_delegation_config.py create mode 100644 src/openai/types/live/decisions_delegation_config_param.py create mode 100644 src/openai/types/live/decisions_delegation_update_config.py create mode 100644 src/openai/types/live/decisions_delegation_update_config_param.py diff --git a/.castiron.stats.yml b/.castiron.stats.yml index 4b053fd2ac..75cfeb462a 100644 --- a/.castiron.stats.yml +++ b/.castiron.stats.yml @@ -1,8 +1,8 @@ schema_version: 1 -generation_id: 7c22cf25-abcc-4a38-a881-75ab8f35f4f3 -openapi_spec_hash: 437dce4de9f089780656c33ebc51630a -openapi_transformed_spec_hash: 3cf328f9ae72ee682ef1a9fd336c38c3 -config_hash: 2f0a7ff931fec8c1d94b9556ddf66fdd -codegen_sha: 5597f5eb9ca6f53bddcf09ef58bd7073b44eeb42 -codegen_hash: b596892647a3dd6ae9474fda30191de9138d733a7a94b65adf5e36935c7a5da0 -public_codegen_sha: d61f6590fce730f6a08c710f15f706e6778486f5 +generation_id: 4655b3fd-100f-41ed-a911-2a1a9d32ea2b +openapi_spec_hash: 2013b5fe3879ad548bef3c02a8400e28 +openapi_transformed_spec_hash: ebaa4dc38d766dcc79436fa46d7578b5 +config_hash: e2240ed667dcf3afd130abd71b47b9fc +codegen_sha: 096a813d99130ad2016e14f79774c24773508eee +codegen_hash: a162fbfb7bc65621f28757a1057460101763c6d38f99aff46d045581f34361d8 +public_codegen_sha: 89aff405340b117ab2b7c2e790c2baea90439069 diff --git a/api_reference/openapi.transformed.yml b/api_reference/openapi.transformed.yml index 162cdadd75..a65135f9c1 100644 --- a/api_reference/openapi.transformed.yml +++ b/api_reference/openapi.transformed.yml @@ -50523,6 +50523,8 @@ components: default: live x-stainless-const: true description: The session type. Always `live`. + triggers: + $ref: '#/components/schemas/triggers' required: - model - type @@ -50566,6 +50568,9 @@ components: - $ref: '#/components/schemas/LiveInstructionsAppendParam' - $ref: '#/components/schemas/LiveThinkingAppendParam' - $ref: '#/components/schemas/LiveCommentaryAppendParam' + - $ref: '#/components/schemas/LiveDecisionCreateParam' + - $ref: '#/components/schemas/LiveDecisionItemCreateParam' + - $ref: '#/components/schemas/LiveDecisionItemDeleteParam' - $ref: '#/components/schemas/LiveResponseItemCreateParam' - $ref: '#/components/schemas/LiveResponseCreateParam' - $ref: '#/components/schemas/LiveSessionCloseParam' @@ -50624,6 +50629,9 @@ components: - $ref: '#/components/schemas/LiveInstructionsAppendParam' - $ref: '#/components/schemas/LiveThinkingAppendParam' - $ref: '#/components/schemas/LiveCommentaryAppendParam' + - $ref: '#/components/schemas/LiveDecisionCreateParam' + - $ref: '#/components/schemas/LiveDecisionItemCreateParam' + - $ref: '#/components/schemas/LiveDecisionItemDeleteParam' - $ref: '#/components/schemas/LiveResponseItemCreateParam' - $ref: '#/components/schemas/LiveResponseCreateParam' - $ref: '#/components/schemas/LiveSessionCloseParam' @@ -50678,6 +50686,8 @@ components: $ref: '#/components/schemas/input' client: $ref: '#/components/schemas/LiveClientConfigParam' + triggers: + $ref: '#/components/schemas/triggers' required: - model additionalProperties: false @@ -50819,6 +50829,9 @@ components: - $ref: '#/components/schemas/LiveInstructionsAppendParam' - $ref: '#/components/schemas/LiveThinkingAppendParam' - $ref: '#/components/schemas/LiveCommentaryAppendParam' + - $ref: '#/components/schemas/LiveDecisionCreateParam' + - $ref: '#/components/schemas/LiveDecisionItemCreateParam' + - $ref: '#/components/schemas/LiveDecisionItemDeleteParam' - $ref: '#/components/schemas/LiveResponseItemCreateParam' - $ref: '#/components/schemas/LiveResponseCreateParam' - $ref: '#/components/schemas/LiveSessionCloseParam' @@ -50856,6 +50869,9 @@ components: - $ref: '#/components/schemas/LiveInputTranscriptDelta' - $ref: '#/components/schemas/LiveOutputTranscriptDelta' - $ref: '#/components/schemas/LiveDelegationCreated' + - $ref: '#/components/schemas/LiveDecisionEvent' + - $ref: '#/components/schemas/LiveDecisionItemCreated' + - $ref: '#/components/schemas/LiveDecisionItemDeleted' - $ref: '#/components/schemas/LiveResponseEvent' - $ref: '#/components/schemas/LiveSessionUsageUpdated' - $ref: '#/components/schemas/LiveSessionClosed' @@ -78001,12 +78017,13 @@ components: - responses delegation: anyOf: - - description: Who handles tasks delegated by the Live model. Omitted or null selects your application; use `responses` to let the API manage a Responses backend. + - description: Who handles tasks delegated by the Live model. Omitted or null selects your application; use `responses` or `decisions` to delegate to the corresponding API. discriminator: propertyName: type anyOf: - $ref: '#/components/schemas/LiveClientDelegationParam' - $ref: '#/components/schemas/LiveResponsesDelegationParam' + - $ref: '#/components/schemas/LiveDecisionsDelegationParam' - type: 'null' store: description: Whether to store the session for later forking and recording download. Defaults to false for new sessions. @@ -92167,12 +92184,13 @@ components: $ref: '#/components/schemas/LiveInitialSessionAudioParam' delegation: anyOf: - - description: Who handles tasks delegated by the Live model. Omitted or null selects your application; use `responses` to let the API manage a Responses backend. + - description: Who handles tasks delegated by the Live model. Omitted or null selects your application; use `responses` or `decisions` to delegate to the corresponding API. discriminator: propertyName: type anyOf: - $ref: '#/components/schemas/LiveClientDelegationParam' - $ref: '#/components/schemas/LiveResponsesDelegationParam' + - $ref: '#/components/schemas/LiveDecisionsDelegationParam' - type: 'null' store: description: Whether to store the session for later forking and recording download. Defaults to false for new sessions. @@ -92180,6 +92198,12 @@ components: client: description: Startup-only capabilities for an untrusted frontend attached to a unified WebRTC session. Trusted sideband connections are unaffected. $ref: '#/components/schemas/LiveClientConfigParam' + triggers: + description: At most one Decisions trigger per transcript event type. Triggers run independently of delegation. On update, omit triggers to keep the current configuration, send a list to replace it, or send an empty list to disable triggers. + type: array + items: + $ref: '#/components/schemas/LiveDecisionTriggerInputParam' + maxItems: 2 required: - model LiveSessionStartEvent: @@ -92235,7 +92259,7 @@ components: delegation: type: client LiveSessionUpdateParams: - description: Changes to an active Live session. Only delegation backend settings can be updated after startup. + description: Changes to an active Live session's delegation settings and transcript triggers. type: object properties: delegation: @@ -92246,10 +92270,13 @@ components: anyOf: - $ref: '#/components/schemas/LiveClientDelegationParam' - $ref: '#/components/schemas/LiveResponsesDelegationUpdateParam' + - $ref: '#/components/schemas/LiveDecisionsDelegationUpdateParam' - type: 'null' + triggers: + $ref: '#/components/schemas/LiveSessionCreateParams/properties/triggers' required: [] LiveSessionUpdateParam: - description: Update the delegation settings of an active Live session. The server acknowledges accepted changes with `session.updated`. + description: Update the delegation settings or transcript triggers of an active Live session. The server acknowledges accepted changes with `session.updated`. example: type: session.update event_id: evt_update_001 @@ -92275,7 +92302,7 @@ components: enum: - session.update session: - description: Sparse delegation updates. Omitted settings retain their values. The delegation type cannot change, including resetting Responses delegation to null or client. Model, frontend instructions, audio, and startup input are immutable. + description: Sparse delegation and trigger updates. Omitted settings retain their values. The delegation type cannot change. Model, frontend instructions, audio, and startup input are immutable. $ref: '#/components/schemas/LiveSessionUpdateParams' required: - type @@ -92700,12 +92727,13 @@ components: $ref: '#/components/schemas/LiveInitialSessionAudioParam' delegation: anyOf: - - description: Who handles tasks delegated by the Live model. Omitted or null selects your application; use `responses` to let the API manage a Responses backend. + - description: Who handles tasks delegated by the Live model. Omitted or null selects your application; use `responses` or `decisions` to delegate to the corresponding API. discriminator: propertyName: type anyOf: - $ref: '#/components/schemas/LiveClientDelegationParam' - $ref: '#/components/schemas/LiveResponsesDelegationParam' + - $ref: '#/components/schemas/LiveDecisionsDelegationParam' - type: 'null' store: description: Whether to store the session for later forking and recording download. Defaults to false for new sessions. @@ -92726,6 +92754,8 @@ components: type: string enum: - active + triggers: + $ref: '#/components/schemas/LiveSessionCreateParams/properties/triggers' required: - model - id @@ -93251,11 +93281,11 @@ components: start_ms: 5400 end_ms: 7200 LiveDelegationItem: - description: Metadata for work delegated by the Live model. Client delegations are handled by your application; Responses delegations run on the configured backend. + description: Metadata for work delegated by the Live model to your application, Responses, or Decisions. type: object properties: id: - description: The unique ID of the delegation. Use this as delegation_id when replying to client-owned work or correlating Responses events. + description: The unique ID of the delegation. Use this as delegation_id when replying to client-owned work or correlating backend events. type: string type: description: The object type, always `delegation`. @@ -93265,7 +93295,7 @@ components: enum: - delegation target: - description: 'Where the Live model delegated the work: `client` for your application, or `responses` for the configured Responses backend.' + description: 'Where the Live model delegated the work: `client`, `responses`, or `decisions`.' anyOf: - default: client x-stainless-const: true @@ -93277,6 +93307,11 @@ components: type: string enum: - responses + - default: decisions + x-stainless-const: true + type: string + enum: + - decisions response_id: description: The ID of the Responses API response associated with a Responses delegation. Omitted for client delegations. type: string @@ -93285,7 +93320,7 @@ components: - type - target LiveDelegationCreated: - description: Returned when the Live model delegates work to your application or a Responses backend. Contains delegation metadata and the position on the session timeline where the work was delegated. + description: Returned when the Live model delegates work to your application, Responses, or Decisions. Contains delegation metadata and the position on the session timeline where the work was delegated. example: type: session.delegation.created event_id: evt_delegation_001 @@ -93852,6 +93887,9 @@ components: - $ref: '#/components/schemas/LiveInputTranscriptDelta' - $ref: '#/components/schemas/LiveOutputTranscriptDelta' - $ref: '#/components/schemas/LiveDelegationCreated' + - $ref: '#/components/schemas/LiveDecisionEvent' + - $ref: '#/components/schemas/LiveDecisionItemCreated' + - $ref: '#/components/schemas/LiveDecisionItemDeleted' - $ref: '#/components/schemas/LiveResponseEvent' - $ref: '#/components/schemas/LiveSessionUsageUpdated' - $ref: '#/components/schemas/LiveSessionClosed' @@ -106622,6 +106660,667 @@ components: - $ref: '#/components/schemas/BetaResponseCustomToolCallInputDoneEvent' discriminator: propertyName: type + LiveDecisionChoiceParam: + type: object + properties: + value: + anyOf: + - type: string + - type: boolean + description: + type: string + required: + - value + LiveDecisionChoiceQuestionParam: + type: object + properties: + type: + default: choice + x-stainless-const: true + type: string + enum: + - choice + name: + type: string + instructions: + type: string + choices: + type: array + items: + $ref: '#/components/schemas/LiveDecisionChoiceParam' + minItems: 2 + maxItems: 255 + required: + - type + - instructions + - choices + LiveDecisionPredicateQuestionParam: + type: object + properties: + type: + default: predicate + x-stainless-const: true + type: string + enum: + - predicate + name: + type: string + instructions: + type: string + required: + - type + - instructions + LiveDecisionScoreLevelParam: + type: object + properties: + label: + type: string + description: + type: string + required: + - label + LiveDecisionScoreQuestionParam: + type: object + properties: + type: + default: score + x-stainless-const: true + type: string + enum: + - score + name: + type: string + instructions: + type: string + levels: + type: array + items: + $ref: '#/components/schemas/LiveDecisionScoreLevelParam' + minItems: 2 + maxItems: 10 + required: + - type + - instructions + - levels + LiveDecisionQuestion: + discriminator: + propertyName: type + anyOf: + - $ref: '#/components/schemas/LiveDecisionChoiceQuestionParam' + - $ref: '#/components/schemas/LiveDecisionPredicateQuestionParam' + - $ref: '#/components/schemas/LiveDecisionScoreQuestionParam' + LiveDecisionsSettingsInputParam: + type: object + properties: + questions: + description: Native Decision API questions evaluated together, in order. + type: array + items: + $ref: '#/components/schemas/QuestionParam' + minItems: 1 + maxItems: 64 + model: + type: string + minLength: 1 + required: + - questions + - model + LiveDecisionsDelegationParam: + type: object + properties: + type: + default: decisions + x-stainless-const: true + type: string + enum: + - decisions + decisions: + $ref: '#/components/schemas/LiveDecisionsSettingsInputParam' + required: + - type + - decisions + LiveDecisionQuestionsInputParam: + description: Questions evaluated using the current transcript and the session's shared Decision items. + type: object + properties: + questions: + description: Native Decision API questions evaluated together, in order. + type: array + items: + $ref: '#/components/schemas/QuestionParam' + minItems: 1 + maxItems: 64 + required: + - questions + LiveDecisionTriggerInputParam: + type: object + properties: + type: + default: decisions + x-stainless-const: true + type: string + enum: + - decisions + event_type: + type: string + enum: + - session.input_transcript.delta + - session.output_transcript.delta + decisions: + description: Questions evaluated using the current transcript and the session's shared Decision items. + $ref: '#/components/schemas/LiveDecisionQuestionsInputParam' + required: + - type + - event_type + - decisions + additionalProperties: false + triggers: + description: At most one Decisions trigger per transcript event type. Triggers run independently of delegation. On update, omit triggers to keep the current configuration, send a list to replace it, or send an empty list to disable triggers. + type: array + items: + $ref: '#/components/schemas/LiveDecisionTriggerInputParam' + maxItems: 2 + LiveDecisionsSettingsInputParam-2: + type: object + properties: + questions: + description: Native Decision API questions evaluated together, in order. + type: array + items: + $ref: '#/components/schemas/QuestionParam' + minItems: 1 + maxItems: 64 + model: + type: string + minLength: 1 + required: + - questions + - model + LiveDecisionsDelegationParam-2: + type: object + properties: + type: + default: decisions + x-stainless-const: true + type: string + enum: + - decisions + decisions: + $ref: '#/components/schemas/LiveDecisionsSettingsInputParam-2' + required: + - type + - decisions + LiveDecisionQuestionsInputParam-2: + description: Questions evaluated using the current transcript and the session's shared Decision items. + type: object + properties: + questions: + description: Native Decision API questions evaluated together, in order. + type: array + items: + $ref: '#/components/schemas/QuestionParam' + minItems: 1 + maxItems: 64 + required: + - questions + LiveDecisionTriggerInputParam-2: + type: object + properties: + type: + default: decisions + x-stainless-const: true + type: string + enum: + - decisions + event_type: + type: string + enum: + - session.input_transcript.delta + - session.output_transcript.delta + decisions: + description: Questions evaluated using the current transcript and the session's shared Decision items. + $ref: '#/components/schemas/LiveDecisionQuestionsInputParam-2' + required: + - type + - event_type + - decisions + additionalProperties: false + LiveDecisionsSettingsUpdateParam: + type: object + properties: + model: + type: string + minLength: 1 + questions: + description: Native Decision API questions evaluated together, in order. + type: array + items: + $ref: '#/components/schemas/QuestionParam' + minItems: 1 + maxItems: 64 + required: [] + LiveDecisionsDelegationUpdateParam: + type: object + properties: + type: + default: decisions + x-stainless-const: true + type: string + enum: + - decisions + decisions: + $ref: '#/components/schemas/LiveDecisionsSettingsUpdateParam' + required: + - type + LiveDecisionCreateParam: + description: Evaluate the configured questions using the current conversation and Decision inputs. Reusing an event_id is rejected for the lifetime of the session. + example: + type: decision.create + event_id: decision_1 + type: object + properties: + event_id: + type: string + minLength: 1 + maxLength: 256 + type: + default: decision.create + x-stainless-const: true + type: string + enum: + - decision.create + required: + - event_id + - type + x-oaiMeta: + example: + type: decision.create + event_id: decision_1 + LiveDecisionInputTextParam: + type: object + properties: + type: + description: The type of the input item. Always `input_text`. + default: input_text + x-stainless-const: true + type: string + enum: + - input_text + text: + description: The text input to the model. + type: string + maxLength: 10485760 + required: + - type + - text + LiveDetailEnum: + type: string + enum: + - low + - high + - auto + - original + LiveDecisionInputImageParam: + type: object + properties: + type: + description: The type of the input item. Always `input_image`. + default: input_image + x-stainless-const: true + type: string + enum: + - input_image + image_url: + description: An inline image encoded as a data URL. + type: string + maxLength: 20971520 + pattern: '^data:' + detail: + anyOf: + - description: The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + $ref: '#/components/schemas/LiveDetailEnum' + - type: 'null' + required: + - type + - image_url + LiveDecisionInputItemParam: + type: object + properties: + id: + anyOf: + - description: The unique ID of this message item. + type: string + - type: 'null' + type: + default: message + x-stainless-const: true + type: string + enum: + - message + role: + description: The message role. Always `user`. + default: user + x-stainless-const: true + type: string + enum: + - user + content: + anyOf: + - description: The text input to the model. + type: string + maxLength: 10485760 + - type: array + items: + discriminator: + propertyName: type + anyOf: + - $ref: '#/components/schemas/LiveDecisionInputTextParam' + - $ref: '#/components/schemas/LiveDecisionInputImageParam' + x-stainless-variantName: parts + required: + - role + - content + LiveDecisionItemCreateParam: + description: Append an input item for future decisions without starting an evaluation or changing Live voice context. + example: + type: decision.item.create + event_id: browser_1 + item: + type: message + role: user + content: + - type: input_text + text: Wikipedia is open. + type: object + properties: + event_id: + anyOf: + - description: Optional client identifier for correlating this command with a server event's client_event_id or error.client_event_id. + type: string + maxLength: 512 + - type: 'null' + type: + default: decision.item.create + x-stainless-const: true + type: string + enum: + - decision.item.create + item: + $ref: '#/components/schemas/LiveDecisionInputItemParam' + required: + - type + - item + x-oaiMeta: + example: + type: decision.item.create + event_id: browser_1 + item: + type: message + role: user + content: + - type: input_text + text: Wikipedia is open. + LiveDecisionItemDeleteParam: + description: Delete an input item from future decisions without starting an evaluation or changing Live voice context. + example: + type: decision.item.delete + event_id: remove_browser_1 + item_id: msg_browser_1 + type: object + properties: + event_id: + anyOf: + - description: Optional client identifier for correlating this command with a server event's client_event_id or error.client_event_id. + type: string + maxLength: 512 + - type: 'null' + type: + default: decision.item.delete + x-stainless-const: true + type: string + enum: + - decision.item.delete + item_id: + type: string + minLength: 1 + required: + - type + - item_id + x-oaiMeta: + example: + type: decision.item.delete + event_id: remove_browser_1 + item_id: msg_browser_1 + LiveDecisionCompleted: + type: object + properties: + type: + default: decision.completed + x-stainless-const: true + type: string + enum: + - decision.completed + decision: + description: The native Decision API response, including its model, ordered answers, and token usage. + $ref: '#/components/schemas/DecisionResponse' + required: + - type + - decision + LiveDecisionEvent: + description: A Decision API event for a Live delegation or transcript trigger. For a trigger, source_event_id identifies the transcript delta that caused this evaluation. + example: + type: decision.event + event_id: evt_decision_1 + delegation_id: del_abc123 + trigger_id: null + source_event_type: null + source_event_id: null + event: + type: decision.completed + decision: + model: gpt-6-luna + answers: + - type: predicate + name: damaged + probability: 0.95 + usage: + input_tokens: 42 + input_tokens_details: + cached_tokens: 0 + cache_write_tokens: 0 + output_tokens: 0 + output_tokens_details: + reasoning_tokens: 0 + total_tokens: 42 + type: object + properties: + type: + default: decision.event + x-stainless-const: true + type: string + enum: + - decision.event + event_id: + description: The unique ID of this Live server event. + type: string + delegation_id: + anyOf: + - description: The Live delegation ID, or null for a transcript trigger. + type: string + - type: 'null' + trigger_id: + anyOf: + - description: The Live-assigned ID of this trigger firing, or null for a delegation. + type: string + - type: 'null' + source_event_type: + anyOf: + - anyOf: + - default: session.input_transcript.delta + x-stainless-const: true + type: string + enum: + - session.input_transcript.delta + - default: session.output_transcript.delta + x-stainless-const: true + type: string + enum: + - session.output_transcript.delta + - type: 'null' + source_event_id: + anyOf: + - description: The event_id of the transcript delta that fired this trigger, or null for a delegation. + type: string + - type: 'null' + event: + $ref: '#/components/schemas/LiveDecisionCompleted' + required: + - type + - event_id + - delegation_id + - trigger_id + - source_event_type + - source_event_id + - event + x-oaiMeta: + example: + type: decision.event + event_id: evt_decision_1 + delegation_id: del_abc123 + trigger_id: null + source_event_type: null + source_event_id: null + event: + type: decision.completed + decision: + model: gpt-6-luna + answers: + - type: predicate + name: damaged + probability: 0.95 + usage: + input_tokens: 42 + input_tokens_details: + cached_tokens: 0 + cache_write_tokens: 0 + output_tokens: 0 + output_tokens_details: + reasoning_tokens: 0 + total_tokens: 42 + LiveDecisionStoredInputItemParam: + type: object + properties: + id: + description: The ID of the stored Decision input item. + type: string + type: + default: message + x-stainless-const: true + type: string + enum: + - message + role: + description: The message role. Always `user`. + default: user + x-stainless-const: true + type: string + enum: + - user + content: + anyOf: + - description: The text input to the model. + type: string + maxLength: 10485760 + - type: array + items: + discriminator: + propertyName: type + anyOf: + - $ref: '#/components/schemas/LiveDecisionInputTextParam' + - $ref: '#/components/schemas/LiveDecisionInputImageParam' + x-stainless-variantName: parts + required: + - id + - role + - content + LiveDecisionItemCreated: + description: An input item was appended for future decisions. + example: + type: decision.item.created + event_id: evt_item_1 + client_event_id: browser_1 + item: + id: msg_browser_1 + type: message + role: user + content: + - type: input_text + text: Wikipedia is open. + type: object + properties: + event_id: + description: The unique ID of the Live server event. + type: string + client_event_id: + description: The event_id of the client command associated with this server event, when supplied. + type: string + type: + default: decision.item.created + x-stainless-const: true + type: string + enum: + - decision.item.created + item: + $ref: '#/components/schemas/LiveDecisionStoredInputItemParam' + required: + - event_id + - type + - item + x-oaiMeta: + example: + type: decision.item.created + event_id: evt_item_1 + client_event_id: browser_1 + item: + id: msg_browser_1 + type: message + role: user + content: + - type: input_text + text: Wikipedia is open. + LiveDecisionItemDeleted: + description: An input item was removed from future decisions. + example: + type: decision.item.deleted + event_id: evt_item_deleted_1 + client_event_id: remove_browser_1 + item_id: msg_browser_1 + type: object + properties: + event_id: + description: The unique ID of the Live server event. + type: string + client_event_id: + description: The event_id of the client command associated with this server event, when supplied. + type: string + type: + default: decision.item.deleted + x-stainless-const: true + type: string + enum: + - decision.item.deleted + item_id: + type: string + required: + - event_id + - type + - item_id + x-oaiMeta: + example: + type: decision.item.deleted + event_id: evt_item_deleted_1 + client_event_id: remove_browser_1 + item_id: msg_browser_1 OAuthErrorCode: anyOf: - enum: @@ -108383,6 +109082,15 @@ x-oaiMeta: - type: object key: LiveCommentaryAppendParam path: + - type: object + key: LiveDecisionCreateParam + path: + - type: object + key: LiveDecisionItemCreateParam + path: + - type: object + key: LiveDecisionItemDeleteParam + path: - type: object key: LiveResponseItemCreateParam path: @@ -108445,6 +109153,15 @@ x-oaiMeta: - type: object key: LiveDelegationCreated path: + - type: object + key: LiveDecisionEvent + path: + - type: object + key: LiveDecisionItemCreated + path: + - type: object + key: LiveDecisionItemDeleted + path: - type: object key: LiveResponseEvent path: diff --git a/scripts/castiron/generated-files.json b/scripts/castiron/generated-files.json index 7c378796c6..90ca69d87e 100644 --- a/scripts/castiron/generated-files.json +++ b/scripts/castiron/generated-files.json @@ -587,15 +587,15 @@ }, "src/openai/resources/live/api.md": { "mode": "100644", - "sha256": "b83a36932cc9ec2208239217212bfdee0da4622af134d2ee16adbd17b485971c" + "sha256": "51637687f10e9c213190b7d37d4ba4d05b66365eb7b4b19c284735a1f5c11b28" }, "src/openai/resources/live/forks.py": { "mode": "100644", - "sha256": "511f3acc011a8973205d9e751dcdb0507dc4042003ff44c75e44bfdb9098c574" + "sha256": "440a44366c6896286b95c398b2ea98f34844600af22513e9ebbe8ca497556d90" }, "src/openai/resources/live/live.py": { "mode": "100644", - "sha256": "2d77497d9bd9bf12b571a0856e449d8b3e6f410926301b4f19a6bd8a743b05e2" + "sha256": "f1ae78c0bffef766fbb859f1a9ffb307bcbab646b9da2d741099449914f9a42a" }, "src/openai/resources/live/sessions.py": { "mode": "100644", @@ -603,7 +603,7 @@ }, "src/openai/resources/live/sideband.py": { "mode": "100644", - "sha256": "c4c3e50cb9e0d04069e409c5d79017a2cd749ef30a54a22fa751e4260fa17271" + "sha256": "486f51b77fea40ab0f6393d0aa01b083aefff9fa2ba8e9c076e4757a10d7ab3a" }, "src/openai/resources/models.py": { "mode": "100644", @@ -4499,7 +4499,7 @@ }, "src/openai/types/live/__init__.py": { "mode": "100644", - "sha256": "a5d92e94e48d575068921b35f204a40e6ae89767dd7d5e7dc6d525620cec9691" + "sha256": "77b3c02ca1cad18baffc045de6175987c738651ac116599018f1595cb74a2791" }, "src/openai/types/live/audio_format.py": { "mode": "100644", @@ -4531,11 +4531,11 @@ }, "src/openai/types/live/client_event.py": { "mode": "100644", - "sha256": "bf419cbd78ac68326fde9803e167a86039e6229658437edbcdf6b3bbcf8ae263" + "sha256": "a740fc48cb87dae346125ee7cf4a5b9b14afbf4011f0d9645a0b3795fd1f7583" }, "src/openai/types/live/client_event_param.py": { "mode": "100644", - "sha256": "0f4c74c64d159fac654ab67e2921eae1201a369378ce68feb3119f660fc9de5e" + "sha256": "17ff363936c69679b002eb3cf55fed17e5df9d242dc2f7714dee87388e6be5ee" }, "src/openai/types/live/commentary_append_event.py": { "mode": "100644", @@ -4551,15 +4551,15 @@ }, "src/openai/types/live/connect_client_event.py": { "mode": "100644", - "sha256": "f1058e3c89704780bfb0bee4af8735ed16c6be7e0f6c6f1b63568c6e5a342053" + "sha256": "bc941c81d969470e47b82605313ca6beff3d40bf152eabe7ba0b6e6649cf2afa" }, "src/openai/types/live/connect_client_event_param.py": { "mode": "100644", - "sha256": "ebd99dc216d21bcfc9f9a32b00d72f81c4dd72894c2768aaaacdf34454e3cc20" + "sha256": "b8f84462deda4beb537beb4f8dcf18a1be3bc842bc1679adb9d4fc66e1b8b18b" }, "src/openai/types/live/connect_server_event.py": { "mode": "100644", - "sha256": "8822447f4395183d1617cf4059db27b49c921f4cb5f3856a50ca04857c44b900" + "sha256": "7ff8ae66fd7995a50e5bb00091435b266f50fa842f5da0414b1ca68bb1af5b9b" }, "src/openai/types/live/custom_voice.py": { "mode": "100644", @@ -4577,9 +4577,69 @@ "mode": "100644", "sha256": "ef804fb49f4ca242c9244092273958edf5d4c9a42f83575542e47652ac4b9761" }, + "src/openai/types/live/decision_create_event.py": { + "mode": "100644", + "sha256": "215adcb039f7175de06978786a5712fba980bd5677f35847aca528fb4a6ac6db" + }, + "src/openai/types/live/decision_create_event_param.py": { + "mode": "100644", + "sha256": "41e524af6ee88586967f8cfeb9ee9efe1d844a8d9f61217ce4c63a8feb3b16b1" + }, + "src/openai/types/live/decision_event.py": { + "mode": "100644", + "sha256": "245033736fa8307752233cc1dd4665ad549050edf6d2ae48bc8a886b1a6050f3" + }, + "src/openai/types/live/decision_item_create_event.py": { + "mode": "100644", + "sha256": "5bac8a2c8ffdccca38e075d4bdea77aad9f67a16da5ec9a6c907fa132f92652c" + }, + "src/openai/types/live/decision_item_create_event_param.py": { + "mode": "100644", + "sha256": "ad09f30351ce585a885704d704ca6a1d406cc7136d4145f28f59cd27c39c13ed" + }, + "src/openai/types/live/decision_item_created_event.py": { + "mode": "100644", + "sha256": "c45829373168f1ecba570665befa7c0524a59bdc8a9abc4e4655b253a523b2c0" + }, + "src/openai/types/live/decision_item_delete_event.py": { + "mode": "100644", + "sha256": "2cf3d669fa499c33ca656c4393e437db9fdb1db59200c4a2b4eb911d5238dc55" + }, + "src/openai/types/live/decision_item_delete_event_param.py": { + "mode": "100644", + "sha256": "fb5c1e43b987270fa23f53cbcf14ad140228fc2232897e92a148a9823f71d733" + }, + "src/openai/types/live/decision_item_deleted_event.py": { + "mode": "100644", + "sha256": "a13cbf7081af65f6f66664c2e36f82f14ae734e7d461c09fbcaf8fe53b99051a" + }, + "src/openai/types/live/decision_trigger.py": { + "mode": "100644", + "sha256": "06550e7e80285e37e4403c798e1691a0ab44bb733f779d6d0de6a8ca1e809b2d" + }, + "src/openai/types/live/decision_trigger_param.py": { + "mode": "100644", + "sha256": "aa6d65bb84b4a324cb3cd592c3b2ee5f553c051f7a9da46fb625013609c40e3c" + }, + "src/openai/types/live/decisions_delegation_config.py": { + "mode": "100644", + "sha256": "b53fa4d93257cef12da05a8c7570b9d6cafaa408efb3c45a5e88c2a4aca6ae5c" + }, + "src/openai/types/live/decisions_delegation_config_param.py": { + "mode": "100644", + "sha256": "58176f13c5bcb896da5cc1342ee76a179ac9307d5d5fee5f2db7ad64947a8560" + }, + "src/openai/types/live/decisions_delegation_update_config.py": { + "mode": "100644", + "sha256": "da306a494f58ee5596329541d191c38bc41def7a9574a82440dbd2c65935138d" + }, + "src/openai/types/live/decisions_delegation_update_config_param.py": { + "mode": "100644", + "sha256": "24b8005917d3e18a20de4851941344bd8136c1bbd203b1040808d8bf0c4b1a29" + }, "src/openai/types/live/delegation_created_event.py": { "mode": "100644", - "sha256": "b2ddd415fafa9339ef0f1c88ee6bc3b3589965becfb642ecfa6c4a51f6353ef6" + "sha256": "5d83aa8edeaf71d72e32a63f7ed5a1329fa3342bea535db11857c239f83b380f" }, "src/openai/types/live/error.py": { "mode": "100644", @@ -4591,15 +4651,15 @@ }, "src/openai/types/live/fork_client_event.py": { "mode": "100644", - "sha256": "eea44ca32ec146331e9a4052a3e43a8456f8de4e113be27affeed3933c1bbc98" + "sha256": "f749730f8d566e84c28feebedc9bebbcffbc57bf3c8d9d5f5f07823a4236f785" }, "src/openai/types/live/fork_client_event_param.py": { "mode": "100644", - "sha256": "29fee0f1fed23ddfa8390dccd16a5e65581b645055ff95e311d9083933bd112a" + "sha256": "ae981da9feb2a32026ddcb05c5ec9c264afa26fbc10ce39272661731c2bed132" }, "src/openai/types/live/fork_server_event.py": { "mode": "100644", - "sha256": "4b8f06371f7e3b7f7840a0fe77976a4ab0747391ec44f7046c4d0a896a95b691" + "sha256": "a908fc4ff11c69feb00f2e5bdd57ec4af95fd5c7bbdf02a8dbf8b566257ae837" }, "src/openai/types/live/fork_session_config.py": { "mode": "100644", @@ -4695,7 +4755,7 @@ }, "src/openai/types/live/media_session_config_param.py": { "mode": "100644", - "sha256": "c98b235a7113098ce774c4b34bdbe329f8ad4eb9494abd1470cefdb486523d04" + "sha256": "981b98d38fae3ac96192f13cd9dc51c23857d8e5e1a3c71a61e07eceed0c8380" }, "src/openai/types/live/media_session_fork_config_param.py": { "mode": "100644", @@ -4763,7 +4823,7 @@ }, "src/openai/types/live/server_event.py": { "mode": "100644", - "sha256": "4faada9b43fd284b9df68fd2bc5df5c945177dfb7817cfb94cf856cce1f50784" + "sha256": "ab64c366facea5dd4ba3e487fc09227bb806401fee45d0512156507695f20feb" }, "src/openai/types/live/server_event_selector.py": { "mode": "100644", @@ -4775,7 +4835,7 @@ }, "src/openai/types/live/session_accept_params.py": { "mode": "100644", - "sha256": "e8df306bba9f34ec4f26fd54957c08915fae9e403a6b48e8ba4a1c137fbc0396" + "sha256": "84c6b9c3da675384127d34168acb54041676efbbfa9e673a5b469b9a7311e0cc" }, "src/openai/types/live/session_close_event.py": { "mode": "100644", @@ -4791,11 +4851,11 @@ }, "src/openai/types/live/session_config.py": { "mode": "100644", - "sha256": "0ae3ac005a3ee07a52314e21294a00b0c7f4df09cd701c7a736da00bb43bcc64" + "sha256": "e633afa348c21659c1abad1d2b814c45bb39011fb81e1210c077c728383cf91e" }, "src/openai/types/live/session_config_param.py": { "mode": "100644", - "sha256": "f9699e0896b260771250d1f320dd4388062df35a17a37f2482c320f186ca19b1" + "sha256": "8b771028ec4eb6d41d1d8d4be43a433d43c3e5c3860e007c87714bc7a6a7e684" }, "src/openai/types/live/session_fork_params.py": { "mode": "100644", @@ -4815,7 +4875,7 @@ }, "src/openai/types/live/session_resource.py": { "mode": "100644", - "sha256": "dc95655227d0d2ab9f50ca05bcf4d5c0ad7e841a69bfef3179d61dae9198fe8f" + "sha256": "e19523ff71354c760432de799797ffba7cac29e3d4acd018c19a6a5d3445dbc6" }, "src/openai/types/live/session_start_event.py": { "mode": "100644", @@ -4831,19 +4891,19 @@ }, "src/openai/types/live/session_update_config.py": { "mode": "100644", - "sha256": "8b577af67fdfad5a3d7f7e71904342e7b5126eca74c74ace6c25cb8e94c35eb4" + "sha256": "b56b6c950f603b2dc15a15de4602e3454dd8b5db3f67b0968e7a9e1ba977d79e" }, "src/openai/types/live/session_update_config_param.py": { "mode": "100644", - "sha256": "02ab2d64403cf288ff9f9f2a2d9e0d5ff253b6eed81a6935cba666cef1aea053" + "sha256": "17aa1877ba81991936e856f5a97274ebecd69e7127fc725098acbdd410899306" }, "src/openai/types/live/session_update_event.py": { "mode": "100644", - "sha256": "d2d1e95a3fe2d855b8859ce7e6ad1ecd6a92956c0860b3eba57a6205971a0ffd" + "sha256": "3c2e0c80db891babfd0ec869ba66af6435616fd5820faf665ed6c4e36c9055bd" }, "src/openai/types/live/session_update_event_param.py": { "mode": "100644", - "sha256": "e14ab5bae2d28b05208bfaca442942aaa5bdde340261aad7327a1160588365ed" + "sha256": "5c5d57d44eac941b92095d259635cec776a8345f612e615b494de518101c775e" }, "src/openai/types/live/session_updated_event.py": { "mode": "100644", @@ -7523,7 +7583,7 @@ }, "tests/api_resources/live/test_sessions.py": { "mode": "100644", - "sha256": "25bd7fe2b9bdfd3ceaec590e0bf84d24b01281afa4432cd06208f4d719e3d8c3" + "sha256": "f78546fe7f66e6f7e740776ea141a5a44662b64aa5dcd7e45b100819bd4f88ab" }, "tests/api_resources/live/test_sideband.py": { "mode": "100644", @@ -7635,7 +7695,7 @@ }, "tests/api_resources/test_live.py": { "mode": "100644", - "sha256": "f6a4b6603ea8d8f242d512a8ccb85d55deae3943dcd72e643a51ad4f5810ae3e" + "sha256": "7929f46d6f5b613b04d561acb7284b7af3c93b4e052b79634186459526a2f875" }, "tests/api_resources/test_models.py": { "mode": "100644", diff --git a/src/openai/resources/live/api.md b/src/openai/resources/live/api.md index e3a8677db9..1b2d729a95 100644 --- a/src/openai/resources/live/api.md +++ b/src/openai/resources/live/api.md @@ -13,6 +13,15 @@ from openai.types.live import ( CommentaryAppendedEvent, CustomVoice, DataChannelConfig, + DecisionCreateEvent, + DecisionEvent, + DecisionItemCreateEvent, + DecisionItemCreatedEvent, + DecisionItemDeleteEvent, + DecisionItemDeletedEvent, + DecisionTrigger, + DecisionsDelegationConfig, + DecisionsDelegationUpdateConfig, DelegationCreatedEvent, Error, ErrorEvent, diff --git a/src/openai/resources/live/forks.py b/src/openai/resources/live/forks.py index 3355b4b36e..9233f33089 100644 --- a/src/openai/resources/live/forks.py +++ b/src/openai/resources/live/forks.py @@ -17,6 +17,7 @@ from ..._models import FinalRequestOptions, construct_type_unchecked from ..._resource import SyncAPIResource, AsyncAPIResource from ..._constants import DEFAULT_LIVE_SEND_QUEUE_MAX_BYTES +from ...types.live import decision_item_create_event_param from ..._exceptions import OpenAIError, WebSocketConnectionClosedError from ..._send_queue import SendQueue from ..._base_client import _merge_mappings @@ -111,6 +112,7 @@ class AsyncForksConnection(AsyncWebSocketConnectionBase): """Represents a live WebSocket connection to the Forks API""" session: AsyncForksSessionResource + decision: AsyncForksDecisionResource response: AsyncForksResponseResource _connection: AsyncWebSocketConnection @@ -145,6 +147,7 @@ def __init__( self._event_handler_registry = EventHandlerRegistry(use_lock=False) self.session = AsyncForksSessionResource(self) + self.decision = AsyncForksDecisionResource(self) self.response = AsyncForksResponseResource(self) async def __aiter__(self) -> AsyncIterator[ForkServerEvent]: @@ -509,6 +512,7 @@ class ForksConnection(WebSocketConnectionBase): """Represents a live WebSocket connection to the Forks API""" session: ForksSessionResource + decision: ForksDecisionResource response: ForksResponseResource _connection: WebSocketConnection @@ -543,6 +547,7 @@ def __init__( self._event_handler_registry = EventHandlerRegistry(use_lock=True) self.session = ForksSessionResource(self) + self.decision = ForksDecisionResource(self) self.response = ForksResponseResource(self) def __iter__(self) -> Iterator[ForkServerEvent]: @@ -946,7 +951,8 @@ def close(self, *, event_id: Optional[str] | Omit = omit) -> None: ) def update(self, *, session: SessionUpdateConfigParam, event_id: Optional[str] | Omit = omit) -> None: - """Update the delegation settings of an active Live session. + """ + Update the delegation settings or transcript triggers of an active Live session. The server acknowledges accepted changes with `session.updated`. """ @@ -1078,6 +1084,21 @@ def play(self, *, audio: str, event_id: Optional[str] | Omit = omit) -> None: ) +class ForksDecisionResource(BaseForksConnectionResource): + @cached_property + def item(self) -> ForksDecisionItemResource: + return ForksDecisionItemResource(self._connection) + + def create(self, *, event_id: str) -> None: + """ + Evaluate the configured questions using the current conversation and Decision + inputs. + + Reusing an event_id is rejected for the lifetime of the session. + """ + self._connection.send({"type": "decision.create", "event_id": event_id}) + + class ForksResponseResource(BaseForksConnectionResource): @cached_property def item(self) -> ForksResponseItemResource: @@ -1095,6 +1116,30 @@ def create(self, *, event_id: Optional[str] | Omit = omit) -> None: ) +class ForksDecisionItemResource(BaseForksConnectionResource): + def delete(self, *, item_id: str, event_id: Optional[str] | Omit = omit) -> None: + """ + Delete an input item from future decisions without starting an evaluation or changing Live voice context. + """ + self._connection.send( + cast( + ForkClientEventParam, + strip_not_given({"type": "decision.item.delete", "item_id": item_id, "event_id": event_id}), + ) + ) + + def create(self, *, item: decision_item_create_event_param.Item, event_id: Optional[str] | Omit = omit) -> None: + """ + Append an input item for future decisions without starting an evaluation or changing Live voice context. + """ + self._connection.send( + cast( + ForkClientEventParam, + strip_not_given({"type": "decision.item.create", "item": item, "event_id": event_id}), + ) + ) + + class ForksResponseItemResource(BaseForksConnectionResource): def create(self, *, item: ResponseInputItemParam, event_id: Optional[str] | Omit = omit) -> None: """Add an input item to the Live session’s Responses backend. @@ -1158,7 +1203,8 @@ async def close(self, *, event_id: Optional[str] | Omit = omit) -> None: ) async def update(self, *, session: SessionUpdateConfigParam, event_id: Optional[str] | Omit = omit) -> None: - """Update the delegation settings of an active Live session. + """ + Update the delegation settings or transcript triggers of an active Live session. The server acknowledges accepted changes with `session.updated`. """ @@ -1296,6 +1342,21 @@ async def play(self, *, audio: str, event_id: Optional[str] | Omit = omit) -> No ) +class AsyncForksDecisionResource(BaseAsyncForksConnectionResource): + @cached_property + def item(self) -> AsyncForksDecisionItemResource: + return AsyncForksDecisionItemResource(self._connection) + + async def create(self, *, event_id: str) -> None: + """ + Evaluate the configured questions using the current conversation and Decision + inputs. + + Reusing an event_id is rejected for the lifetime of the session. + """ + await self._connection.send({"type": "decision.create", "event_id": event_id}) + + class AsyncForksResponseResource(BaseAsyncForksConnectionResource): @cached_property def item(self) -> AsyncForksResponseItemResource: @@ -1313,6 +1374,32 @@ async def create(self, *, event_id: Optional[str] | Omit = omit) -> None: ) +class AsyncForksDecisionItemResource(BaseAsyncForksConnectionResource): + async def delete(self, *, item_id: str, event_id: Optional[str] | Omit = omit) -> None: + """ + Delete an input item from future decisions without starting an evaluation or changing Live voice context. + """ + await self._connection.send( + cast( + ForkClientEventParam, + strip_not_given({"type": "decision.item.delete", "item_id": item_id, "event_id": event_id}), + ) + ) + + async def create( + self, *, item: decision_item_create_event_param.Item, event_id: Optional[str] | Omit = omit + ) -> None: + """ + Append an input item for future decisions without starting an evaluation or changing Live voice context. + """ + await self._connection.send( + cast( + ForkClientEventParam, + strip_not_given({"type": "decision.item.create", "item": item, "event_id": event_id}), + ) + ) + + class AsyncForksResponseItemResource(BaseAsyncForksConnectionResource): async def create(self, *, item: ResponseInputItemParam, event_id: Optional[str] | Omit = omit) -> None: """Add an input item to the Live session’s Responses backend. diff --git a/src/openai/resources/live/live.py b/src/openai/resources/live/live.py index 62e665a005..9d54ae80be 100644 --- a/src/openai/resources/live/live.py +++ b/src/openai/resources/live/live.py @@ -29,7 +29,7 @@ from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper from ..._constants import DEFAULT_LIVE_SEND_QUEUE_MAX_BYTES -from ...types.live import live_create_params +from ...types.live import live_create_params, decision_item_create_event_param from ..._exceptions import OpenAIError, WebSocketConnectionClosedError from ..._send_queue import SendQueue from ..._base_client import _merge_mappings, make_request_options @@ -332,6 +332,7 @@ class AsyncLiveConnection(AsyncWebSocketConnectionBase): """Represents a live WebSocket connection to the Live API""" session: AsyncLiveSessionResource + decision: AsyncLiveDecisionResource response: AsyncLiveResponseResource _connection: AsyncWebSocketConnection @@ -366,6 +367,7 @@ def __init__( self._event_handler_registry = EventHandlerRegistry(use_lock=False) self.session = AsyncLiveSessionResource(self) + self.decision = AsyncLiveDecisionResource(self) self.response = AsyncLiveResponseResource(self) async def __aiter__(self) -> AsyncIterator[ServerEvent]: @@ -727,6 +729,7 @@ class LiveConnection(WebSocketConnectionBase): """Represents a live WebSocket connection to the Live API""" session: LiveSessionResource + decision: LiveDecisionResource response: LiveResponseResource _connection: WebSocketConnection @@ -761,6 +764,7 @@ def __init__( self._event_handler_registry = EventHandlerRegistry(use_lock=True) self.session = LiveSessionResource(self) + self.decision = LiveDecisionResource(self) self.response = LiveResponseResource(self) def __iter__(self) -> Iterator[ServerEvent]: @@ -1145,7 +1149,8 @@ def close(self, *, event_id: Optional[str] | Omit = omit) -> None: self._connection.send(cast(ClientEventParam, strip_not_given({"type": "session.close", "event_id": event_id}))) def update(self, *, session: SessionUpdateConfigParam, event_id: Optional[str] | Omit = omit) -> None: - """Update the delegation settings of an active Live session. + """ + Update the delegation settings or transcript triggers of an active Live session. The server acknowledges accepted changes with `session.updated`. """ @@ -1285,6 +1290,44 @@ def play(self, *, audio: str, event_id: Optional[str] | Omit = omit) -> None: ) +class LiveDecisionResource(BaseLiveConnectionResource): + @cached_property + def item(self) -> LiveDecisionItemResource: + return LiveDecisionItemResource(self._connection) + + def create(self, *, event_id: str) -> None: + """ + Evaluate the configured questions using the current conversation and Decision + inputs. + + Reusing an event_id is rejected for the lifetime of the session. + """ + self._connection.send({"type": "decision.create", "event_id": event_id}) + + +class LiveDecisionItemResource(BaseLiveConnectionResource): + def delete(self, *, item_id: str, event_id: Optional[str] | Omit = omit) -> None: + """ + Delete an input item from future decisions without starting an evaluation or changing Live voice context. + """ + self._connection.send( + cast( + ClientEventParam, + strip_not_given({"type": "decision.item.delete", "item_id": item_id, "event_id": event_id}), + ) + ) + + def create(self, *, item: decision_item_create_event_param.Item, event_id: Optional[str] | Omit = omit) -> None: + """ + Append an input item for future decisions without starting an evaluation or changing Live voice context. + """ + self._connection.send( + cast( + ClientEventParam, strip_not_given({"type": "decision.item.create", "item": item, "event_id": event_id}) + ) + ) + + class LiveResponseResource(BaseLiveConnectionResource): @cached_property def item(self) -> LiveResponseItemResource: @@ -1351,7 +1394,8 @@ async def close(self, *, event_id: Optional[str] | Omit = omit) -> None: ) async def update(self, *, session: SessionUpdateConfigParam, event_id: Optional[str] | Omit = omit) -> None: - """Update the delegation settings of an active Live session. + """ + Update the delegation settings or transcript triggers of an active Live session. The server acknowledges accepted changes with `session.updated`. """ @@ -1497,6 +1541,46 @@ async def play(self, *, audio: str, event_id: Optional[str] | Omit = omit) -> No ) +class AsyncLiveDecisionResource(BaseAsyncLiveConnectionResource): + @cached_property + def item(self) -> AsyncLiveDecisionItemResource: + return AsyncLiveDecisionItemResource(self._connection) + + async def create(self, *, event_id: str) -> None: + """ + Evaluate the configured questions using the current conversation and Decision + inputs. + + Reusing an event_id is rejected for the lifetime of the session. + """ + await self._connection.send({"type": "decision.create", "event_id": event_id}) + + +class AsyncLiveDecisionItemResource(BaseAsyncLiveConnectionResource): + async def delete(self, *, item_id: str, event_id: Optional[str] | Omit = omit) -> None: + """ + Delete an input item from future decisions without starting an evaluation or changing Live voice context. + """ + await self._connection.send( + cast( + ClientEventParam, + strip_not_given({"type": "decision.item.delete", "item_id": item_id, "event_id": event_id}), + ) + ) + + async def create( + self, *, item: decision_item_create_event_param.Item, event_id: Optional[str] | Omit = omit + ) -> None: + """ + Append an input item for future decisions without starting an evaluation or changing Live voice context. + """ + await self._connection.send( + cast( + ClientEventParam, strip_not_given({"type": "decision.item.create", "item": item, "event_id": event_id}) + ) + ) + + class AsyncLiveResponseResource(BaseAsyncLiveConnectionResource): @cached_property def item(self) -> AsyncLiveResponseItemResource: diff --git a/src/openai/resources/live/sideband.py b/src/openai/resources/live/sideband.py index 35b5cc8844..7c15ecbdf2 100644 --- a/src/openai/resources/live/sideband.py +++ b/src/openai/resources/live/sideband.py @@ -17,6 +17,7 @@ from ..._models import FinalRequestOptions, construct_type_unchecked from ..._resource import SyncAPIResource, AsyncAPIResource from ..._constants import DEFAULT_LIVE_SEND_QUEUE_MAX_BYTES +from ...types.live import decision_item_create_event_param from ..._exceptions import OpenAIError, WebSocketConnectionClosedError from ..._send_queue import SendQueue from ..._base_client import _merge_mappings @@ -114,6 +115,7 @@ class AsyncSidebandConnection(AsyncWebSocketConnectionBase): """Represents a live WebSocket connection to the Sideband API""" session: AsyncSidebandSessionResource + decision: AsyncSidebandDecisionResource response: AsyncSidebandResponseResource _connection: AsyncWebSocketConnection @@ -148,6 +150,7 @@ def __init__( self._event_handler_registry = EventHandlerRegistry(use_lock=False) self.session = AsyncSidebandSessionResource(self) + self.decision = AsyncSidebandDecisionResource(self) self.response = AsyncSidebandResponseResource(self) async def __aiter__(self) -> AsyncIterator[ConnectServerEvent]: @@ -524,6 +527,7 @@ class SidebandConnection(WebSocketConnectionBase): """Represents a live WebSocket connection to the Sideband API""" session: SidebandSessionResource + decision: SidebandDecisionResource response: SidebandResponseResource _connection: WebSocketConnection @@ -558,6 +562,7 @@ def __init__( self._event_handler_registry = EventHandlerRegistry(use_lock=True) self.session = SidebandSessionResource(self) + self.decision = SidebandDecisionResource(self) self.response = SidebandResponseResource(self) def __iter__(self) -> Iterator[ConnectServerEvent]: @@ -960,7 +965,8 @@ def close(self, *, event_id: Optional[str] | Omit = omit) -> None: ) def update(self, *, session: SessionUpdateConfigParam, event_id: Optional[str] | Omit = omit) -> None: - """Update the delegation settings of an active Live session. + """ + Update the delegation settings or transcript triggers of an active Live session. The server acknowledges accepted changes with `session.updated`. """ @@ -1080,6 +1086,45 @@ def play(self, *, audio: str, event_id: Optional[str] | Omit = omit) -> None: ) +class SidebandDecisionResource(BaseSidebandConnectionResource): + @cached_property + def item(self) -> SidebandDecisionItemResource: + return SidebandDecisionItemResource(self._connection) + + def create(self, *, event_id: str) -> None: + """ + Evaluate the configured questions using the current conversation and Decision + inputs. + + Reusing an event_id is rejected for the lifetime of the session. + """ + self._connection.send({"type": "decision.create", "event_id": event_id}) + + +class SidebandDecisionItemResource(BaseSidebandConnectionResource): + def delete(self, *, item_id: str, event_id: Optional[str] | Omit = omit) -> None: + """ + Delete an input item from future decisions without starting an evaluation or changing Live voice context. + """ + self._connection.send( + cast( + ConnectClientEventParam, + strip_not_given({"type": "decision.item.delete", "item_id": item_id, "event_id": event_id}), + ) + ) + + def create(self, *, item: decision_item_create_event_param.Item, event_id: Optional[str] | Omit = omit) -> None: + """ + Append an input item for future decisions without starting an evaluation or changing Live voice context. + """ + self._connection.send( + cast( + ConnectClientEventParam, + strip_not_given({"type": "decision.item.create", "item": item, "event_id": event_id}), + ) + ) + + class SidebandResponseResource(BaseSidebandConnectionResource): @cached_property def item(self) -> SidebandResponseItemResource: @@ -1147,7 +1192,8 @@ async def close(self, *, event_id: Optional[str] | Omit = omit) -> None: ) async def update(self, *, session: SessionUpdateConfigParam, event_id: Optional[str] | Omit = omit) -> None: - """Update the delegation settings of an active Live session. + """ + Update the delegation settings or transcript triggers of an active Live session. The server acknowledges accepted changes with `session.updated`. """ @@ -1273,6 +1319,47 @@ async def play(self, *, audio: str, event_id: Optional[str] | Omit = omit) -> No ) +class AsyncSidebandDecisionResource(BaseAsyncSidebandConnectionResource): + @cached_property + def item(self) -> AsyncSidebandDecisionItemResource: + return AsyncSidebandDecisionItemResource(self._connection) + + async def create(self, *, event_id: str) -> None: + """ + Evaluate the configured questions using the current conversation and Decision + inputs. + + Reusing an event_id is rejected for the lifetime of the session. + """ + await self._connection.send({"type": "decision.create", "event_id": event_id}) + + +class AsyncSidebandDecisionItemResource(BaseAsyncSidebandConnectionResource): + async def delete(self, *, item_id: str, event_id: Optional[str] | Omit = omit) -> None: + """ + Delete an input item from future decisions without starting an evaluation or changing Live voice context. + """ + await self._connection.send( + cast( + ConnectClientEventParam, + strip_not_given({"type": "decision.item.delete", "item_id": item_id, "event_id": event_id}), + ) + ) + + async def create( + self, *, item: decision_item_create_event_param.Item, event_id: Optional[str] | Omit = omit + ) -> None: + """ + Append an input item for future decisions without starting an evaluation or changing Live voice context. + """ + await self._connection.send( + cast( + ConnectClientEventParam, + strip_not_given({"type": "decision.item.create", "item": item, "event_id": event_id}), + ) + ) + + class AsyncSidebandResponseResource(BaseAsyncSidebandConnectionResource): @cached_property def item(self) -> AsyncSidebandResponseItemResource: diff --git a/src/openai/types/live/__init__.py b/src/openai/types/live/__init__.py index ab4efa56f1..062e433435 100644 --- a/src/openai/types/live/__init__.py +++ b/src/openai/types/live/__init__.py @@ -14,8 +14,10 @@ from .function_tool import FunctionTool as FunctionTool from .session_usage import SessionUsage as SessionUsage from .built_in_voice import BuiltInVoice as BuiltInVoice +from .decision_event import DecisionEvent as DecisionEvent from .response_event import ResponseEvent as ResponseEvent from .session_config import SessionConfig as SessionConfig +from .decision_trigger import DecisionTrigger as DecisionTrigger from .session_resource import SessionResource as SessionResource from .client_delegation import ClientDelegation as ClientDelegation from .fork_client_event import ForkClientEvent as ForkClientEvent @@ -39,6 +41,7 @@ from .session_config_param import SessionConfigParam as SessionConfigParam from .session_refer_params import SessionReferParams as SessionReferParams from .session_update_event import SessionUpdateEvent as SessionUpdateEvent +from .decision_create_event import DecisionCreateEvent as DecisionCreateEvent from .response_create_event import ResponseCreateEvent as ResponseCreateEvent from .server_event_selector import ServerEventSelector as ServerEventSelector from .session_accept_params import SessionAcceptParams as SessionAcceptParams @@ -48,6 +51,7 @@ from .session_update_config import SessionUpdateConfig as SessionUpdateConfig from .session_updated_event import SessionUpdatedEvent as SessionUpdatedEvent from .thinking_append_event import ThinkingAppendEvent as ThinkingAppendEvent +from .decision_trigger_param import DecisionTriggerParam as DecisionTriggerParam from .input_audio_mute_event import InputAudioMuteEvent as InputAudioMuteEvent from .client_delegation_param import ClientDelegationParam as ClientDelegationParam from .commentary_append_event import CommentaryAppendEvent as CommentaryAppendEvent @@ -68,9 +72,15 @@ from .session_close_event_param import SessionCloseEventParam as SessionCloseEventParam from .session_start_event_param import SessionStartEventParam as SessionStartEventParam from .connect_client_event_param import ConnectClientEventParam as ConnectClientEventParam +from .decision_item_create_event import DecisionItemCreateEvent as DecisionItemCreateEvent +from .decision_item_delete_event import DecisionItemDeleteEvent as DecisionItemDeleteEvent from .media_session_config_param import MediaSessionConfigParam as MediaSessionConfigParam from .response_item_create_event import ResponseItemCreateEvent as ResponseItemCreateEvent from .session_update_event_param import SessionUpdateEventParam as SessionUpdateEventParam +from .decision_create_event_param import DecisionCreateEventParam as DecisionCreateEventParam +from .decision_item_created_event import DecisionItemCreatedEvent as DecisionItemCreatedEvent +from .decision_item_deleted_event import DecisionItemDeletedEvent as DecisionItemDeletedEvent +from .decisions_delegation_config import DecisionsDelegationConfig as DecisionsDelegationConfig from .instructions_appended_event import InstructionsAppendedEvent as InstructionsAppendedEvent from .response_create_event_param import ResponseCreateEventParam as ResponseCreateEventParam from .responses_delegation_config import ResponsesDelegationConfig as ResponsesDelegationConfig @@ -88,12 +98,19 @@ from .instructions_append_event_param import InstructionsAppendEventParam as InstructionsAppendEventParam from .media_session_fork_config_param import MediaSessionForkConfigParam as MediaSessionForkConfigParam from .output_audio_fixture_play_event import OutputAudioFixturePlayEvent as OutputAudioFixturePlayEvent +from .decision_item_create_event_param import DecisionItemCreateEventParam as DecisionItemCreateEventParam +from .decision_item_delete_event_param import DecisionItemDeleteEventParam as DecisionItemDeleteEventParam from .response_item_create_event_param import ResponseItemCreateEventParam as ResponseItemCreateEventParam +from .decisions_delegation_config_param import DecisionsDelegationConfigParam as DecisionsDelegationConfigParam from .output_audio_fixture_played_event import OutputAudioFixturePlayedEvent as OutputAudioFixturePlayedEvent from .responses_delegation_config_param import ResponsesDelegationConfigParam as ResponsesDelegationConfigParam +from .decisions_delegation_update_config import DecisionsDelegationUpdateConfig as DecisionsDelegationUpdateConfig from .output_audio_fixture_playing_event import OutputAudioFixturePlayingEvent as OutputAudioFixturePlayingEvent from .responses_delegation_update_config import ResponsesDelegationUpdateConfig as ResponsesDelegationUpdateConfig from .output_audio_fixture_play_event_param import OutputAudioFixturePlayEventParam as OutputAudioFixturePlayEventParam +from .decisions_delegation_update_config_param import ( + DecisionsDelegationUpdateConfigParam as DecisionsDelegationUpdateConfigParam, +) from .responses_delegation_update_config_param import ( ResponsesDelegationUpdateConfigParam as ResponsesDelegationUpdateConfigParam, ) diff --git a/src/openai/types/live/client_event.py b/src/openai/types/live/client_event.py index 824ec6e8a8..50af13dad3 100644 --- a/src/openai/types/live/client_event.py +++ b/src/openai/types/live/client_event.py @@ -7,6 +7,7 @@ from .session_close_event import SessionCloseEvent from .session_start_event import SessionStartEvent from .session_update_event import SessionUpdateEvent +from .decision_create_event import DecisionCreateEvent from .response_create_event import ResponseCreateEvent from .thinking_append_event import ThinkingAppendEvent from .input_audio_mute_event import InputAudioMuteEvent @@ -14,6 +15,8 @@ from .input_audio_append_event import InputAudioAppendEvent from .input_audio_unmute_event import InputAudioUnmuteEvent from .instructions_append_event import InstructionsAppendEvent +from .decision_item_create_event import DecisionItemCreateEvent +from .decision_item_delete_event import DecisionItemDeleteEvent from .response_item_create_event import ResponseItemCreateEvent from .output_audio_fixture_play_event import OutputAudioFixturePlayEvent @@ -30,6 +33,9 @@ InstructionsAppendEvent, ThinkingAppendEvent, CommentaryAppendEvent, + DecisionCreateEvent, + DecisionItemCreateEvent, + DecisionItemDeleteEvent, ResponseItemCreateEvent, ResponseCreateEvent, SessionCloseEvent, diff --git a/src/openai/types/live/client_event_param.py b/src/openai/types/live/client_event_param.py index 84b946d4e3..88d7323eb0 100644 --- a/src/openai/types/live/client_event_param.py +++ b/src/openai/types/live/client_event_param.py @@ -8,6 +8,7 @@ from .session_close_event_param import SessionCloseEventParam from .session_start_event_param import SessionStartEventParam from .session_update_event_param import SessionUpdateEventParam +from .decision_create_event_param import DecisionCreateEventParam from .response_create_event_param import ResponseCreateEventParam from .thinking_append_event_param import ThinkingAppendEventParam from .input_audio_mute_event_param import InputAudioMuteEventParam @@ -15,6 +16,8 @@ from .input_audio_append_event_param import InputAudioAppendEventParam from .input_audio_unmute_event_param import InputAudioUnmuteEventParam from .instructions_append_event_param import InstructionsAppendEventParam +from .decision_item_create_event_param import DecisionItemCreateEventParam +from .decision_item_delete_event_param import DecisionItemDeleteEventParam from .response_item_create_event_param import ResponseItemCreateEventParam from .output_audio_fixture_play_event_param import OutputAudioFixturePlayEventParam @@ -30,6 +33,9 @@ InstructionsAppendEventParam, ThinkingAppendEventParam, CommentaryAppendEventParam, + DecisionCreateEventParam, + DecisionItemCreateEventParam, + DecisionItemDeleteEventParam, ResponseItemCreateEventParam, ResponseCreateEventParam, SessionCloseEventParam, diff --git a/src/openai/types/live/connect_client_event.py b/src/openai/types/live/connect_client_event.py index 8bf6a06d96..0d46cf6ef5 100644 --- a/src/openai/types/live/connect_client_event.py +++ b/src/openai/types/live/connect_client_event.py @@ -6,12 +6,15 @@ from ..._utils import PropertyInfo from .session_close_event import SessionCloseEvent from .session_update_event import SessionUpdateEvent +from .decision_create_event import DecisionCreateEvent from .response_create_event import ResponseCreateEvent from .thinking_append_event import ThinkingAppendEvent from .input_audio_mute_event import InputAudioMuteEvent from .commentary_append_event import CommentaryAppendEvent from .input_audio_unmute_event import InputAudioUnmuteEvent from .instructions_append_event import InstructionsAppendEvent +from .decision_item_create_event import DecisionItemCreateEvent +from .decision_item_delete_event import DecisionItemDeleteEvent from .response_item_create_event import ResponseItemCreateEvent from .output_audio_fixture_play_event import OutputAudioFixturePlayEvent @@ -26,6 +29,9 @@ InstructionsAppendEvent, ThinkingAppendEvent, CommentaryAppendEvent, + DecisionCreateEvent, + DecisionItemCreateEvent, + DecisionItemDeleteEvent, ResponseItemCreateEvent, ResponseCreateEvent, SessionCloseEvent, diff --git a/src/openai/types/live/connect_client_event_param.py b/src/openai/types/live/connect_client_event_param.py index 5b3dd3b15a..d4309ae7bb 100644 --- a/src/openai/types/live/connect_client_event_param.py +++ b/src/openai/types/live/connect_client_event_param.py @@ -7,12 +7,15 @@ from .session_close_event_param import SessionCloseEventParam from .session_update_event_param import SessionUpdateEventParam +from .decision_create_event_param import DecisionCreateEventParam from .response_create_event_param import ResponseCreateEventParam from .thinking_append_event_param import ThinkingAppendEventParam from .input_audio_mute_event_param import InputAudioMuteEventParam from .commentary_append_event_param import CommentaryAppendEventParam from .input_audio_unmute_event_param import InputAudioUnmuteEventParam from .instructions_append_event_param import InstructionsAppendEventParam +from .decision_item_create_event_param import DecisionItemCreateEventParam +from .decision_item_delete_event_param import DecisionItemDeleteEventParam from .response_item_create_event_param import ResponseItemCreateEventParam from .output_audio_fixture_play_event_param import OutputAudioFixturePlayEventParam @@ -26,6 +29,9 @@ InstructionsAppendEventParam, ThinkingAppendEventParam, CommentaryAppendEventParam, + DecisionCreateEventParam, + DecisionItemCreateEventParam, + DecisionItemDeleteEventParam, ResponseItemCreateEventParam, ResponseCreateEventParam, SessionCloseEventParam, diff --git a/src/openai/types/live/connect_server_event.py b/src/openai/types/live/connect_server_event.py index 13d68b1db3..7c533a7fa8 100644 --- a/src/openai/types/live/connect_server_event.py +++ b/src/openai/types/live/connect_server_event.py @@ -6,6 +6,7 @@ from ..._utils import PropertyInfo from .info_event import InfoEvent from .error_event import ErrorEvent +from .decision_event import DecisionEvent from .response_event import ResponseEvent from .session_closed_event import SessionClosedEvent from .session_started_event import SessionStartedEvent @@ -15,6 +16,8 @@ from .delegation_created_event import DelegationCreatedEvent from .commentary_appended_event import CommentaryAppendedEvent from .input_audio_unmuted_event import InputAudioUnmutedEvent +from .decision_item_created_event import DecisionItemCreatedEvent +from .decision_item_deleted_event import DecisionItemDeletedEvent from .instructions_appended_event import InstructionsAppendedEvent from .session_usage_updated_event import SessionUsageUpdatedEvent from .input_transcript_delta_event import InputTranscriptDeltaEvent @@ -38,6 +41,9 @@ InputTranscriptDeltaEvent, OutputTranscriptDeltaEvent, DelegationCreatedEvent, + DecisionEvent, + DecisionItemCreatedEvent, + DecisionItemDeletedEvent, ResponseEvent, SessionUsageUpdatedEvent, SessionClosedEvent, diff --git a/src/openai/types/live/decision_create_event.py b/src/openai/types/live/decision_create_event.py new file mode 100644 index 0000000000..29d9487c50 --- /dev/null +++ b/src/openai/types/live/decision_create_event.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["DecisionCreateEvent"] + + +class DecisionCreateEvent(BaseModel): + """ + Evaluate the configured questions using the current conversation and Decision inputs. Reusing an event_id is rejected for the lifetime of the session. + """ + + event_id: str + + type: Literal["decision.create"] diff --git a/src/openai/types/live/decision_create_event_param.py b/src/openai/types/live/decision_create_event_param.py new file mode 100644 index 0000000000..0265729aad --- /dev/null +++ b/src/openai/types/live/decision_create_event_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["DecisionCreateEventParam"] + + +class DecisionCreateEventParam(TypedDict, total=False): + """ + Evaluate the configured questions using the current conversation and Decision inputs. Reusing an event_id is rejected for the lifetime of the session. + """ + + event_id: Required[str] + + type: Required[Literal["decision.create"]] diff --git a/src/openai/types/live/decision_event.py b/src/openai/types/live/decision_event.py new file mode 100644 index 0000000000..6ecf5e779c --- /dev/null +++ b/src/openai/types/live/decision_event.py @@ -0,0 +1,47 @@ +# File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import Literal + +from ..._models import BaseModel +from ..decision import Decision + +__all__ = ["DecisionEvent", "Event"] + + +class Event(BaseModel): + decision: Decision + """ + The native Decision API response, including its model, ordered answers, and + token usage. + """ + + type: Literal["decision.completed"] + + +class DecisionEvent(BaseModel): + """A Decision API event for a Live delegation or transcript trigger. + + For a trigger, source_event_id identifies the transcript delta that caused this evaluation. + """ + + delegation_id: Optional[str] = None + """The Live delegation ID, or null for a transcript trigger.""" + + event: Event + + event_id: str + """The unique ID of this Live server event.""" + + source_event_id: Optional[str] = None + """ + The event_id of the transcript delta that fired this trigger, or null for a + delegation. + """ + + source_event_type: Union[Literal["session.input_transcript.delta", "session.output_transcript.delta"], None] = None + + trigger_id: Optional[str] = None + """The Live-assigned ID of this trigger firing, or null for a delegation.""" + + type: Literal["decision.event"] diff --git a/src/openai/types/live/decision_item_create_event.py b/src/openai/types/live/decision_item_create_event.py new file mode 100644 index 0000000000..ef62815282 --- /dev/null +++ b/src/openai/types/live/decision_item_create_event.py @@ -0,0 +1,71 @@ +# File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias + +from ..._utils import PropertyInfo +from ..._models import BaseModel + +__all__ = [ + "DecisionItemCreateEvent", + "Item", + "ItemContentParts", + "ItemContentPartsInputText", + "ItemContentPartsInputImage", +] + + +class ItemContentPartsInputText(BaseModel): + text: str + """The text input to the model.""" + + type: Literal["input_text"] + """The type of the input item. Always `input_text`.""" + + +class ItemContentPartsInputImage(BaseModel): + image_url: str + """An inline image encoded as a data URL.""" + + type: Literal["input_image"] + """The type of the input item. Always `input_image`.""" + + detail: Optional[Literal["low", "high", "auto", "original"]] = None + """The detail level of the image to be sent to the model. + + One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + """ + + +ItemContentParts: TypeAlias = Annotated[ + Union[ItemContentPartsInputText, ItemContentPartsInputImage], PropertyInfo(discriminator="type") +] + + +class Item(BaseModel): + content: Union[str, List[ItemContentParts]] + """The text input to the model.""" + + role: Literal["user"] + """The message role. Always `user`.""" + + id: Optional[str] = None + """The unique ID of this message item.""" + + type: Optional[Literal["message"]] = None + + +class DecisionItemCreateEvent(BaseModel): + """ + Append an input item for future decisions without starting an evaluation or changing Live voice context. + """ + + item: Item + + type: Literal["decision.item.create"] + + event_id: Optional[str] = None + """ + Optional client identifier for correlating this command with a server event's + client_event_id or error.client_event_id. + """ diff --git a/src/openai/types/live/decision_item_create_event_param.py b/src/openai/types/live/decision_item_create_event_param.py new file mode 100644 index 0000000000..4a879b196e --- /dev/null +++ b/src/openai/types/live/decision_item_create_event_param.py @@ -0,0 +1,68 @@ +# File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +__all__ = [ + "DecisionItemCreateEventParam", + "Item", + "ItemContentParts", + "ItemContentPartsInputText", + "ItemContentPartsInputImage", +] + + +class ItemContentPartsInputText(TypedDict, total=False): + text: Required[str] + """The text input to the model.""" + + type: Required[Literal["input_text"]] + """The type of the input item. Always `input_text`.""" + + +class ItemContentPartsInputImage(TypedDict, total=False): + image_url: Required[str] + """An inline image encoded as a data URL.""" + + type: Required[Literal["input_image"]] + """The type of the input item. Always `input_image`.""" + + detail: Optional[Literal["low", "high", "auto", "original"]] + """The detail level of the image to be sent to the model. + + One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + """ + + +ItemContentParts: TypeAlias = Union[ItemContentPartsInputText, ItemContentPartsInputImage] + + +class Item(TypedDict, total=False): + content: Required[Union[str, Iterable[ItemContentParts]]] + """The text input to the model.""" + + role: Required[Literal["user"]] + """The message role. Always `user`.""" + + id: Optional[str] + """The unique ID of this message item.""" + + type: Literal["message"] + + +class DecisionItemCreateEventParam(TypedDict, total=False): + """ + Append an input item for future decisions without starting an evaluation or changing Live voice context. + """ + + item: Required[Item] + + type: Required[Literal["decision.item.create"]] + + event_id: Optional[str] + """ + Optional client identifier for correlating this command with a server event's + client_event_id or error.client_event_id. + """ diff --git a/src/openai/types/live/decision_item_created_event.py b/src/openai/types/live/decision_item_created_event.py new file mode 100644 index 0000000000..6cc5ccce25 --- /dev/null +++ b/src/openai/types/live/decision_item_created_event.py @@ -0,0 +1,72 @@ +# File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias + +from ..._utils import PropertyInfo +from ..._models import BaseModel + +__all__ = [ + "DecisionItemCreatedEvent", + "Item", + "ItemContentParts", + "ItemContentPartsInputText", + "ItemContentPartsInputImage", +] + + +class ItemContentPartsInputText(BaseModel): + text: str + """The text input to the model.""" + + type: Literal["input_text"] + """The type of the input item. Always `input_text`.""" + + +class ItemContentPartsInputImage(BaseModel): + image_url: str + """An inline image encoded as a data URL.""" + + type: Literal["input_image"] + """The type of the input item. Always `input_image`.""" + + detail: Optional[Literal["low", "high", "auto", "original"]] = None + """The detail level of the image to be sent to the model. + + One of `high`, `low`, `auto`, or `original`. Defaults to `auto`. + """ + + +ItemContentParts: TypeAlias = Annotated[ + Union[ItemContentPartsInputText, ItemContentPartsInputImage], PropertyInfo(discriminator="type") +] + + +class Item(BaseModel): + id: str + """The ID of the stored Decision input item.""" + + content: Union[str, List[ItemContentParts]] + """The text input to the model.""" + + role: Literal["user"] + """The message role. Always `user`.""" + + type: Optional[Literal["message"]] = None + + +class DecisionItemCreatedEvent(BaseModel): + """An input item was appended for future decisions.""" + + event_id: str + """The unique ID of the Live server event.""" + + item: Item + + type: Literal["decision.item.created"] + + client_event_id: Optional[str] = None + """ + The event_id of the client command associated with this server event, when + supplied. + """ diff --git a/src/openai/types/live/decision_item_delete_event.py b/src/openai/types/live/decision_item_delete_event.py new file mode 100644 index 0000000000..6c2fc679bc --- /dev/null +++ b/src/openai/types/live/decision_item_delete_event.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["DecisionItemDeleteEvent"] + + +class DecisionItemDeleteEvent(BaseModel): + """ + Delete an input item from future decisions without starting an evaluation or changing Live voice context. + """ + + item_id: str + + type: Literal["decision.item.delete"] + + event_id: Optional[str] = None + """ + Optional client identifier for correlating this command with a server event's + client_event_id or error.client_event_id. + """ diff --git a/src/openai/types/live/decision_item_delete_event_param.py b/src/openai/types/live/decision_item_delete_event_param.py new file mode 100644 index 0000000000..dbd04e2c2e --- /dev/null +++ b/src/openai/types/live/decision_item_delete_event_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["DecisionItemDeleteEventParam"] + + +class DecisionItemDeleteEventParam(TypedDict, total=False): + """ + Delete an input item from future decisions without starting an evaluation or changing Live voice context. + """ + + item_id: Required[str] + + type: Required[Literal["decision.item.delete"]] + + event_id: Optional[str] + """ + Optional client identifier for correlating this command with a server event's + client_event_id or error.client_event_id. + """ diff --git a/src/openai/types/live/decision_item_deleted_event.py b/src/openai/types/live/decision_item_deleted_event.py new file mode 100644 index 0000000000..21d3d984f0 --- /dev/null +++ b/src/openai/types/live/decision_item_deleted_event.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["DecisionItemDeletedEvent"] + + +class DecisionItemDeletedEvent(BaseModel): + """An input item was removed from future decisions.""" + + event_id: str + """The unique ID of the Live server event.""" + + item_id: str + + type: Literal["decision.item.deleted"] + + client_event_id: Optional[str] = None + """ + The event_id of the client command associated with this server event, when + supplied. + """ diff --git a/src/openai/types/live/decision_trigger.py b/src/openai/types/live/decision_trigger.py new file mode 100644 index 0000000000..9a4d06211e --- /dev/null +++ b/src/openai/types/live/decision_trigger.py @@ -0,0 +1,104 @@ +# File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias + +from pydantic import StrictStr, StrictBool + +from ..._utils import PropertyInfo +from ..._models import BaseModel + +__all__ = [ + "DecisionTrigger", + "Decisions", + "DecisionsQuestion", + "DecisionsQuestionQuestionParamPredicate", + "DecisionsQuestionQuestionParamChoice", + "DecisionsQuestionQuestionParamChoiceChoice", + "DecisionsQuestionQuestionParamScore", + "DecisionsQuestionQuestionParamScoreLevel", +] + + +class DecisionsQuestionQuestionParamPredicate(BaseModel): + """Estimate how likely it is that a statement about the input is true.""" + + instructions: str + + type: Literal["predicate"] + """The type of the object. Always `predicate`.""" + + name: Optional[str] = None + + +class DecisionsQuestionQuestionParamChoiceChoice(BaseModel): + value: Union[StrictStr, StrictBool] + """ + Choice values are typed: a string and a boolean with the same text are distinct. + """ + + description: Optional[str] = None + + +class DecisionsQuestionQuestionParamChoice(BaseModel): + """Choose from the supplied options based on the input.""" + + choices: List[DecisionsQuestionQuestionParamChoiceChoice] + """Provide between 2 and 255 choices. Each choice must be unique.""" + + instructions: str + + type: Literal["choice"] + """The type of the object. Always `choice`.""" + + name: Optional[str] = None + + +class DecisionsQuestionQuestionParamScoreLevel(BaseModel): + label: str + + description: Optional[str] = None + + +class DecisionsQuestionQuestionParamScore(BaseModel): + """Rate the input against the supplied ordered levels.""" + + instructions: str + + levels: List[DecisionsQuestionQuestionParamScoreLevel] + + type: Literal["score"] + """The type of the object. Always `score`.""" + + name: Optional[str] = None + + +DecisionsQuestion: TypeAlias = Annotated[ + Union[ + DecisionsQuestionQuestionParamPredicate, + DecisionsQuestionQuestionParamChoice, + DecisionsQuestionQuestionParamScore, + ], + PropertyInfo(discriminator="type"), +] + + +class Decisions(BaseModel): + """ + Questions evaluated using the current transcript and the session's shared Decision items. + """ + + questions: List[DecisionsQuestion] + """Native Decision API questions evaluated together, in order.""" + + +class DecisionTrigger(BaseModel): + decisions: Decisions + """ + Questions evaluated using the current transcript and the session's shared + Decision items. + """ + + event_type: Literal["session.input_transcript.delta", "session.output_transcript.delta"] + + type: Literal["decisions"] diff --git a/src/openai/types/live/decision_trigger_param.py b/src/openai/types/live/decision_trigger_param.py new file mode 100644 index 0000000000..e39a89f284 --- /dev/null +++ b/src/openai/types/live/decision_trigger_param.py @@ -0,0 +1,96 @@ +# File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +__all__ = [ + "DecisionTriggerParam", + "Decisions", + "DecisionsQuestion", + "DecisionsQuestionQuestionParamPredicate", + "DecisionsQuestionQuestionParamChoice", + "DecisionsQuestionQuestionParamChoiceChoice", + "DecisionsQuestionQuestionParamScore", + "DecisionsQuestionQuestionParamScoreLevel", +] + + +class DecisionsQuestionQuestionParamPredicate(TypedDict, total=False): + """Estimate how likely it is that a statement about the input is true.""" + + instructions: Required[str] + + type: Required[Literal["predicate"]] + """The type of the object. Always `predicate`.""" + + name: str + + +class DecisionsQuestionQuestionParamChoiceChoice(TypedDict, total=False): + value: Required[Union[str, bool]] + """ + Choice values are typed: a string and a boolean with the same text are distinct. + """ + + description: str + + +class DecisionsQuestionQuestionParamChoice(TypedDict, total=False): + """Choose from the supplied options based on the input.""" + + choices: Required[Iterable[DecisionsQuestionQuestionParamChoiceChoice]] + """Provide between 2 and 255 choices. Each choice must be unique.""" + + instructions: Required[str] + + type: Required[Literal["choice"]] + """The type of the object. Always `choice`.""" + + name: str + + +class DecisionsQuestionQuestionParamScoreLevel(TypedDict, total=False): + label: Required[str] + + description: str + + +class DecisionsQuestionQuestionParamScore(TypedDict, total=False): + """Rate the input against the supplied ordered levels.""" + + instructions: Required[str] + + levels: Required[Iterable[DecisionsQuestionQuestionParamScoreLevel]] + + type: Required[Literal["score"]] + """The type of the object. Always `score`.""" + + name: str + + +DecisionsQuestion: TypeAlias = Union[ + DecisionsQuestionQuestionParamPredicate, DecisionsQuestionQuestionParamChoice, DecisionsQuestionQuestionParamScore +] + + +class Decisions(TypedDict, total=False): + """ + Questions evaluated using the current transcript and the session's shared Decision items. + """ + + questions: Required[Iterable[DecisionsQuestion]] + """Native Decision API questions evaluated together, in order.""" + + +class DecisionTriggerParam(TypedDict, total=False): + decisions: Required[Decisions] + """ + Questions evaluated using the current transcript and the session's shared + Decision items. + """ + + event_type: Required[Literal["session.input_transcript.delta", "session.output_transcript.delta"]] + + type: Required[Literal["decisions"]] diff --git a/src/openai/types/live/decisions_delegation_config.py b/src/openai/types/live/decisions_delegation_config.py new file mode 100644 index 0000000000..9a4162439a --- /dev/null +++ b/src/openai/types/live/decisions_delegation_config.py @@ -0,0 +1,85 @@ +# File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias + +from pydantic import StrictStr, StrictBool + +from ..._utils import PropertyInfo +from ..._models import BaseModel + +__all__ = [ + "DecisionsDelegationConfig", + "Question", + "QuestionQuestionParamPredicate", + "QuestionQuestionParamChoice", + "QuestionQuestionParamChoiceChoice", + "QuestionQuestionParamScore", + "QuestionQuestionParamScoreLevel", +] + + +class QuestionQuestionParamPredicate(BaseModel): + """Estimate how likely it is that a statement about the input is true.""" + + instructions: str + + type: Literal["predicate"] + """The type of the object. Always `predicate`.""" + + name: Optional[str] = None + + +class QuestionQuestionParamChoiceChoice(BaseModel): + value: Union[StrictStr, StrictBool] + """ + Choice values are typed: a string and a boolean with the same text are distinct. + """ + + description: Optional[str] = None + + +class QuestionQuestionParamChoice(BaseModel): + """Choose from the supplied options based on the input.""" + + choices: List[QuestionQuestionParamChoiceChoice] + """Provide between 2 and 255 choices. Each choice must be unique.""" + + instructions: str + + type: Literal["choice"] + """The type of the object. Always `choice`.""" + + name: Optional[str] = None + + +class QuestionQuestionParamScoreLevel(BaseModel): + label: str + + description: Optional[str] = None + + +class QuestionQuestionParamScore(BaseModel): + """Rate the input against the supplied ordered levels.""" + + instructions: str + + levels: List[QuestionQuestionParamScoreLevel] + + type: Literal["score"] + """The type of the object. Always `score`.""" + + name: Optional[str] = None + + +Question: TypeAlias = Annotated[ + Union[QuestionQuestionParamPredicate, QuestionQuestionParamChoice, QuestionQuestionParamScore], + PropertyInfo(discriminator="type"), +] + + +class DecisionsDelegationConfig(BaseModel): + model: str + + questions: List[Question] + """Native Decision API questions evaluated together, in order.""" diff --git a/src/openai/types/live/decisions_delegation_config_param.py b/src/openai/types/live/decisions_delegation_config_param.py new file mode 100644 index 0000000000..d9df023a41 --- /dev/null +++ b/src/openai/types/live/decisions_delegation_config_param.py @@ -0,0 +1,79 @@ +# File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +__all__ = [ + "DecisionsDelegationConfigParam", + "Question", + "QuestionQuestionParamPredicate", + "QuestionQuestionParamChoice", + "QuestionQuestionParamChoiceChoice", + "QuestionQuestionParamScore", + "QuestionQuestionParamScoreLevel", +] + + +class QuestionQuestionParamPredicate(TypedDict, total=False): + """Estimate how likely it is that a statement about the input is true.""" + + instructions: Required[str] + + type: Required[Literal["predicate"]] + """The type of the object. Always `predicate`.""" + + name: str + + +class QuestionQuestionParamChoiceChoice(TypedDict, total=False): + value: Required[Union[str, bool]] + """ + Choice values are typed: a string and a boolean with the same text are distinct. + """ + + description: str + + +class QuestionQuestionParamChoice(TypedDict, total=False): + """Choose from the supplied options based on the input.""" + + choices: Required[Iterable[QuestionQuestionParamChoiceChoice]] + """Provide between 2 and 255 choices. Each choice must be unique.""" + + instructions: Required[str] + + type: Required[Literal["choice"]] + """The type of the object. Always `choice`.""" + + name: str + + +class QuestionQuestionParamScoreLevel(TypedDict, total=False): + label: Required[str] + + description: str + + +class QuestionQuestionParamScore(TypedDict, total=False): + """Rate the input against the supplied ordered levels.""" + + instructions: Required[str] + + levels: Required[Iterable[QuestionQuestionParamScoreLevel]] + + type: Required[Literal["score"]] + """The type of the object. Always `score`.""" + + name: str + + +Question: TypeAlias = Union[QuestionQuestionParamPredicate, QuestionQuestionParamChoice, QuestionQuestionParamScore] + + +class DecisionsDelegationConfigParam(TypedDict, total=False): + model: Required[str] + + questions: Required[Iterable[Question]] + """Native Decision API questions evaluated together, in order.""" diff --git a/src/openai/types/live/decisions_delegation_update_config.py b/src/openai/types/live/decisions_delegation_update_config.py new file mode 100644 index 0000000000..6f17a4eda4 --- /dev/null +++ b/src/openai/types/live/decisions_delegation_update_config.py @@ -0,0 +1,85 @@ +# File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias + +from pydantic import StrictStr, StrictBool + +from ..._utils import PropertyInfo +from ..._models import BaseModel + +__all__ = [ + "DecisionsDelegationUpdateConfig", + "Question", + "QuestionQuestionParamPredicate", + "QuestionQuestionParamChoice", + "QuestionQuestionParamChoiceChoice", + "QuestionQuestionParamScore", + "QuestionQuestionParamScoreLevel", +] + + +class QuestionQuestionParamPredicate(BaseModel): + """Estimate how likely it is that a statement about the input is true.""" + + instructions: str + + type: Literal["predicate"] + """The type of the object. Always `predicate`.""" + + name: Optional[str] = None + + +class QuestionQuestionParamChoiceChoice(BaseModel): + value: Union[StrictStr, StrictBool] + """ + Choice values are typed: a string and a boolean with the same text are distinct. + """ + + description: Optional[str] = None + + +class QuestionQuestionParamChoice(BaseModel): + """Choose from the supplied options based on the input.""" + + choices: List[QuestionQuestionParamChoiceChoice] + """Provide between 2 and 255 choices. Each choice must be unique.""" + + instructions: str + + type: Literal["choice"] + """The type of the object. Always `choice`.""" + + name: Optional[str] = None + + +class QuestionQuestionParamScoreLevel(BaseModel): + label: str + + description: Optional[str] = None + + +class QuestionQuestionParamScore(BaseModel): + """Rate the input against the supplied ordered levels.""" + + instructions: str + + levels: List[QuestionQuestionParamScoreLevel] + + type: Literal["score"] + """The type of the object. Always `score`.""" + + name: Optional[str] = None + + +Question: TypeAlias = Annotated[ + Union[QuestionQuestionParamPredicate, QuestionQuestionParamChoice, QuestionQuestionParamScore], + PropertyInfo(discriminator="type"), +] + + +class DecisionsDelegationUpdateConfig(BaseModel): + model: Optional[str] = None + + questions: Optional[List[Question]] = None + """Native Decision API questions evaluated together, in order.""" diff --git a/src/openai/types/live/decisions_delegation_update_config_param.py b/src/openai/types/live/decisions_delegation_update_config_param.py new file mode 100644 index 0000000000..32e8ff842e --- /dev/null +++ b/src/openai/types/live/decisions_delegation_update_config_param.py @@ -0,0 +1,79 @@ +# File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +__all__ = [ + "DecisionsDelegationUpdateConfigParam", + "Question", + "QuestionQuestionParamPredicate", + "QuestionQuestionParamChoice", + "QuestionQuestionParamChoiceChoice", + "QuestionQuestionParamScore", + "QuestionQuestionParamScoreLevel", +] + + +class QuestionQuestionParamPredicate(TypedDict, total=False): + """Estimate how likely it is that a statement about the input is true.""" + + instructions: Required[str] + + type: Required[Literal["predicate"]] + """The type of the object. Always `predicate`.""" + + name: str + + +class QuestionQuestionParamChoiceChoice(TypedDict, total=False): + value: Required[Union[str, bool]] + """ + Choice values are typed: a string and a boolean with the same text are distinct. + """ + + description: str + + +class QuestionQuestionParamChoice(TypedDict, total=False): + """Choose from the supplied options based on the input.""" + + choices: Required[Iterable[QuestionQuestionParamChoiceChoice]] + """Provide between 2 and 255 choices. Each choice must be unique.""" + + instructions: Required[str] + + type: Required[Literal["choice"]] + """The type of the object. Always `choice`.""" + + name: str + + +class QuestionQuestionParamScoreLevel(TypedDict, total=False): + label: Required[str] + + description: str + + +class QuestionQuestionParamScore(TypedDict, total=False): + """Rate the input against the supplied ordered levels.""" + + instructions: Required[str] + + levels: Required[Iterable[QuestionQuestionParamScoreLevel]] + + type: Required[Literal["score"]] + """The type of the object. Always `score`.""" + + name: str + + +Question: TypeAlias = Union[QuestionQuestionParamPredicate, QuestionQuestionParamChoice, QuestionQuestionParamScore] + + +class DecisionsDelegationUpdateConfigParam(TypedDict, total=False): + model: str + + questions: Iterable[Question] + """Native Decision API questions evaluated together, in order.""" diff --git a/src/openai/types/live/delegation_created_event.py b/src/openai/types/live/delegation_created_event.py index 2fe82848b7..03811dcf0e 100644 --- a/src/openai/types/live/delegation_created_event.py +++ b/src/openai/types/live/delegation_created_event.py @@ -18,14 +18,11 @@ class Delegation(BaseModel): """The unique ID of the delegation. Use this as delegation_id when replying to client-owned work or correlating - Responses events. + backend events. """ - target: Literal["client", "responses"] - """ - Where the Live model delegated the work: `client` for your application, or - `responses` for the configured Responses backend. - """ + target: Literal["client", "responses", "decisions"] + """Where the Live model delegated the work: `client`, `responses`, or `decisions`.""" type: Literal["delegation"] """The object type, always `delegation`.""" @@ -39,7 +36,7 @@ class Delegation(BaseModel): class DelegationCreatedEvent(BaseModel): """ - Returned when the Live model delegates work to your application or a Responses backend. Contains delegation metadata and the position on the session timeline where the work was delegated. + Returned when the Live model delegates work to your application, Responses, or Decisions. Contains delegation metadata and the position on the session timeline where the work was delegated. """ delegation: Delegation diff --git a/src/openai/types/live/fork_client_event.py b/src/openai/types/live/fork_client_event.py index f9e2feb0f4..397b955923 100644 --- a/src/openai/types/live/fork_client_event.py +++ b/src/openai/types/live/fork_client_event.py @@ -6,6 +6,7 @@ from ..._utils import PropertyInfo from .session_close_event import SessionCloseEvent from .session_update_event import SessionUpdateEvent +from .decision_create_event import DecisionCreateEvent from .response_create_event import ResponseCreateEvent from .thinking_append_event import ThinkingAppendEvent from .input_audio_mute_event import InputAudioMuteEvent @@ -14,6 +15,8 @@ from .input_audio_append_event import InputAudioAppendEvent from .input_audio_unmute_event import InputAudioUnmuteEvent from .instructions_append_event import InstructionsAppendEvent +from .decision_item_create_event import DecisionItemCreateEvent +from .decision_item_delete_event import DecisionItemDeleteEvent from .response_item_create_event import ResponseItemCreateEvent from .output_audio_fixture_play_event import OutputAudioFixturePlayEvent @@ -30,6 +33,9 @@ InstructionsAppendEvent, ThinkingAppendEvent, CommentaryAppendEvent, + DecisionCreateEvent, + DecisionItemCreateEvent, + DecisionItemDeleteEvent, ResponseItemCreateEvent, ResponseCreateEvent, SessionCloseEvent, diff --git a/src/openai/types/live/fork_client_event_param.py b/src/openai/types/live/fork_client_event_param.py index 1056c3af81..24412b140f 100644 --- a/src/openai/types/live/fork_client_event_param.py +++ b/src/openai/types/live/fork_client_event_param.py @@ -7,6 +7,7 @@ from .session_close_event_param import SessionCloseEventParam from .session_update_event_param import SessionUpdateEventParam +from .decision_create_event_param import DecisionCreateEventParam from .response_create_event_param import ResponseCreateEventParam from .thinking_append_event_param import ThinkingAppendEventParam from .input_audio_mute_event_param import InputAudioMuteEventParam @@ -15,6 +16,8 @@ from .input_audio_append_event_param import InputAudioAppendEventParam from .input_audio_unmute_event_param import InputAudioUnmuteEventParam from .instructions_append_event_param import InstructionsAppendEventParam +from .decision_item_create_event_param import DecisionItemCreateEventParam +from .decision_item_delete_event_param import DecisionItemDeleteEventParam from .response_item_create_event_param import ResponseItemCreateEventParam from .output_audio_fixture_play_event_param import OutputAudioFixturePlayEventParam @@ -30,6 +33,9 @@ InstructionsAppendEventParam, ThinkingAppendEventParam, CommentaryAppendEventParam, + DecisionCreateEventParam, + DecisionItemCreateEventParam, + DecisionItemDeleteEventParam, ResponseItemCreateEventParam, ResponseCreateEventParam, SessionCloseEventParam, diff --git a/src/openai/types/live/fork_server_event.py b/src/openai/types/live/fork_server_event.py index c8ca0073d0..88a006ab51 100644 --- a/src/openai/types/live/fork_server_event.py +++ b/src/openai/types/live/fork_server_event.py @@ -7,6 +7,7 @@ from ..._models import BaseModel from .info_event import InfoEvent from .error_event import ErrorEvent +from .decision_event import DecisionEvent from .response_event import ResponseEvent from .session_closed_event import SessionClosedEvent from .session_started_event import SessionStartedEvent @@ -17,6 +18,8 @@ from .output_audio_delta_event import OutputAudioDeltaEvent from .commentary_appended_event import CommentaryAppendedEvent from .input_audio_unmuted_event import InputAudioUnmutedEvent +from .decision_item_created_event import DecisionItemCreatedEvent +from .decision_item_deleted_event import DecisionItemDeletedEvent from .instructions_appended_event import InstructionsAppendedEvent from .session_usage_updated_event import SessionUsageUpdatedEvent from .input_transcript_delta_event import InputTranscriptDeltaEvent @@ -153,6 +156,9 @@ class TransportFailed(BaseModel): InputTranscriptDeltaEvent, OutputTranscriptDeltaEvent, DelegationCreatedEvent, + DecisionEvent, + DecisionItemCreatedEvent, + DecisionItemDeletedEvent, ResponseEvent, SessionUsageUpdatedEvent, SessionClosedEvent, diff --git a/src/openai/types/live/media_session_config_param.py b/src/openai/types/live/media_session_config_param.py index d230538630..221037a655 100644 --- a/src/openai/types/live/media_session_config_param.py +++ b/src/openai/types/live/media_session_config_param.py @@ -9,10 +9,20 @@ from .custom_voice_param import CustomVoiceParam from .initial_item_param import InitialItemParam from .client_config_param import ClientConfigParam +from .decision_trigger_param import DecisionTriggerParam from .client_delegation_param import ClientDelegationParam +from .decisions_delegation_config_param import DecisionsDelegationConfigParam from .responses_delegation_config_param import ResponsesDelegationConfigParam -__all__ = ["MediaSessionConfigParam", "Audio", "AudioOutput", "AudioOutputVoice", "Delegation", "DelegationResponses"] +__all__ = [ + "MediaSessionConfigParam", + "Audio", + "AudioOutput", + "AudioOutputVoice", + "Delegation", + "DelegationResponses", + "DelegationDecisions", +] AudioOutputVoice: TypeAlias = Union[str, BuiltInVoice, CustomVoiceParam] @@ -59,7 +69,13 @@ class DelegationResponses(TypedDict, total=False): """ -Delegation: TypeAlias = Union[ClientDelegationParam, DelegationResponses] +class DelegationDecisions(TypedDict, total=False): + decisions: Required[DecisionsDelegationConfigParam] + + type: Required[Literal["decisions"]] + + +Delegation: TypeAlias = Union[ClientDelegationParam, DelegationResponses, DelegationDecisions] class MediaSessionConfigParam(TypedDict, total=False): @@ -90,8 +106,8 @@ class MediaSessionConfigParam(TypedDict, total=False): delegation: Optional[Delegation] """Who handles tasks delegated by the Live model. - Omitted or null selects your application; use `responses` to let the API manage - a Responses backend. + Omitted or null selects your application; use `responses` or `decisions` to + delegate to the corresponding API. """ input: Iterable[InitialItemParam] @@ -117,3 +133,11 @@ class MediaSessionConfigParam(TypedDict, total=False): Defaults to false for new sessions. """ + + triggers: Iterable[DecisionTriggerParam] + """At most one Decisions trigger per transcript event type. + + Triggers run independently of delegation. On update, omit triggers to keep the + current configuration, send a list to replace it, or send an empty list to + disable triggers. + """ diff --git a/src/openai/types/live/server_event.py b/src/openai/types/live/server_event.py index 54f4872cf0..26dc6a3604 100644 --- a/src/openai/types/live/server_event.py +++ b/src/openai/types/live/server_event.py @@ -7,6 +7,7 @@ from ..._models import BaseModel from .info_event import InfoEvent from .error_event import ErrorEvent +from .decision_event import DecisionEvent from .response_event import ResponseEvent from .session_closed_event import SessionClosedEvent from .session_started_event import SessionStartedEvent @@ -17,6 +18,8 @@ from .output_audio_delta_event import OutputAudioDeltaEvent from .commentary_appended_event import CommentaryAppendedEvent from .input_audio_unmuted_event import InputAudioUnmutedEvent +from .decision_item_created_event import DecisionItemCreatedEvent +from .decision_item_deleted_event import DecisionItemDeletedEvent from .instructions_appended_event import InstructionsAppendedEvent from .session_usage_updated_event import SessionUsageUpdatedEvent from .input_transcript_delta_event import InputTranscriptDeltaEvent @@ -153,6 +156,9 @@ class TransportFailed(BaseModel): InputTranscriptDeltaEvent, OutputTranscriptDeltaEvent, DelegationCreatedEvent, + DecisionEvent, + DecisionItemCreatedEvent, + DecisionItemDeletedEvent, ResponseEvent, SessionUsageUpdatedEvent, SessionClosedEvent, diff --git a/src/openai/types/live/session_accept_params.py b/src/openai/types/live/session_accept_params.py index 66f9f0d822..31cfa363d2 100644 --- a/src/openai/types/live/session_accept_params.py +++ b/src/openai/types/live/session_accept_params.py @@ -8,7 +8,9 @@ from .built_in_voice import BuiltInVoice from .custom_voice_param import CustomVoiceParam from .initial_item_param import InitialItemParam +from .decision_trigger_param import DecisionTriggerParam from .client_delegation_param import ClientDelegationParam +from .decisions_delegation_config_param import DecisionsDelegationConfigParam from .responses_delegation_config_param import ResponsesDelegationConfigParam __all__ = [ @@ -19,6 +21,7 @@ "SessionAudioOutputVoice", "SessionDelegation", "SessionDelegationResponses", + "SessionDelegationDecisions", ] @@ -75,7 +78,13 @@ class SessionDelegationResponses(TypedDict, total=False): """ -SessionDelegation: TypeAlias = Union[ClientDelegationParam, SessionDelegationResponses] +class SessionDelegationDecisions(TypedDict, total=False): + decisions: Required[DecisionsDelegationConfigParam] + + type: Required[Literal["decisions"]] + + +SessionDelegation: TypeAlias = Union[ClientDelegationParam, SessionDelegationResponses, SessionDelegationDecisions] class Session(TypedDict, total=False): @@ -99,8 +108,8 @@ class Session(TypedDict, total=False): delegation: Optional[SessionDelegation] """Who handles tasks delegated by the Live model. - Omitted or null selects your application; use `responses` to let the API manage - a Responses backend. + Omitted or null selects your application; use `responses` or `decisions` to + delegate to the corresponding API. """ input: Iterable[InitialItemParam] @@ -126,3 +135,11 @@ class Session(TypedDict, total=False): Defaults to false for new sessions. """ + + triggers: Iterable[DecisionTriggerParam] + """At most one Decisions trigger per transcript event type. + + Triggers run independently of delegation. On update, omit triggers to keep the + current configuration, send a list to replace it, or send an empty list to + disable triggers. + """ diff --git a/src/openai/types/live/session_config.py b/src/openai/types/live/session_config.py index b99550660d..5725586def 100644 --- a/src/openai/types/live/session_config.py +++ b/src/openai/types/live/session_config.py @@ -10,10 +10,20 @@ from .initial_item import InitialItem from .client_config import ClientConfig from .built_in_voice import BuiltInVoice +from .decision_trigger import DecisionTrigger from .client_delegation import ClientDelegation +from .decisions_delegation_config import DecisionsDelegationConfig from .responses_delegation_config import ResponsesDelegationConfig -__all__ = ["SessionConfig", "Audio", "AudioOutput", "AudioOutputVoice", "Delegation", "DelegationResponses"] +__all__ = [ + "SessionConfig", + "Audio", + "AudioOutput", + "AudioOutputVoice", + "Delegation", + "DelegationResponses", + "DelegationDecisions", +] AudioOutputVoice: TypeAlias = Union[str, BuiltInVoice, CustomVoice] @@ -60,8 +70,14 @@ class DelegationResponses(BaseModel): """ +class DelegationDecisions(BaseModel): + decisions: DecisionsDelegationConfig + + type: Literal["decisions"] + + Delegation: TypeAlias = Annotated[ - Union[ClientDelegation, DelegationResponses, None], PropertyInfo(discriminator="type") + Union[ClientDelegation, DelegationResponses, DelegationDecisions, None], PropertyInfo(discriminator="type") ] @@ -93,8 +109,8 @@ class SessionConfig(BaseModel): delegation: Optional[Delegation] = None """Who handles tasks delegated by the Live model. - Omitted or null selects your application; use `responses` to let the API manage - a Responses backend. + Omitted or null selects your application; use `responses` or `decisions` to + delegate to the corresponding API. """ input: Optional[List[InitialItem]] = None @@ -120,3 +136,11 @@ class SessionConfig(BaseModel): Defaults to false for new sessions. """ + + triggers: Optional[List[DecisionTrigger]] = None + """At most one Decisions trigger per transcript event type. + + Triggers run independently of delegation. On update, omit triggers to keep the + current configuration, send a list to replace it, or send an empty list to + disable triggers. + """ diff --git a/src/openai/types/live/session_config_param.py b/src/openai/types/live/session_config_param.py index 03cb934755..f62a83e4bc 100644 --- a/src/openai/types/live/session_config_param.py +++ b/src/openai/types/live/session_config_param.py @@ -10,10 +10,20 @@ from .custom_voice_param import CustomVoiceParam from .initial_item_param import InitialItemParam from .client_config_param import ClientConfigParam +from .decision_trigger_param import DecisionTriggerParam from .client_delegation_param import ClientDelegationParam +from .decisions_delegation_config_param import DecisionsDelegationConfigParam from .responses_delegation_config_param import ResponsesDelegationConfigParam -__all__ = ["SessionConfigParam", "Audio", "AudioOutput", "AudioOutputVoice", "Delegation", "DelegationResponses"] +__all__ = [ + "SessionConfigParam", + "Audio", + "AudioOutput", + "AudioOutputVoice", + "Delegation", + "DelegationResponses", + "DelegationDecisions", +] AudioOutputVoice: TypeAlias = Union[str, BuiltInVoice, CustomVoiceParam] @@ -60,7 +70,13 @@ class DelegationResponses(TypedDict, total=False): """ -Delegation: TypeAlias = Union[ClientDelegationParam, DelegationResponses] +class DelegationDecisions(TypedDict, total=False): + decisions: Required[DecisionsDelegationConfigParam] + + type: Required[Literal["decisions"]] + + +Delegation: TypeAlias = Union[ClientDelegationParam, DelegationResponses, DelegationDecisions] class SessionConfigParam(TypedDict, total=False): @@ -91,8 +107,8 @@ class SessionConfigParam(TypedDict, total=False): delegation: Optional[Delegation] """Who handles tasks delegated by the Live model. - Omitted or null selects your application; use `responses` to let the API manage - a Responses backend. + Omitted or null selects your application; use `responses` or `decisions` to + delegate to the corresponding API. """ input: Iterable[InitialItemParam] @@ -118,3 +134,11 @@ class SessionConfigParam(TypedDict, total=False): Defaults to false for new sessions. """ + + triggers: Iterable[DecisionTriggerParam] + """At most one Decisions trigger per transcript event type. + + Triggers run independently of delegation. On update, omit triggers to keep the + current configuration, send a list to replace it, or send an empty list to + disable triggers. + """ diff --git a/src/openai/types/live/session_resource.py b/src/openai/types/live/session_resource.py index 528fb742d0..3f5f494c22 100644 --- a/src/openai/types/live/session_resource.py +++ b/src/openai/types/live/session_resource.py @@ -10,10 +10,20 @@ from .initial_item import InitialItem from .client_config import ClientConfig from .built_in_voice import BuiltInVoice +from .decision_trigger import DecisionTrigger from .client_delegation import ClientDelegation +from .decisions_delegation_config import DecisionsDelegationConfig from .responses_delegation_config import ResponsesDelegationConfig -__all__ = ["SessionResource", "Audio", "AudioOutput", "AudioOutputVoice", "Delegation", "DelegationResponses"] +__all__ = [ + "SessionResource", + "Audio", + "AudioOutput", + "AudioOutputVoice", + "Delegation", + "DelegationResponses", + "DelegationDecisions", +] AudioOutputVoice: TypeAlias = Union[str, BuiltInVoice, CustomVoice] @@ -60,8 +70,14 @@ class DelegationResponses(BaseModel): """ +class DelegationDecisions(BaseModel): + decisions: DecisionsDelegationConfig + + type: Literal["decisions"] + + Delegation: TypeAlias = Annotated[ - Union[ClientDelegation, DelegationResponses, None], PropertyInfo(discriminator="type") + Union[ClientDelegation, DelegationResponses, DelegationDecisions, None], PropertyInfo(discriminator="type") ] @@ -107,8 +123,8 @@ class SessionResource(BaseModel): delegation: Optional[Delegation] = None """Who handles tasks delegated by the Live model. - Omitted or null selects your application; use `responses` to let the API manage - a Responses backend. + Omitted or null selects your application; use `responses` or `decisions` to + delegate to the corresponding API. """ input: Optional[List[InitialItem]] = None @@ -134,3 +150,11 @@ class SessionResource(BaseModel): Defaults to false for new sessions. """ + + triggers: Optional[List[DecisionTrigger]] = None + """At most one Decisions trigger per transcript event type. + + Triggers run independently of delegation. On update, omit triggers to keep the + current configuration, send a list to replace it, or send an empty list to + disable triggers. + """ diff --git a/src/openai/types/live/session_update_config.py b/src/openai/types/live/session_update_config.py index 788bcc4945..eb6e586547 100644 --- a/src/openai/types/live/session_update_config.py +++ b/src/openai/types/live/session_update_config.py @@ -1,14 +1,16 @@ # File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details. -from typing import Union, Optional +from typing import List, Union, Optional from typing_extensions import Literal, Annotated, TypeAlias from ..._utils import PropertyInfo from ..._models import BaseModel +from .decision_trigger import DecisionTrigger from .client_delegation import ClientDelegation +from .decisions_delegation_update_config import DecisionsDelegationUpdateConfig from .responses_delegation_update_config import ResponsesDelegationUpdateConfig -__all__ = ["SessionUpdateConfig", "Delegation", "DelegationResponses"] +__all__ = ["SessionUpdateConfig", "Delegation", "DelegationResponses", "DelegationDecisions"] class DelegationResponses(BaseModel): @@ -29,15 +31,20 @@ class DelegationResponses(BaseModel): """ +class DelegationDecisions(BaseModel): + type: Literal["decisions"] + + decisions: Optional[DecisionsDelegationUpdateConfig] = None + + Delegation: TypeAlias = Annotated[ - Union[ClientDelegation, DelegationResponses, None], PropertyInfo(discriminator="type") + Union[ClientDelegation, DelegationResponses, DelegationDecisions, None], PropertyInfo(discriminator="type") ] class SessionUpdateConfig(BaseModel): - """Changes to an active Live session. - - Only delegation backend settings can be updated after startup. + """ + Changes to an active Live session's delegation settings and transcript triggers. """ delegation: Optional[Delegation] = None @@ -46,3 +53,11 @@ class SessionUpdateConfig(BaseModel): The delegation type must match the current session; omitted settings retain their values. """ + + triggers: Optional[List[DecisionTrigger]] = None + """At most one Decisions trigger per transcript event type. + + Triggers run independently of delegation. On update, omit triggers to keep the + current configuration, send a list to replace it, or send an empty list to + disable triggers. + """ diff --git a/src/openai/types/live/session_update_config_param.py b/src/openai/types/live/session_update_config_param.py index 575cc60228..7f32c98a9e 100644 --- a/src/openai/types/live/session_update_config_param.py +++ b/src/openai/types/live/session_update_config_param.py @@ -2,13 +2,15 @@ from __future__ import annotations -from typing import Union, Optional +from typing import Union, Iterable, Optional from typing_extensions import Literal, Required, TypeAlias, TypedDict +from .decision_trigger_param import DecisionTriggerParam from .client_delegation_param import ClientDelegationParam +from .decisions_delegation_update_config_param import DecisionsDelegationUpdateConfigParam from .responses_delegation_update_config_param import ResponsesDelegationUpdateConfigParam -__all__ = ["SessionUpdateConfigParam", "Delegation", "DelegationResponses"] +__all__ = ["SessionUpdateConfigParam", "Delegation", "DelegationResponses", "DelegationDecisions"] class DelegationResponses(TypedDict, total=False): @@ -29,13 +31,18 @@ class DelegationResponses(TypedDict, total=False): """ -Delegation: TypeAlias = Union[ClientDelegationParam, DelegationResponses] +class DelegationDecisions(TypedDict, total=False): + type: Required[Literal["decisions"]] + decisions: DecisionsDelegationUpdateConfigParam -class SessionUpdateConfigParam(TypedDict, total=False): - """Changes to an active Live session. - Only delegation backend settings can be updated after startup. +Delegation: TypeAlias = Union[ClientDelegationParam, DelegationResponses, DelegationDecisions] + + +class SessionUpdateConfigParam(TypedDict, total=False): + """ + Changes to an active Live session's delegation settings and transcript triggers. """ delegation: Optional[Delegation] @@ -44,3 +51,11 @@ class SessionUpdateConfigParam(TypedDict, total=False): The delegation type must match the current session; omitted settings retain their values. """ + + triggers: Iterable[DecisionTriggerParam] + """At most one Decisions trigger per transcript event type. + + Triggers run independently of delegation. On update, omit triggers to keep the + current configuration, send a list to replace it, or send an empty list to + disable triggers. + """ diff --git a/src/openai/types/live/session_update_event.py b/src/openai/types/live/session_update_event.py index 9fee82a1d1..c56a4937c6 100644 --- a/src/openai/types/live/session_update_event.py +++ b/src/openai/types/live/session_update_event.py @@ -10,17 +10,16 @@ class SessionUpdateEvent(BaseModel): - """Update the delegation settings of an active Live session. + """Update the delegation settings or transcript triggers of an active Live session. The server acknowledges accepted changes with `session.updated`. """ session: SessionUpdateConfig - """Sparse delegation updates. + """Sparse delegation and trigger updates. - Omitted settings retain their values. The delegation type cannot change, - including resetting Responses delegation to null or client. Model, frontend - instructions, audio, and startup input are immutable. + Omitted settings retain their values. The delegation type cannot change. Model, + frontend instructions, audio, and startup input are immutable. """ type: Literal["session.update"] diff --git a/src/openai/types/live/session_update_event_param.py b/src/openai/types/live/session_update_event_param.py index d72c97037e..24b2cf1f2e 100644 --- a/src/openai/types/live/session_update_event_param.py +++ b/src/openai/types/live/session_update_event_param.py @@ -11,17 +11,16 @@ class SessionUpdateEventParam(TypedDict, total=False): - """Update the delegation settings of an active Live session. + """Update the delegation settings or transcript triggers of an active Live session. The server acknowledges accepted changes with `session.updated`. """ session: Required[SessionUpdateConfigParam] - """Sparse delegation updates. + """Sparse delegation and trigger updates. - Omitted settings retain their values. The delegation type cannot change, - including resetting Responses delegation to null or client. Model, frontend - instructions, audio, and startup input are immutable. + Omitted settings retain their values. The delegation type cannot change. Model, + frontend instructions, audio, and startup input are immutable. """ type: Required[Literal["session.update"]] diff --git a/tests/api_resources/live/test_sessions.py b/tests/api_resources/live/test_sessions.py index fa914eccf5..14435ec029 100644 --- a/tests/api_resources/live/test_sessions.py +++ b/tests/api_resources/live/test_sessions.py @@ -60,6 +60,21 @@ def test_method_accept_with_all_params(self, client: OpenAI) -> None: ], "instructions": "instructions", "store": True, + "triggers": [ + { + "decisions": { + "questions": [ + { + "instructions": "instructions", + "type": "predicate", + "name": "name", + } + ] + }, + "event_type": "session.input_transcript.delta", + "type": "decisions", + } + ], }, ) assert session is None @@ -417,6 +432,21 @@ async def test_method_accept_with_all_params(self, async_client: AsyncOpenAI) -> ], "instructions": "instructions", "store": True, + "triggers": [ + { + "decisions": { + "questions": [ + { + "instructions": "instructions", + "type": "predicate", + "name": "name", + } + ] + }, + "event_type": "session.input_transcript.delta", + "type": "decisions", + } + ], }, ) assert session is None diff --git a/tests/api_resources/test_live.py b/tests/api_resources/test_live.py index d516cf6673..e38b7791b6 100644 --- a/tests/api_resources/test_live.py +++ b/tests/api_resources/test_live.py @@ -57,6 +57,21 @@ def test_method_create_with_all_params(self, client: OpenAI) -> None: ], "instructions": "instructions", "store": True, + "triggers": [ + { + "decisions": { + "questions": [ + { + "instructions": "instructions", + "type": "predicate", + "name": "name", + } + ] + }, + "event_type": "session.input_transcript.delta", + "type": "decisions", + } + ], }, transport={ "sdp": "x", @@ -143,6 +158,21 @@ async def test_method_create_with_all_params(self, async_client: AsyncOpenAI) -> ], "instructions": "instructions", "store": True, + "triggers": [ + { + "decisions": { + "questions": [ + { + "instructions": "instructions", + "type": "predicate", + "name": "name", + } + ] + }, + "event_type": "session.input_transcript.delta", + "type": "decisions", + } + ], }, transport={ "sdp": "x",