Compare commits

...
1 Commits
Author SHA1 Message Date
OpenRouter Team faad3acf8d Commits included in this export:
- 5dbab2094bc744db4a90b3097520d897e5d0d634
  - 4c47d1af1735db18a1c1a7f463e801c7f71ad4e5

GitOrigin-RevId: 5dbab2094bc744db4a90b3097520d897e5d0d634
2026-02-08 06:52:31 +00:00
29 changed files with 608 additions and 322 deletions
+11 -7
View File
@@ -1,12 +1,12 @@
lockVersion: 2.0.0 lockVersion: 2.0.0
id: cfd52247-6a25-4c6d-bbce-fe6fce0cd69d id: cfd52247-6a25-4c6d-bbce-fe6fce0cd69d
management: management:
docChecksum: 56062ba1997e25ff8be6529c550e5de9 docChecksum: a8fed71df7458c6d948fc393e17aa9bc
docVersion: 1.0.0 docVersion: 1.0.0
speakeasyVersion: 1.666.0 speakeasyVersion: 1.666.0
generationVersion: 2.768.0 generationVersion: 2.768.0
releaseVersion: 0.6.0 releaseVersion: 0.7.0
configChecksum: 690b77f47b975e28d7e11a6b96fa1c2f configChecksum: fb83a92d2ee84da7390a12353d622d23
repoURL: https://github.com/OpenRouterTeam/python-sdk.git repoURL: https://github.com/OpenRouterTeam/python-sdk.git
installationURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git
published: true published: true
@@ -14,6 +14,7 @@ features:
python: python:
acceptHeaders: 3.0.0 acceptHeaders: 3.0.0
additionalDependencies: 1.0.0 additionalDependencies: 1.0.0
additionalProperties: 1.0.1
constsAndDefaults: 1.0.5 constsAndDefaults: 1.0.5
core: 5.23.13 core: 5.23.13
defaultEnabledRetries: 0.2.0 defaultEnabledRetries: 0.2.0
@@ -424,10 +425,11 @@ generatedFiles:
- docs/components/schema17responsehealing.md - docs/components/schema17responsehealing.md
- docs/components/schema17web.md - docs/components/schema17web.md
- docs/components/schema19.md - docs/components/schema19.md
- docs/components/schema19reasoningencrypted.md - docs/components/schema20.md
- docs/components/schema19reasoningsummary.md - docs/components/schema20reasoningencrypted.md
- docs/components/schema19reasoningtext.md - docs/components/schema20reasoningsummary.md
- docs/components/schema21.md - docs/components/schema20reasoningtext.md
- docs/components/schema22.md
- docs/components/schema3.md - docs/components/schema3.md
- docs/components/schema5.md - docs/components/schema5.md
- docs/components/schema5enum.md - docs/components/schema5enum.md
@@ -447,6 +449,7 @@ generatedFiles:
- docs/components/toolresponsemessagecontent.md - docs/components/toolresponsemessagecontent.md
- docs/components/toomanyrequestsresponseerrordata.md - docs/components/toomanyrequestsresponseerrordata.md
- docs/components/topproviderinfo.md - docs/components/topproviderinfo.md
- docs/components/trace.md
- docs/components/truncation.md - docs/components/truncation.md
- docs/components/ttl.md - docs/components/ttl.md
- docs/components/type.md - docs/components/type.md
@@ -695,6 +698,7 @@ generatedFiles:
- src/openrouter/components/_schema14.py - src/openrouter/components/_schema14.py
- src/openrouter/components/_schema17.py - src/openrouter/components/_schema17.py
- src/openrouter/components/_schema19.py - src/openrouter/components/_schema19.py
- src/openrouter/components/_schema20.py
- src/openrouter/components/_schema5.py - src/openrouter/components/_schema5.py
- src/openrouter/components/activityitem.py - src/openrouter/components/activityitem.py
- src/openrouter/components/assistantmessage.py - src/openrouter/components/assistantmessage.py
+1 -1
View File
@@ -31,7 +31,7 @@ generation:
skipResponseBodyAssertions: false skipResponseBodyAssertions: false
preApplyUnionDiscriminators: true preApplyUnionDiscriminators: true
python: python:
version: 0.6.0 version: 0.7.0
additionalDependencies: additionalDependencies:
dev: {} dev: {}
main: {} main: {}
+71 -13
View File
@@ -4094,6 +4094,25 @@ components:
A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for
observability. If provided in both the request body and the x-session-id header, the body value takes observability. If provided in both the request body and the x-session-id header, the body value takes
precedence. Maximum of 128 characters. precedence. Maximum of 128 characters.
trace:
type: object
properties:
trace_id:
type: string
trace_name:
type: string
span_name:
type: string
generation_name:
type: string
parent_span_id:
type: string
additionalProperties:
nullable: true
description: >-
Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name,
parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured
broadcast destinations.
description: Request schema for Responses endpoint description: Request schema for Responses endpoint
example: example:
model: anthropic/claude-4.5-sonnet-20250929 model: anthropic/claude-4.5-sonnet-20250929
@@ -7191,6 +7210,25 @@ components:
A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for
observability. If provided in both the request body and the x-session-id header, the body value takes observability. If provided in both the request body and the x-session-id header, the body value takes
precedence. Maximum of 128 characters. precedence. Maximum of 128 characters.
trace:
type: object
properties:
trace_id:
type: string
trace_name:
type: string
span_name:
type: string
generation_name:
type: string
parent_span_id:
type: string
additionalProperties:
nullable: true
description: >-
Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name,
parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured
broadcast destinations.
models: models:
type: array type: array
items: items:
@@ -8532,6 +8570,20 @@ components:
type: string type: string
maxLength: 128 maxLength: 128
__schema19: __schema19:
type: object
properties:
trace_id:
type: string
trace_name:
type: string
span_name:
type: string
generation_name:
type: string
parent_span_id:
type: string
additionalProperties: {}
__schema20:
oneOf: oneOf:
- type: object - type: object
properties: properties:
@@ -8541,9 +8593,9 @@ components:
summary: summary:
type: string type: string
id: id:
$ref: '#/components/schemas/__schema20'
format:
$ref: '#/components/schemas/__schema21' $ref: '#/components/schemas/__schema21'
format:
$ref: '#/components/schemas/__schema22'
index: index:
$ref: '#/components/schemas/__schema11' $ref: '#/components/schemas/__schema11'
required: required:
@@ -8557,9 +8609,9 @@ components:
data: data:
type: string type: string
id: id:
$ref: '#/components/schemas/__schema20'
format:
$ref: '#/components/schemas/__schema21' $ref: '#/components/schemas/__schema21'
format:
$ref: '#/components/schemas/__schema22'
index: index:
$ref: '#/components/schemas/__schema11' $ref: '#/components/schemas/__schema11'
required: required:
@@ -8579,19 +8631,19 @@ components:
- type: string - type: string
- type: 'null' - type: 'null'
id: id:
$ref: '#/components/schemas/__schema20'
format:
$ref: '#/components/schemas/__schema21' $ref: '#/components/schemas/__schema21'
format:
$ref: '#/components/schemas/__schema22'
index: index:
$ref: '#/components/schemas/__schema11' $ref: '#/components/schemas/__schema11'
required: required:
- type - type
type: object type: object
__schema20: __schema21:
anyOf: anyOf:
- type: string - type: string
- type: 'null' - type: 'null'
__schema21: __schema22:
anyOf: anyOf:
- type: string - type: string
enum: enum:
@@ -8602,7 +8654,7 @@ components:
- anthropic-claude-v1 - anthropic-claude-v1
- google-gemini-v1 - google-gemini-v1
- type: 'null' - type: 'null'
__schema25: __schema26:
anyOf: anyOf:
- $ref: '#/components/schemas/ChatCompletionFinishReason' - $ref: '#/components/schemas/ChatCompletionFinishReason'
- type: 'null' - type: 'null'
@@ -8978,7 +9030,7 @@ components:
reasoning_details: reasoning_details:
type: array type: array
items: items:
$ref: '#/components/schemas/__schema19' $ref: '#/components/schemas/__schema20'
images: images:
type: array type: array
items: items:
@@ -9111,6 +9163,12 @@ components:
observability. If provided in both the request body and the x-session-id header, the body value takes observability. If provided in both the request body and the x-session-id header, the body value takes
precedence. Maximum of 128 characters. precedence. Maximum of 128 characters.
$ref: '#/components/schemas/__schema18' $ref: '#/components/schemas/__schema18'
trace:
description: >-
Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name,
parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured
broadcast destinations.
$ref: '#/components/schemas/__schema19'
messages: messages:
minItems: 1 minItems: 1
type: array type: array
@@ -9286,7 +9344,7 @@ components:
type: object type: object
properties: properties:
finish_reason: finish_reason:
$ref: '#/components/schemas/__schema25' $ref: '#/components/schemas/__schema26'
index: index:
type: number type: number
message: message:
@@ -9344,14 +9402,14 @@ components:
reasoning_details: reasoning_details:
type: array type: array
items: items:
$ref: '#/components/schemas/__schema19' $ref: '#/components/schemas/__schema20'
ChatStreamingChoice: ChatStreamingChoice:
type: object type: object
properties: properties:
delta: delta:
$ref: '#/components/schemas/ChatStreamingMessageChunk' $ref: '#/components/schemas/ChatStreamingMessageChunk'
finish_reason: finish_reason:
$ref: '#/components/schemas/__schema25' $ref: '#/components/schemas/__schema26'
index: index:
type: number type: number
logprobs: logprobs:
+65 -13
View File
@@ -4097,6 +4097,23 @@ components:
maxLength: 128 maxLength: 128
description: >- description: >-
A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters. A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters.
trace:
type: object
properties:
trace_id:
type: string
trace_name:
type: string
span_name:
type: string
generation_name:
type: string
parent_span_id:
type: string
additionalProperties:
nullable: true
description: >-
Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations.
description: Request schema for Responses endpoint description: Request schema for Responses endpoint
example: example:
model: anthropic/claude-4.5-sonnet-20250929 model: anthropic/claude-4.5-sonnet-20250929
@@ -7209,6 +7226,23 @@ components:
maxLength: 128 maxLength: 128
description: >- description: >-
A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters. A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters.
trace:
type: object
properties:
trace_id:
type: string
trace_name:
type: string
span_name:
type: string
generation_name:
type: string
parent_span_id:
type: string
additionalProperties:
nullable: true
description: >-
Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations.
models: models:
type: array type: array
items: items:
@@ -8536,6 +8570,20 @@ components:
type: string type: string
maxLength: 128 maxLength: 128
__schema19: __schema19:
type: object
properties:
trace_id:
type: string
trace_name:
type: string
span_name:
type: string
generation_name:
type: string
parent_span_id:
type: string
additionalProperties: {}
__schema20:
oneOf: oneOf:
- type: object - type: object
properties: properties:
@@ -8545,9 +8593,9 @@ components:
summary: summary:
type: string type: string
id: id:
$ref: '#/components/schemas/__schema20'
format:
$ref: '#/components/schemas/__schema21' $ref: '#/components/schemas/__schema21'
format:
$ref: '#/components/schemas/__schema22'
index: index:
$ref: '#/components/schemas/__schema11' $ref: '#/components/schemas/__schema11'
required: required:
@@ -8561,9 +8609,9 @@ components:
data: data:
type: string type: string
id: id:
$ref: '#/components/schemas/__schema20'
format:
$ref: '#/components/schemas/__schema21' $ref: '#/components/schemas/__schema21'
format:
$ref: '#/components/schemas/__schema22'
index: index:
$ref: '#/components/schemas/__schema11' $ref: '#/components/schemas/__schema11'
required: required:
@@ -8583,19 +8631,19 @@ components:
- type: string - type: string
- type: 'null' - type: 'null'
id: id:
$ref: '#/components/schemas/__schema20'
format:
$ref: '#/components/schemas/__schema21' $ref: '#/components/schemas/__schema21'
format:
$ref: '#/components/schemas/__schema22'
index: index:
$ref: '#/components/schemas/__schema11' $ref: '#/components/schemas/__schema11'
required: required:
- type - type
type: object type: object
__schema20: __schema21:
anyOf: anyOf:
- type: string - type: string
- type: 'null' - type: 'null'
__schema21: __schema22:
anyOf: anyOf:
- type: string - type: string
enum: enum:
@@ -8607,7 +8655,7 @@ components:
- google-gemini-v1 - google-gemini-v1
x-speakeasy-unknown-values: allow x-speakeasy-unknown-values: allow
- type: 'null' - type: 'null'
__schema25: __schema26:
anyOf: anyOf:
- $ref: '#/components/schemas/ChatCompletionFinishReason' - $ref: '#/components/schemas/ChatCompletionFinishReason'
- type: 'null' - type: 'null'
@@ -8986,7 +9034,7 @@ components:
reasoning_details: reasoning_details:
type: array type: array
items: items:
$ref: '#/components/schemas/__schema19' $ref: '#/components/schemas/__schema20'
images: images:
type: array type: array
items: items:
@@ -9118,6 +9166,10 @@ components:
description: >- description: >-
A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters. A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters.
$ref: '#/components/schemas/__schema18' $ref: '#/components/schemas/__schema18'
trace:
description: >-
Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations.
$ref: '#/components/schemas/__schema19'
messages: messages:
minItems: 1 minItems: 1
type: array type: array
@@ -9295,7 +9347,7 @@ components:
type: object type: object
properties: properties:
finish_reason: finish_reason:
$ref: '#/components/schemas/__schema25' $ref: '#/components/schemas/__schema26'
index: index:
type: number type: number
message: message:
@@ -9353,14 +9405,14 @@ components:
reasoning_details: reasoning_details:
type: array type: array
items: items:
$ref: '#/components/schemas/__schema19' $ref: '#/components/schemas/__schema20'
ChatStreamingChoice: ChatStreamingChoice:
type: object type: object
properties: properties:
delta: delta:
$ref: '#/components/schemas/ChatStreamingMessageChunk' $ref: '#/components/schemas/ChatStreamingMessageChunk'
finish_reason: finish_reason:
$ref: '#/components/schemas/__schema25' $ref: '#/components/schemas/__schema26'
index: index:
type: number type: number
logprobs: logprobs:
+5 -5
View File
@@ -8,8 +8,8 @@ sources:
- latest - latest
OpenRouter API: OpenRouter API:
sourceNamespace: open-router-chat-completions-api sourceNamespace: open-router-chat-completions-api
sourceRevisionDigest: sha256:2dbe784978f60cb53a0d081e1b5f4cbb42ca86b1ff8f4361869fa78c42e042ee sourceRevisionDigest: sha256:79b8d064e91a2614d9853eb640f9e7255a8b1e9614882641ab5c75ac071814d6
sourceBlobDigest: sha256:851aadf3180735f9dbfdb2904011de231d3805d187499c24a450a224cacf1ed2 sourceBlobDigest: sha256:b74fe6d34af037172e5b80f6d03b85df45eb5360577027682ea7d3fd308e8293
tags: tags:
- latest - latest
- main - main
@@ -18,10 +18,10 @@ targets:
open-router: open-router:
source: OpenRouter API source: OpenRouter API
sourceNamespace: open-router-chat-completions-api sourceNamespace: open-router-chat-completions-api
sourceRevisionDigest: sha256:2dbe784978f60cb53a0d081e1b5f4cbb42ca86b1ff8f4361869fa78c42e042ee sourceRevisionDigest: sha256:79b8d064e91a2614d9853eb640f9e7255a8b1e9614882641ab5c75ac071814d6
sourceBlobDigest: sha256:851aadf3180735f9dbfdb2904011de231d3805d187499c24a450a224cacf1ed2 sourceBlobDigest: sha256:b74fe6d34af037172e5b80f6d03b85df45eb5360577027682ea7d3fd308e8293
codeSamplesNamespace: open-router-python-code-samples codeSamplesNamespace: open-router-python-code-samples
codeSamplesRevisionDigest: sha256:cf9f3fd9983864e3c5dd5bc3fa9198efc9493f4fbc671130e8f07e87722c43dd codeSamplesRevisionDigest: sha256:ff5b83e50996943aaf26b9089fd02488fc49b8c5f742dc432135c8eeb69c7042
workflow: workflow:
workflowVersion: 1.0.0 workflowVersion: 1.0.0
speakeasyVersion: 1.666.0 speakeasyVersion: 1.666.0
+1 -1
View File
@@ -11,5 +11,5 @@
| `tool_calls` | List[[components.ChatMessageToolCall](../components/chatmessagetoolcall.md)] | :heavy_minus_sign: | N/A | | `tool_calls` | List[[components.ChatMessageToolCall](../components/chatmessagetoolcall.md)] | :heavy_minus_sign: | N/A |
| `refusal` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `refusal` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
| `reasoning` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `reasoning` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
| `reasoning_details` | List[[components.Schema19](../components/schema19.md)] | :heavy_minus_sign: | N/A | | `reasoning_details` | List[[components.Schema20](../components/schema20.md)] | :heavy_minus_sign: | N/A |
| `images` | List[[components.Image](../components/image.md)] | :heavy_minus_sign: | N/A | | `images` | List[[components.Image](../components/image.md)] | :heavy_minus_sign: | N/A |
+1
View File
@@ -10,6 +10,7 @@
| `route` | [OptionalNullable[components.Route]](../components/route.md) | :heavy_minus_sign: | N/A | | `route` | [OptionalNullable[components.Route]](../components/route.md) | :heavy_minus_sign: | N/A |
| `user` | *Optional[str]* | :heavy_minus_sign: | N/A | | `user` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `session_id` | *Optional[str]* | :heavy_minus_sign: | N/A | | `session_id` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `trace` | [Optional[components.Schema19]](../components/schema19.md) | :heavy_minus_sign: | N/A |
| `messages` | List[[components.Message](../components/message.md)] | :heavy_check_mark: | N/A | | `messages` | List[[components.Message](../components/message.md)] | :heavy_check_mark: | N/A |
| `model` | *Optional[str]* | :heavy_minus_sign: | N/A | | `model` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `models` | List[*str*] | :heavy_minus_sign: | N/A | | `models` | List[*str*] | :heavy_minus_sign: | N/A |
+1 -1
View File
@@ -10,4 +10,4 @@
| `reasoning` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `reasoning` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
| `refusal` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `refusal` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
| `tool_calls` | List[[components.ChatStreamingMessageToolCall](../components/chatstreamingmessagetoolcall.md)] | :heavy_minus_sign: | N/A | | `tool_calls` | List[[components.ChatStreamingMessageToolCall](../components/chatstreamingmessagetoolcall.md)] | :heavy_minus_sign: | N/A |
| `reasoning_details` | List[[components.Schema19](../components/schema19.md)] | :heavy_minus_sign: | N/A | | `reasoning_details` | List[[components.Schema20](../components/schema20.md)] | :heavy_minus_sign: | N/A |
+2 -1
View File
@@ -40,4 +40,5 @@ Request schema for Responses endpoint
| `provider` | [OptionalNullable[components.Provider]](../components/provider.md) | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | | | `provider` | [OptionalNullable[components.Provider]](../components/provider.md) | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | |
| `plugins` | List[[components.Plugin](../components/plugin.md)] | :heavy_minus_sign: | Plugins you want to enable for this request, including their settings. | | | `plugins` | List[[components.Plugin](../components/plugin.md)] | :heavy_minus_sign: | Plugins you want to enable for this request, including their settings. | |
| `user` | *Optional[str]* | :heavy_minus_sign: | A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters. | | | `user` | *Optional[str]* | :heavy_minus_sign: | A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters. | |
| `session_id` | *Optional[str]* | :heavy_minus_sign: | A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters. | | | `session_id` | *Optional[str]* | :heavy_minus_sign: | A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters. | |
| `trace` | [Optional[components.Trace]](../components/trace.md) | :heavy_minus_sign: | Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. | |
+9 -19
View File
@@ -1,23 +1,13 @@
# Schema19 # Schema19
## Supported Types ## Fields
### `components.Schema19ReasoningSummary`
```python
value: components.Schema19ReasoningSummary = /* values here */
```
### `components.Schema19ReasoningEncrypted`
```python
value: components.Schema19ReasoningEncrypted = /* values here */
```
### `components.Schema19ReasoningText`
```python
value: components.Schema19ReasoningText = /* values here */
```
| Field | Type | Required | Description |
| -------------------- | -------------------- | -------------------- | -------------------- |
| `trace_id` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `trace_name` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `span_name` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `generation_name` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `parent_span_id` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A |
+23
View File
@@ -0,0 +1,23 @@
# Schema20
## Supported Types
### `components.Schema20ReasoningSummary`
```python
value: components.Schema20ReasoningSummary = /* values here */
```
### `components.Schema20ReasoningEncrypted`
```python
value: components.Schema20ReasoningEncrypted = /* values here */
```
### `components.Schema20ReasoningText`
```python
value: components.Schema20ReasoningText = /* values here */
```
@@ -1,4 +1,4 @@
# Schema19ReasoningEncrypted # Schema20ReasoningEncrypted
## Fields ## Fields
@@ -8,5 +8,5 @@
| `type` | *Literal["reasoning.encrypted"]* | :heavy_check_mark: | N/A | | `type` | *Literal["reasoning.encrypted"]* | :heavy_check_mark: | N/A |
| `data` | *str* | :heavy_check_mark: | N/A | | `data` | *str* | :heavy_check_mark: | N/A |
| `id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
| `format_` | [OptionalNullable[components.Schema21]](../components/schema21.md) | :heavy_minus_sign: | N/A | | `format_` | [OptionalNullable[components.Schema22]](../components/schema22.md) | :heavy_minus_sign: | N/A |
| `index` | *Optional[float]* | :heavy_minus_sign: | N/A | | `index` | *Optional[float]* | :heavy_minus_sign: | N/A |
@@ -1,4 +1,4 @@
# Schema19ReasoningSummary # Schema20ReasoningSummary
## Fields ## Fields
@@ -8,5 +8,5 @@
| `type` | *Literal["reasoning.summary"]* | :heavy_check_mark: | N/A | | `type` | *Literal["reasoning.summary"]* | :heavy_check_mark: | N/A |
| `summary` | *str* | :heavy_check_mark: | N/A | | `summary` | *str* | :heavy_check_mark: | N/A |
| `id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
| `format_` | [OptionalNullable[components.Schema21]](../components/schema21.md) | :heavy_minus_sign: | N/A | | `format_` | [OptionalNullable[components.Schema22]](../components/schema22.md) | :heavy_minus_sign: | N/A |
| `index` | *Optional[float]* | :heavy_minus_sign: | N/A | | `index` | *Optional[float]* | :heavy_minus_sign: | N/A |
@@ -1,4 +1,4 @@
# Schema19ReasoningText # Schema20ReasoningText
## Fields ## Fields
@@ -9,5 +9,5 @@
| `text` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `text` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
| `signature` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `signature` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
| `id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
| `format_` | [OptionalNullable[components.Schema21]](../components/schema21.md) | :heavy_minus_sign: | N/A | | `format_` | [OptionalNullable[components.Schema22]](../components/schema22.md) | :heavy_minus_sign: | N/A |
| `index` | *Optional[float]* | :heavy_minus_sign: | N/A | | `index` | *Optional[float]* | :heavy_minus_sign: | N/A |
@@ -1,4 +1,4 @@
# Schema21 # Schema22
## Values ## Values
+15
View File
@@ -0,0 +1,15 @@
# Trace
Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations.
## Fields
| Field | Type | Required | Description |
| -------------------------- | -------------------------- | -------------------------- | -------------------------- |
| `trace_id` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `trace_name` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `span_name` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `generation_name` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `parent_span_id` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `__pydantic_extra__` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A |
+1
View File
@@ -46,6 +46,7 @@ with OpenRouter(
| `route` | [OptionalNullable[components.Route]](../../components/route.md) | :heavy_minus_sign: | N/A | | `route` | [OptionalNullable[components.Route]](../../components/route.md) | :heavy_minus_sign: | N/A |
| `user` | *Optional[str]* | :heavy_minus_sign: | N/A | | `user` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `session_id` | *Optional[str]* | :heavy_minus_sign: | N/A | | `session_id` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `trace` | [Optional[components.Schema19]](../../components/schema19.md) | :heavy_minus_sign: | N/A |
| `model` | *Optional[str]* | :heavy_minus_sign: | N/A | | `model` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `models` | List[*str*] | :heavy_minus_sign: | N/A | | `models` | List[*str*] | :heavy_minus_sign: | N/A |
| `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | | `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
+1
View File
@@ -75,6 +75,7 @@ with OpenRouter(
| `plugins` | List[[components.Plugin](../../components/plugin.md)] | :heavy_minus_sign: | Plugins you want to enable for this request, including their settings. | | | `plugins` | List[[components.Plugin](../../components/plugin.md)] | :heavy_minus_sign: | Plugins you want to enable for this request, including their settings. | |
| `user` | *Optional[str]* | :heavy_minus_sign: | A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters. | | | `user` | *Optional[str]* | :heavy_minus_sign: | A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters. | |
| `session_id` | *Optional[str]* | :heavy_minus_sign: | A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters. | | | `session_id` | *Optional[str]* | :heavy_minus_sign: | A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters. | |
| `trace` | [Optional[components.Trace]](../../components/trace.md) | :heavy_minus_sign: | Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. | |
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
### Response ### Response
+1 -1
View File
@@ -1,6 +1,6 @@
[project] [project]
name = "openrouter" name = "openrouter"
version = "0.6.0" version = "0.7.0"
description = "Official Python Client SDK for OpenRouter." description = "Official Python Client SDK for OpenRouter."
authors = [{ name = "OpenRouter" },] authors = [{ name = "OpenRouter" },]
readme = "README-PYPI.md" readme = "README-PYPI.md"
+2 -2
View File
@@ -3,10 +3,10 @@
import importlib.metadata import importlib.metadata
__title__: str = "openrouter" __title__: str = "openrouter"
__version__: str = "0.6.0" __version__: str = "0.7.0"
__openapi_doc_version__: str = "1.0.0" __openapi_doc_version__: str = "1.0.0"
__gen_version__: str = "2.768.0" __gen_version__: str = "2.768.0"
__user_agent__: str = "speakeasy-sdk/python 0.6.0 2.768.0 1.0.0 openrouter" __user_agent__: str = "speakeasy-sdk/python 0.7.0 2.768.0 1.0.0 openrouter"
try: try:
if __package__ is not None: if __package__ is not None:
+26
View File
@@ -32,6 +32,9 @@ class Chat(BaseSDK):
route: OptionalNullable[components.Route] = UNSET, route: OptionalNullable[components.Route] = UNSET,
user: Optional[str] = None, user: Optional[str] = None,
session_id: Optional[str] = None, session_id: Optional[str] = None,
trace: Optional[
Union[components.Schema19, components.Schema19TypedDict]
] = None,
model: Optional[str] = None, model: Optional[str] = None,
models: Optional[List[str]] = None, models: Optional[List[str]] = None,
frequency_penalty: OptionalNullable[float] = UNSET, frequency_penalty: OptionalNullable[float] = UNSET,
@@ -93,6 +96,7 @@ class Chat(BaseSDK):
:param route: :param route:
:param user: :param user:
:param session_id: :param session_id:
:param trace:
:param model: :param model:
:param models: :param models:
:param frequency_penalty: :param frequency_penalty:
@@ -139,6 +143,9 @@ class Chat(BaseSDK):
route: OptionalNullable[components.Route] = UNSET, route: OptionalNullable[components.Route] = UNSET,
user: Optional[str] = None, user: Optional[str] = None,
session_id: Optional[str] = None, session_id: Optional[str] = None,
trace: Optional[
Union[components.Schema19, components.Schema19TypedDict]
] = None,
model: Optional[str] = None, model: Optional[str] = None,
models: Optional[List[str]] = None, models: Optional[List[str]] = None,
frequency_penalty: OptionalNullable[float] = UNSET, frequency_penalty: OptionalNullable[float] = UNSET,
@@ -200,6 +207,7 @@ class Chat(BaseSDK):
:param route: :param route:
:param user: :param user:
:param session_id: :param session_id:
:param trace:
:param model: :param model:
:param models: :param models:
:param frequency_penalty: :param frequency_penalty:
@@ -245,6 +253,9 @@ class Chat(BaseSDK):
route: OptionalNullable[components.Route] = UNSET, route: OptionalNullable[components.Route] = UNSET,
user: Optional[str] = None, user: Optional[str] = None,
session_id: Optional[str] = None, session_id: Optional[str] = None,
trace: Optional[
Union[components.Schema19, components.Schema19TypedDict]
] = None,
model: Optional[str] = None, model: Optional[str] = None,
models: Optional[List[str]] = None, models: Optional[List[str]] = None,
frequency_penalty: OptionalNullable[float] = UNSET, frequency_penalty: OptionalNullable[float] = UNSET,
@@ -306,6 +317,7 @@ class Chat(BaseSDK):
:param route: :param route:
:param user: :param user:
:param session_id: :param session_id:
:param trace:
:param model: :param model:
:param models: :param models:
:param frequency_penalty: :param frequency_penalty:
@@ -358,6 +370,7 @@ class Chat(BaseSDK):
route=route, route=route,
user=user, user=user,
session_id=session_id, session_id=session_id,
trace=utils.get_pydantic_model(trace, Optional[components.Schema19]),
messages=utils.get_pydantic_model(messages, List[components.Message]), messages=utils.get_pydantic_model(messages, List[components.Message]),
model=model, model=model,
models=models, models=models,
@@ -504,6 +517,9 @@ class Chat(BaseSDK):
route: OptionalNullable[components.Route] = UNSET, route: OptionalNullable[components.Route] = UNSET,
user: Optional[str] = None, user: Optional[str] = None,
session_id: Optional[str] = None, session_id: Optional[str] = None,
trace: Optional[
Union[components.Schema19, components.Schema19TypedDict]
] = None,
model: Optional[str] = None, model: Optional[str] = None,
models: Optional[List[str]] = None, models: Optional[List[str]] = None,
frequency_penalty: OptionalNullable[float] = UNSET, frequency_penalty: OptionalNullable[float] = UNSET,
@@ -565,6 +581,7 @@ class Chat(BaseSDK):
:param route: :param route:
:param user: :param user:
:param session_id: :param session_id:
:param trace:
:param model: :param model:
:param models: :param models:
:param frequency_penalty: :param frequency_penalty:
@@ -611,6 +628,9 @@ class Chat(BaseSDK):
route: OptionalNullable[components.Route] = UNSET, route: OptionalNullable[components.Route] = UNSET,
user: Optional[str] = None, user: Optional[str] = None,
session_id: Optional[str] = None, session_id: Optional[str] = None,
trace: Optional[
Union[components.Schema19, components.Schema19TypedDict]
] = None,
model: Optional[str] = None, model: Optional[str] = None,
models: Optional[List[str]] = None, models: Optional[List[str]] = None,
frequency_penalty: OptionalNullable[float] = UNSET, frequency_penalty: OptionalNullable[float] = UNSET,
@@ -672,6 +692,7 @@ class Chat(BaseSDK):
:param route: :param route:
:param user: :param user:
:param session_id: :param session_id:
:param trace:
:param model: :param model:
:param models: :param models:
:param frequency_penalty: :param frequency_penalty:
@@ -717,6 +738,9 @@ class Chat(BaseSDK):
route: OptionalNullable[components.Route] = UNSET, route: OptionalNullable[components.Route] = UNSET,
user: Optional[str] = None, user: Optional[str] = None,
session_id: Optional[str] = None, session_id: Optional[str] = None,
trace: Optional[
Union[components.Schema19, components.Schema19TypedDict]
] = None,
model: Optional[str] = None, model: Optional[str] = None,
models: Optional[List[str]] = None, models: Optional[List[str]] = None,
frequency_penalty: OptionalNullable[float] = UNSET, frequency_penalty: OptionalNullable[float] = UNSET,
@@ -778,6 +802,7 @@ class Chat(BaseSDK):
:param route: :param route:
:param user: :param user:
:param session_id: :param session_id:
:param trace:
:param model: :param model:
:param models: :param models:
:param frequency_penalty: :param frequency_penalty:
@@ -830,6 +855,7 @@ class Chat(BaseSDK):
route=route, route=route,
user=user, user=user,
session_id=session_id, session_id=session_id,
trace=utils.get_pydantic_model(trace, Optional[components.Schema19]),
messages=utils.get_pydantic_model(messages, List[components.Message]), messages=utils.get_pydantic_model(messages, List[components.Message]),
model=model, model=model,
models=models, models=models,
+35 -24
View File
@@ -33,16 +33,17 @@ if TYPE_CHECKING:
Schema17Web, Schema17Web,
Schema17WebTypedDict, Schema17WebTypedDict,
) )
from ._schema19 import ( from ._schema19 import Schema19, Schema19TypedDict
Schema19, from ._schema20 import (
Schema19ReasoningEncrypted, Schema20,
Schema19ReasoningEncryptedTypedDict, Schema20ReasoningEncrypted,
Schema19ReasoningSummary, Schema20ReasoningEncryptedTypedDict,
Schema19ReasoningSummaryTypedDict, Schema20ReasoningSummary,
Schema19ReasoningText, Schema20ReasoningSummaryTypedDict,
Schema19ReasoningTextTypedDict, Schema20ReasoningText,
Schema19TypedDict, Schema20ReasoningTextTypedDict,
Schema21, Schema20TypedDict,
Schema22,
) )
from ._schema5 import Schema5, Schema5Enum, Schema5TypedDict from ._schema5 import Schema5, Schema5Enum, Schema5TypedDict
from .activityitem import ActivityItem, ActivityItemTypedDict from .activityitem import ActivityItem, ActivityItemTypedDict
@@ -496,6 +497,8 @@ if TYPE_CHECKING:
Provider, Provider,
ProviderTypedDict, ProviderTypedDict,
ServiceTier, ServiceTier,
Trace,
TraceTypedDict,
Truncation, Truncation,
) )
from .openresponsesresponsetext import ( from .openresponsesresponsetext import (
@@ -1499,14 +1502,16 @@ __all__ = [
"Schema17Web", "Schema17Web",
"Schema17WebTypedDict", "Schema17WebTypedDict",
"Schema19", "Schema19",
"Schema19ReasoningEncrypted",
"Schema19ReasoningEncryptedTypedDict",
"Schema19ReasoningSummary",
"Schema19ReasoningSummaryTypedDict",
"Schema19ReasoningText",
"Schema19ReasoningTextTypedDict",
"Schema19TypedDict", "Schema19TypedDict",
"Schema21", "Schema20",
"Schema20ReasoningEncrypted",
"Schema20ReasoningEncryptedTypedDict",
"Schema20ReasoningSummary",
"Schema20ReasoningSummaryTypedDict",
"Schema20ReasoningText",
"Schema20ReasoningTextTypedDict",
"Schema20TypedDict",
"Schema22",
"Schema3", "Schema3",
"Schema5", "Schema5",
"Schema5Enum", "Schema5Enum",
@@ -1539,6 +1544,8 @@ __all__ = [
"ToolResponseMessageTypedDict", "ToolResponseMessageTypedDict",
"TopProviderInfo", "TopProviderInfo",
"TopProviderInfoTypedDict", "TopProviderInfoTypedDict",
"Trace",
"TraceTypedDict",
"Truncation", "Truncation",
"Type", "Type",
"TypeResponseCompleted", "TypeResponseCompleted",
@@ -1609,14 +1616,16 @@ _dynamic_imports: dict[str, str] = {
"Schema17Web": "._schema17", "Schema17Web": "._schema17",
"Schema17WebTypedDict": "._schema17", "Schema17WebTypedDict": "._schema17",
"Schema19": "._schema19", "Schema19": "._schema19",
"Schema19ReasoningEncrypted": "._schema19",
"Schema19ReasoningEncryptedTypedDict": "._schema19",
"Schema19ReasoningSummary": "._schema19",
"Schema19ReasoningSummaryTypedDict": "._schema19",
"Schema19ReasoningText": "._schema19",
"Schema19ReasoningTextTypedDict": "._schema19",
"Schema19TypedDict": "._schema19", "Schema19TypedDict": "._schema19",
"Schema21": "._schema19", "Schema20": "._schema20",
"Schema20ReasoningEncrypted": "._schema20",
"Schema20ReasoningEncryptedTypedDict": "._schema20",
"Schema20ReasoningSummary": "._schema20",
"Schema20ReasoningSummaryTypedDict": "._schema20",
"Schema20ReasoningText": "._schema20",
"Schema20ReasoningTextTypedDict": "._schema20",
"Schema20TypedDict": "._schema20",
"Schema22": "._schema20",
"Schema5": "._schema5", "Schema5": "._schema5",
"Schema5Enum": "._schema5", "Schema5Enum": "._schema5",
"Schema5TypedDict": "._schema5", "Schema5TypedDict": "._schema5",
@@ -1981,6 +1990,8 @@ _dynamic_imports: dict[str, str] = {
"Provider": ".openresponsesrequest", "Provider": ".openresponsesrequest",
"ProviderTypedDict": ".openresponsesrequest", "ProviderTypedDict": ".openresponsesrequest",
"ServiceTier": ".openresponsesrequest", "ServiceTier": ".openresponsesrequest",
"Trace": ".openresponsesrequest",
"TraceTypedDict": ".openresponsesrequest",
"Truncation": ".openresponsesrequest", "Truncation": ".openresponsesrequest",
"OpenResponsesResponseText": ".openresponsesresponsetext", "OpenResponsesResponseText": ".openresponsesresponsetext",
"OpenResponsesResponseTextTypedDict": ".openresponsesresponsetext", "OpenResponsesResponseTextTypedDict": ".openresponsesresponsetext",
+26 -220
View File
@@ -1,235 +1,41 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations from __future__ import annotations
from openrouter.types import ( from openrouter.types import BaseModel
BaseModel,
Nullable,
OptionalNullable,
UNSET,
UNSET_SENTINEL,
UnrecognizedStr,
)
from openrouter.utils import get_discriminator, validate_const, validate_open_enum
import pydantic import pydantic
from pydantic import Discriminator, Tag, model_serializer from pydantic import ConfigDict
from pydantic.functional_validators import AfterValidator, PlainValidator from typing import Any, Dict, Optional
from typing import Literal, Optional, Union from typing_extensions import NotRequired, TypedDict
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
Schema21 = Union[ class Schema19TypedDict(TypedDict):
Literal[ trace_id: NotRequired[str]
"unknown", trace_name: NotRequired[str]
"openai-responses-v1", span_name: NotRequired[str]
"azure-openai-responses-v1", generation_name: NotRequired[str]
"xai-responses-v1", parent_span_id: NotRequired[str]
"anthropic-claude-v1",
"google-gemini-v1",
],
UnrecognizedStr,
]
class Schema19ReasoningTextTypedDict(TypedDict): class Schema19(BaseModel):
type: Literal["reasoning.text"] model_config = ConfigDict(
text: NotRequired[Nullable[str]] populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
signature: NotRequired[Nullable[str]] )
id: NotRequired[Nullable[str]] __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False)
format_: NotRequired[Nullable[Schema21]]
index: NotRequired[float]
trace_id: Optional[str] = None
class Schema19ReasoningText(BaseModel): trace_name: Optional[str] = None
TYPE: Annotated[
Annotated[
Literal["reasoning.text"], AfterValidator(validate_const("reasoning.text"))
],
pydantic.Field(alias="type"),
] = "reasoning.text"
text: OptionalNullable[str] = UNSET span_name: Optional[str] = None
signature: OptionalNullable[str] = UNSET generation_name: Optional[str] = None
id: OptionalNullable[str] = UNSET parent_span_id: Optional[str] = None
format_: Annotated[ @property
Annotated[ def additional_properties(self):
OptionalNullable[Schema21], PlainValidator(validate_open_enum(False)) return self.__pydantic_extra__
],
pydantic.Field(alias="format"),
] = UNSET
index: Optional[float] = None @additional_properties.setter
def additional_properties(self, value):
@model_serializer(mode="wrap") self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
def serialize_model(self, handler):
optional_fields = ["text", "signature", "id", "format", "index"]
nullable_fields = ["text", "signature", "id", "format"]
null_default_fields = []
serialized = handler(self)
m = {}
for n, f in type(self).model_fields.items():
k = f.alias or n
val = serialized.get(k)
serialized.pop(k, None)
optional_nullable = k in optional_fields and k in nullable_fields
is_set = (
self.__pydantic_fields_set__.intersection({n})
or k in null_default_fields
) # pylint: disable=no-member
if val is not None and val != UNSET_SENTINEL:
m[k] = val
elif val != UNSET_SENTINEL and (
not k in optional_fields or (optional_nullable and is_set)
):
m[k] = val
return m
class Schema19ReasoningEncryptedTypedDict(TypedDict):
data: str
type: Literal["reasoning.encrypted"]
id: NotRequired[Nullable[str]]
format_: NotRequired[Nullable[Schema21]]
index: NotRequired[float]
class Schema19ReasoningEncrypted(BaseModel):
data: str
TYPE: Annotated[
Annotated[
Literal["reasoning.encrypted"],
AfterValidator(validate_const("reasoning.encrypted")),
],
pydantic.Field(alias="type"),
] = "reasoning.encrypted"
id: OptionalNullable[str] = UNSET
format_: Annotated[
Annotated[
OptionalNullable[Schema21], PlainValidator(validate_open_enum(False))
],
pydantic.Field(alias="format"),
] = UNSET
index: Optional[float] = None
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = ["id", "format", "index"]
nullable_fields = ["id", "format"]
null_default_fields = []
serialized = handler(self)
m = {}
for n, f in type(self).model_fields.items():
k = f.alias or n
val = serialized.get(k)
serialized.pop(k, None)
optional_nullable = k in optional_fields and k in nullable_fields
is_set = (
self.__pydantic_fields_set__.intersection({n})
or k in null_default_fields
) # pylint: disable=no-member
if val is not None and val != UNSET_SENTINEL:
m[k] = val
elif val != UNSET_SENTINEL and (
not k in optional_fields or (optional_nullable and is_set)
):
m[k] = val
return m
class Schema19ReasoningSummaryTypedDict(TypedDict):
summary: str
type: Literal["reasoning.summary"]
id: NotRequired[Nullable[str]]
format_: NotRequired[Nullable[Schema21]]
index: NotRequired[float]
class Schema19ReasoningSummary(BaseModel):
summary: str
TYPE: Annotated[
Annotated[
Literal["reasoning.summary"],
AfterValidator(validate_const("reasoning.summary")),
],
pydantic.Field(alias="type"),
] = "reasoning.summary"
id: OptionalNullable[str] = UNSET
format_: Annotated[
Annotated[
OptionalNullable[Schema21], PlainValidator(validate_open_enum(False))
],
pydantic.Field(alias="format"),
] = UNSET
index: Optional[float] = None
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = ["id", "format", "index"]
nullable_fields = ["id", "format"]
null_default_fields = []
serialized = handler(self)
m = {}
for n, f in type(self).model_fields.items():
k = f.alias or n
val = serialized.get(k)
serialized.pop(k, None)
optional_nullable = k in optional_fields and k in nullable_fields
is_set = (
self.__pydantic_fields_set__.intersection({n})
or k in null_default_fields
) # pylint: disable=no-member
if val is not None and val != UNSET_SENTINEL:
m[k] = val
elif val != UNSET_SENTINEL and (
not k in optional_fields or (optional_nullable and is_set)
):
m[k] = val
return m
Schema19TypedDict = TypeAliasType(
"Schema19TypedDict",
Union[
Schema19ReasoningSummaryTypedDict,
Schema19ReasoningEncryptedTypedDict,
Schema19ReasoningTextTypedDict,
],
)
Schema19 = Annotated[
Union[
Annotated[Schema19ReasoningSummary, Tag("reasoning.summary")],
Annotated[Schema19ReasoningEncrypted, Tag("reasoning.encrypted")],
Annotated[Schema19ReasoningText, Tag("reasoning.text")],
],
Discriminator(lambda m: get_discriminator(m, "type", "type")),
]
+235
View File
@@ -0,0 +1,235 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from openrouter.types import (
BaseModel,
Nullable,
OptionalNullable,
UNSET,
UNSET_SENTINEL,
UnrecognizedStr,
)
from openrouter.utils import get_discriminator, validate_const, validate_open_enum
import pydantic
from pydantic import Discriminator, Tag, model_serializer
from pydantic.functional_validators import AfterValidator, PlainValidator
from typing import Literal, Optional, Union
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
Schema22 = Union[
Literal[
"unknown",
"openai-responses-v1",
"azure-openai-responses-v1",
"xai-responses-v1",
"anthropic-claude-v1",
"google-gemini-v1",
],
UnrecognizedStr,
]
class Schema20ReasoningTextTypedDict(TypedDict):
type: Literal["reasoning.text"]
text: NotRequired[Nullable[str]]
signature: NotRequired[Nullable[str]]
id: NotRequired[Nullable[str]]
format_: NotRequired[Nullable[Schema22]]
index: NotRequired[float]
class Schema20ReasoningText(BaseModel):
TYPE: Annotated[
Annotated[
Literal["reasoning.text"], AfterValidator(validate_const("reasoning.text"))
],
pydantic.Field(alias="type"),
] = "reasoning.text"
text: OptionalNullable[str] = UNSET
signature: OptionalNullable[str] = UNSET
id: OptionalNullable[str] = UNSET
format_: Annotated[
Annotated[
OptionalNullable[Schema22], PlainValidator(validate_open_enum(False))
],
pydantic.Field(alias="format"),
] = UNSET
index: Optional[float] = None
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = ["text", "signature", "id", "format", "index"]
nullable_fields = ["text", "signature", "id", "format"]
null_default_fields = []
serialized = handler(self)
m = {}
for n, f in type(self).model_fields.items():
k = f.alias or n
val = serialized.get(k)
serialized.pop(k, None)
optional_nullable = k in optional_fields and k in nullable_fields
is_set = (
self.__pydantic_fields_set__.intersection({n})
or k in null_default_fields
) # pylint: disable=no-member
if val is not None and val != UNSET_SENTINEL:
m[k] = val
elif val != UNSET_SENTINEL and (
not k in optional_fields or (optional_nullable and is_set)
):
m[k] = val
return m
class Schema20ReasoningEncryptedTypedDict(TypedDict):
data: str
type: Literal["reasoning.encrypted"]
id: NotRequired[Nullable[str]]
format_: NotRequired[Nullable[Schema22]]
index: NotRequired[float]
class Schema20ReasoningEncrypted(BaseModel):
data: str
TYPE: Annotated[
Annotated[
Literal["reasoning.encrypted"],
AfterValidator(validate_const("reasoning.encrypted")),
],
pydantic.Field(alias="type"),
] = "reasoning.encrypted"
id: OptionalNullable[str] = UNSET
format_: Annotated[
Annotated[
OptionalNullable[Schema22], PlainValidator(validate_open_enum(False))
],
pydantic.Field(alias="format"),
] = UNSET
index: Optional[float] = None
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = ["id", "format", "index"]
nullable_fields = ["id", "format"]
null_default_fields = []
serialized = handler(self)
m = {}
for n, f in type(self).model_fields.items():
k = f.alias or n
val = serialized.get(k)
serialized.pop(k, None)
optional_nullable = k in optional_fields and k in nullable_fields
is_set = (
self.__pydantic_fields_set__.intersection({n})
or k in null_default_fields
) # pylint: disable=no-member
if val is not None and val != UNSET_SENTINEL:
m[k] = val
elif val != UNSET_SENTINEL and (
not k in optional_fields or (optional_nullable and is_set)
):
m[k] = val
return m
class Schema20ReasoningSummaryTypedDict(TypedDict):
summary: str
type: Literal["reasoning.summary"]
id: NotRequired[Nullable[str]]
format_: NotRequired[Nullable[Schema22]]
index: NotRequired[float]
class Schema20ReasoningSummary(BaseModel):
summary: str
TYPE: Annotated[
Annotated[
Literal["reasoning.summary"],
AfterValidator(validate_const("reasoning.summary")),
],
pydantic.Field(alias="type"),
] = "reasoning.summary"
id: OptionalNullable[str] = UNSET
format_: Annotated[
Annotated[
OptionalNullable[Schema22], PlainValidator(validate_open_enum(False))
],
pydantic.Field(alias="format"),
] = UNSET
index: Optional[float] = None
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = ["id", "format", "index"]
nullable_fields = ["id", "format"]
null_default_fields = []
serialized = handler(self)
m = {}
for n, f in type(self).model_fields.items():
k = f.alias or n
val = serialized.get(k)
serialized.pop(k, None)
optional_nullable = k in optional_fields and k in nullable_fields
is_set = (
self.__pydantic_fields_set__.intersection({n})
or k in null_default_fields
) # pylint: disable=no-member
if val is not None and val != UNSET_SENTINEL:
m[k] = val
elif val != UNSET_SENTINEL and (
not k in optional_fields or (optional_nullable and is_set)
):
m[k] = val
return m
Schema20TypedDict = TypeAliasType(
"Schema20TypedDict",
Union[
Schema20ReasoningSummaryTypedDict,
Schema20ReasoningEncryptedTypedDict,
Schema20ReasoningTextTypedDict,
],
)
Schema20 = Annotated[
Union[
Annotated[Schema20ReasoningSummary, Tag("reasoning.summary")],
Annotated[Schema20ReasoningEncrypted, Tag("reasoning.encrypted")],
Annotated[Schema20ReasoningText, Tag("reasoning.text")],
],
Discriminator(lambda m: get_discriminator(m, "type", "type")),
]
@@ -1,7 +1,7 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations from __future__ import annotations
from ._schema19 import Schema19, Schema19TypedDict from ._schema20 import Schema20, Schema20TypedDict
from .chatmessagecontentitem import ( from .chatmessagecontentitem import (
ChatMessageContentItem, ChatMessageContentItem,
ChatMessageContentItemTypedDict, ChatMessageContentItemTypedDict,
@@ -56,7 +56,7 @@ class AssistantMessageTypedDict(TypedDict):
tool_calls: NotRequired[List[ChatMessageToolCallTypedDict]] tool_calls: NotRequired[List[ChatMessageToolCallTypedDict]]
refusal: NotRequired[Nullable[str]] refusal: NotRequired[Nullable[str]]
reasoning: NotRequired[Nullable[str]] reasoning: NotRequired[Nullable[str]]
reasoning_details: NotRequired[List[Schema19TypedDict]] reasoning_details: NotRequired[List[Schema20TypedDict]]
images: NotRequired[List[ImageTypedDict]] images: NotRequired[List[ImageTypedDict]]
@@ -76,7 +76,7 @@ class AssistantMessage(BaseModel):
reasoning: OptionalNullable[str] = UNSET reasoning: OptionalNullable[str] = UNSET
reasoning_details: Optional[List[Schema19]] = None reasoning_details: Optional[List[Schema20]] = None
images: Optional[List[Image]] = None images: Optional[List[Image]] = None
@@ -3,6 +3,7 @@
from __future__ import annotations from __future__ import annotations
from ._schema10 import Schema10, Schema10TypedDict from ._schema10 import Schema10, Schema10TypedDict
from ._schema17 import Schema17, Schema17TypedDict from ._schema17 import Schema17, Schema17TypedDict
from ._schema19 import Schema19, Schema19TypedDict
from ._schema5 import Schema5, Schema5TypedDict from ._schema5 import Schema5, Schema5TypedDict
from .chatstreamoptions import ChatStreamOptions, ChatStreamOptionsTypedDict from .chatstreamoptions import ChatStreamOptions, ChatStreamOptionsTypedDict
from .message import Message, MessageTypedDict from .message import Message, MessageTypedDict
@@ -385,6 +386,7 @@ class ChatGenerationParamsTypedDict(TypedDict):
route: NotRequired[Nullable[Route]] route: NotRequired[Nullable[Route]]
user: NotRequired[str] user: NotRequired[str]
session_id: NotRequired[str] session_id: NotRequired[str]
trace: NotRequired[Schema19TypedDict]
model: NotRequired[str] model: NotRequired[str]
models: NotRequired[List[str]] models: NotRequired[List[str]]
frequency_penalty: NotRequired[Nullable[float]] frequency_penalty: NotRequired[Nullable[float]]
@@ -425,6 +427,8 @@ class ChatGenerationParams(BaseModel):
session_id: Optional[str] = None session_id: Optional[str] = None
trace: Optional[Schema19] = None
model: Optional[str] = None model: Optional[str] = None
models: Optional[List[str]] = None models: Optional[List[str]] = None
@@ -481,6 +485,7 @@ class ChatGenerationParams(BaseModel):
"route", "route",
"user", "user",
"session_id", "session_id",
"trace",
"model", "model",
"models", "models",
"frequency_penalty", "frequency_penalty",
@@ -1,7 +1,7 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations from __future__ import annotations
from ._schema19 import Schema19, Schema19TypedDict from ._schema20 import Schema20, Schema20TypedDict
from .chatstreamingmessagetoolcall import ( from .chatstreamingmessagetoolcall import (
ChatStreamingMessageToolCall, ChatStreamingMessageToolCall,
ChatStreamingMessageToolCallTypedDict, ChatStreamingMessageToolCallTypedDict,
@@ -27,7 +27,7 @@ class ChatStreamingMessageChunkTypedDict(TypedDict):
reasoning: NotRequired[Nullable[str]] reasoning: NotRequired[Nullable[str]]
refusal: NotRequired[Nullable[str]] refusal: NotRequired[Nullable[str]]
tool_calls: NotRequired[List[ChatStreamingMessageToolCallTypedDict]] tool_calls: NotRequired[List[ChatStreamingMessageToolCallTypedDict]]
reasoning_details: NotRequired[List[Schema19TypedDict]] reasoning_details: NotRequired[List[Schema20TypedDict]]
class ChatStreamingMessageChunk(BaseModel): class ChatStreamingMessageChunk(BaseModel):
@@ -41,7 +41,7 @@ class ChatStreamingMessageChunk(BaseModel):
tool_calls: Optional[List[ChatStreamingMessageToolCall]] = None tool_calls: Optional[List[ChatStreamingMessageToolCall]] = None
reasoning_details: Optional[List[Schema19]] = None reasoning_details: Optional[List[Schema20]] = None
@model_serializer(mode="wrap") @model_serializer(mode="wrap")
def serialize_model(self, handler): def serialize_model(self, handler):
@@ -55,7 +55,7 @@ from openrouter.types import (
) )
from openrouter.utils import get_discriminator, validate_const, validate_open_enum from openrouter.utils import get_discriminator, validate_const, validate_open_enum
import pydantic import pydantic
from pydantic import Discriminator, Tag, model_serializer from pydantic import ConfigDict, Discriminator, Tag, model_serializer
from pydantic.functional_validators import AfterValidator, PlainValidator from pydantic.functional_validators import AfterValidator, PlainValidator
from typing import Any, Dict, List, Literal, Optional, Union from typing import Any, Dict, List, Literal, Optional, Union
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
@@ -517,6 +517,43 @@ Plugin = Annotated[
] ]
class TraceTypedDict(TypedDict):
r"""Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations."""
trace_id: NotRequired[str]
trace_name: NotRequired[str]
span_name: NotRequired[str]
generation_name: NotRequired[str]
parent_span_id: NotRequired[str]
class Trace(BaseModel):
r"""Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations."""
model_config = ConfigDict(
populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
)
__pydantic_extra__: Dict[str, Nullable[Any]] = pydantic.Field(init=False)
trace_id: Optional[str] = None
trace_name: Optional[str] = None
span_name: Optional[str] = None
generation_name: Optional[str] = None
parent_span_id: Optional[str] = None
@property
def additional_properties(self):
return self.__pydantic_extra__
@additional_properties.setter
def additional_properties(self, value):
self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
class OpenResponsesRequestTypedDict(TypedDict): class OpenResponsesRequestTypedDict(TypedDict):
r"""Request schema for Responses endpoint""" r"""Request schema for Responses endpoint"""
@@ -564,6 +601,8 @@ class OpenResponsesRequestTypedDict(TypedDict):
r"""A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters.""" r"""A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters."""
session_id: NotRequired[str] session_id: NotRequired[str]
r"""A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters.""" r"""A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters."""
trace: NotRequired[TraceTypedDict]
r"""Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations."""
class OpenResponsesRequest(BaseModel): class OpenResponsesRequest(BaseModel):
@@ -664,6 +703,9 @@ class OpenResponsesRequest(BaseModel):
session_id: Optional[str] = None session_id: Optional[str] = None
r"""A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters.""" r"""A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters."""
trace: Optional[Trace] = None
r"""Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations."""
@model_serializer(mode="wrap") @model_serializer(mode="wrap")
def serialize_model(self, handler): def serialize_model(self, handler):
optional_fields = [ optional_fields = [
@@ -701,6 +743,7 @@ class OpenResponsesRequest(BaseModel):
"plugins", "plugins",
"user", "user",
"session_id", "session_id",
"trace",
] ]
nullable_fields = [ nullable_fields = [
"instructions", "instructions",
+14
View File
@@ -93,6 +93,7 @@ class Responses(BaseSDK):
] = None, ] = None,
user: Optional[str] = None, user: Optional[str] = None,
session_id: Optional[str] = None, session_id: Optional[str] = None,
trace: Optional[Union[components.Trace, components.TraceTypedDict]] = None,
retries: OptionalNullable[utils.RetryConfig] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None, server_url: Optional[str] = None,
timeout_ms: Optional[int] = None, timeout_ms: Optional[int] = None,
@@ -140,6 +141,7 @@ class Responses(BaseSDK):
:param plugins: Plugins you want to enable for this request, including their settings. :param plugins: Plugins you want to enable for this request, including their settings.
:param user: A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters. :param user: A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters.
:param session_id: A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters. :param session_id: A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters.
:param trace: Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations.
:param retries: Override the default retry configuration for this method :param retries: Override the default retry configuration for this method
:param server_url: Override the default server URL for this method :param server_url: Override the default server URL for this method
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -222,6 +224,7 @@ class Responses(BaseSDK):
] = None, ] = None,
user: Optional[str] = None, user: Optional[str] = None,
session_id: Optional[str] = None, session_id: Optional[str] = None,
trace: Optional[Union[components.Trace, components.TraceTypedDict]] = None,
retries: OptionalNullable[utils.RetryConfig] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None, server_url: Optional[str] = None,
timeout_ms: Optional[int] = None, timeout_ms: Optional[int] = None,
@@ -269,6 +272,7 @@ class Responses(BaseSDK):
:param plugins: Plugins you want to enable for this request, including their settings. :param plugins: Plugins you want to enable for this request, including their settings.
:param user: A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters. :param user: A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters.
:param session_id: A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters. :param session_id: A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters.
:param trace: Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations.
:param retries: Override the default retry configuration for this method :param retries: Override the default retry configuration for this method
:param server_url: Override the default server URL for this method :param server_url: Override the default server URL for this method
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -350,6 +354,7 @@ class Responses(BaseSDK):
] = None, ] = None,
user: Optional[str] = None, user: Optional[str] = None,
session_id: Optional[str] = None, session_id: Optional[str] = None,
trace: Optional[Union[components.Trace, components.TraceTypedDict]] = None,
retries: OptionalNullable[utils.RetryConfig] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None, server_url: Optional[str] = None,
timeout_ms: Optional[int] = None, timeout_ms: Optional[int] = None,
@@ -397,6 +402,7 @@ class Responses(BaseSDK):
:param plugins: Plugins you want to enable for this request, including their settings. :param plugins: Plugins you want to enable for this request, including their settings.
:param user: A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters. :param user: A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters.
:param session_id: A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters. :param session_id: A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters.
:param trace: Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations.
:param retries: Override the default retry configuration for this method :param retries: Override the default retry configuration for this method
:param server_url: Override the default server URL for this method :param server_url: Override the default server URL for this method
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -466,6 +472,7 @@ class Responses(BaseSDK):
), ),
user=user, user=user,
session_id=session_id, session_id=session_id,
trace=utils.get_pydantic_model(trace, Optional[components.Trace]),
), ),
) )
@@ -741,6 +748,7 @@ class Responses(BaseSDK):
] = None, ] = None,
user: Optional[str] = None, user: Optional[str] = None,
session_id: Optional[str] = None, session_id: Optional[str] = None,
trace: Optional[Union[components.Trace, components.TraceTypedDict]] = None,
retries: OptionalNullable[utils.RetryConfig] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None, server_url: Optional[str] = None,
timeout_ms: Optional[int] = None, timeout_ms: Optional[int] = None,
@@ -788,6 +796,7 @@ class Responses(BaseSDK):
:param plugins: Plugins you want to enable for this request, including their settings. :param plugins: Plugins you want to enable for this request, including their settings.
:param user: A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters. :param user: A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters.
:param session_id: A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters. :param session_id: A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters.
:param trace: Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations.
:param retries: Override the default retry configuration for this method :param retries: Override the default retry configuration for this method
:param server_url: Override the default server URL for this method :param server_url: Override the default server URL for this method
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -870,6 +879,7 @@ class Responses(BaseSDK):
] = None, ] = None,
user: Optional[str] = None, user: Optional[str] = None,
session_id: Optional[str] = None, session_id: Optional[str] = None,
trace: Optional[Union[components.Trace, components.TraceTypedDict]] = None,
retries: OptionalNullable[utils.RetryConfig] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None, server_url: Optional[str] = None,
timeout_ms: Optional[int] = None, timeout_ms: Optional[int] = None,
@@ -917,6 +927,7 @@ class Responses(BaseSDK):
:param plugins: Plugins you want to enable for this request, including their settings. :param plugins: Plugins you want to enable for this request, including their settings.
:param user: A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters. :param user: A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters.
:param session_id: A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters. :param session_id: A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters.
:param trace: Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations.
:param retries: Override the default retry configuration for this method :param retries: Override the default retry configuration for this method
:param server_url: Override the default server URL for this method :param server_url: Override the default server URL for this method
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -998,6 +1009,7 @@ class Responses(BaseSDK):
] = None, ] = None,
user: Optional[str] = None, user: Optional[str] = None,
session_id: Optional[str] = None, session_id: Optional[str] = None,
trace: Optional[Union[components.Trace, components.TraceTypedDict]] = None,
retries: OptionalNullable[utils.RetryConfig] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None, server_url: Optional[str] = None,
timeout_ms: Optional[int] = None, timeout_ms: Optional[int] = None,
@@ -1045,6 +1057,7 @@ class Responses(BaseSDK):
:param plugins: Plugins you want to enable for this request, including their settings. :param plugins: Plugins you want to enable for this request, including their settings.
:param user: A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters. :param user: A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters.
:param session_id: A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters. :param session_id: A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters.
:param trace: Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations.
:param retries: Override the default retry configuration for this method :param retries: Override the default retry configuration for this method
:param server_url: Override the default server URL for this method :param server_url: Override the default server URL for this method
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -1114,6 +1127,7 @@ class Responses(BaseSDK):
), ),
user=user, user=user,
session_id=session_id, session_id=session_id,
trace=utils.get_pydantic_model(trace, Optional[components.Trace]),
), ),
) )