mirror of
https://github.com/wassname/openrouter-python-sdk-retry-errors.git
synced 2026-08-01 12:40:23 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9774c726fd | ||
|
|
3a40848aab |
+22
-11
@@ -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: 7419f3b58a64f08efb375ead9e169446
|
docChecksum: 331e8a1f7c97c6a4a6b57eaddc80fc39
|
||||||
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.0.17
|
releaseVersion: 0.0.18
|
||||||
configChecksum: 50ef18bf69272fc09c257e3562e1b0df
|
configChecksum: 1f58284fadb5b2b9029e9ef747f2a7e9
|
||||||
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
|
||||||
@@ -91,6 +91,7 @@ generatedFiles:
|
|||||||
- docs/components/chatmessagecontentitemvideovideourl.md
|
- docs/components/chatmessagecontentitemvideovideourl.md
|
||||||
- docs/components/chatmessagetokenlogprob.md
|
- docs/components/chatmessagetokenlogprob.md
|
||||||
- docs/components/chatmessagetokenlogprobs.md
|
- docs/components/chatmessagetokenlogprobs.md
|
||||||
|
- docs/components/chatmessagetokenlogprobtoplogprob.md
|
||||||
- docs/components/chatmessagetoolcall.md
|
- docs/components/chatmessagetoolcall.md
|
||||||
- docs/components/chatmessagetoolcallfunction.md
|
- docs/components/chatmessagetoolcallfunction.md
|
||||||
- docs/components/chatresponse.md
|
- docs/components/chatresponse.md
|
||||||
@@ -145,6 +146,7 @@ generatedFiles:
|
|||||||
- docs/components/internalserverresponseerrordata.md
|
- docs/components/internalserverresponseerrordata.md
|
||||||
- docs/components/jsonschemaconfig.md
|
- docs/components/jsonschemaconfig.md
|
||||||
- docs/components/listendpointsresponse.md
|
- docs/components/listendpointsresponse.md
|
||||||
|
- docs/components/logprob.md
|
||||||
- docs/components/message.md
|
- docs/components/message.md
|
||||||
- docs/components/messagecontent.md
|
- docs/components/messagecontent.md
|
||||||
- docs/components/messagedeveloper.md
|
- docs/components/messagedeveloper.md
|
||||||
@@ -203,14 +205,17 @@ generatedFiles:
|
|||||||
- docs/components/openairesponsestoolchoiceunion.md
|
- docs/components/openairesponsestoolchoiceunion.md
|
||||||
- docs/components/openairesponsestruncation.md
|
- docs/components/openairesponsestruncation.md
|
||||||
- docs/components/openresponseseasyinputmessage.md
|
- docs/components/openresponseseasyinputmessage.md
|
||||||
- docs/components/openresponseseasyinputmessagecontent1.md
|
- docs/components/openresponseseasyinputmessagecontentinputimage.md
|
||||||
- docs/components/openresponseseasyinputmessagecontent2.md
|
- docs/components/openresponseseasyinputmessagecontenttype.md
|
||||||
|
- docs/components/openresponseseasyinputmessagecontentunion1.md
|
||||||
|
- docs/components/openresponseseasyinputmessagecontentunion2.md
|
||||||
|
- docs/components/openresponseseasyinputmessagedetail.md
|
||||||
- docs/components/openresponseseasyinputmessageroleassistant.md
|
- docs/components/openresponseseasyinputmessageroleassistant.md
|
||||||
- docs/components/openresponseseasyinputmessageroledeveloper.md
|
- docs/components/openresponseseasyinputmessageroledeveloper.md
|
||||||
- docs/components/openresponseseasyinputmessagerolesystem.md
|
- docs/components/openresponseseasyinputmessagerolesystem.md
|
||||||
- docs/components/openresponseseasyinputmessageroleunion.md
|
- docs/components/openresponseseasyinputmessageroleunion.md
|
||||||
- docs/components/openresponseseasyinputmessageroleuser.md
|
- docs/components/openresponseseasyinputmessageroleuser.md
|
||||||
- docs/components/openresponseseasyinputmessagetype.md
|
- docs/components/openresponseseasyinputmessagetypemessage.md
|
||||||
- docs/components/openresponseserrorevent.md
|
- docs/components/openresponseserrorevent.md
|
||||||
- docs/components/openresponseserroreventtype.md
|
- docs/components/openresponseserroreventtype.md
|
||||||
- docs/components/openresponsesfunctioncalloutput.md
|
- docs/components/openresponsesfunctioncalloutput.md
|
||||||
@@ -228,12 +233,15 @@ generatedFiles:
|
|||||||
- docs/components/openresponsesinput.md
|
- docs/components/openresponsesinput.md
|
||||||
- docs/components/openresponsesinput1.md
|
- docs/components/openresponsesinput1.md
|
||||||
- docs/components/openresponsesinputmessageitem.md
|
- docs/components/openresponsesinputmessageitem.md
|
||||||
- docs/components/openresponsesinputmessageitemcontent.md
|
- docs/components/openresponsesinputmessageitemcontentinputimage.md
|
||||||
|
- docs/components/openresponsesinputmessageitemcontenttype.md
|
||||||
|
- docs/components/openresponsesinputmessageitemcontentunion.md
|
||||||
|
- docs/components/openresponsesinputmessageitemdetail.md
|
||||||
- docs/components/openresponsesinputmessageitemroledeveloper.md
|
- docs/components/openresponsesinputmessageitemroledeveloper.md
|
||||||
- docs/components/openresponsesinputmessageitemrolesystem.md
|
- docs/components/openresponsesinputmessageitemrolesystem.md
|
||||||
- docs/components/openresponsesinputmessageitemroleunion.md
|
- docs/components/openresponsesinputmessageitemroleunion.md
|
||||||
- docs/components/openresponsesinputmessageitemroleuser.md
|
- docs/components/openresponsesinputmessageitemroleuser.md
|
||||||
- docs/components/openresponsesinputmessageitemtype.md
|
- docs/components/openresponsesinputmessageitemtypemessage.md
|
||||||
- docs/components/openresponseslogprobs.md
|
- docs/components/openresponseslogprobs.md
|
||||||
- docs/components/openresponsesnonstreamingresponse.md
|
- docs/components/openresponsesnonstreamingresponse.md
|
||||||
- docs/components/openresponsesnonstreamingresponsetoolfunction.md
|
- docs/components/openresponsesnonstreamingresponsetoolfunction.md
|
||||||
@@ -380,7 +388,10 @@ generatedFiles:
|
|||||||
- docs/components/responseinputimagetype.md
|
- docs/components/responseinputimagetype.md
|
||||||
- docs/components/responseinputtext.md
|
- docs/components/responseinputtext.md
|
||||||
- docs/components/responseinputtexttype.md
|
- docs/components/responseinputtexttype.md
|
||||||
|
- docs/components/responseinputvideo.md
|
||||||
|
- docs/components/responseinputvideotype.md
|
||||||
- docs/components/responseoutputtext.md
|
- docs/components/responseoutputtext.md
|
||||||
|
- docs/components/responseoutputtexttoplogprob.md
|
||||||
- docs/components/responseoutputtexttype.md
|
- docs/components/responseoutputtexttype.md
|
||||||
- docs/components/responseserrorfield.md
|
- docs/components/responseserrorfield.md
|
||||||
- docs/components/responsesformatjsonobject.md
|
- docs/components/responsesformatjsonobject.md
|
||||||
@@ -445,7 +456,6 @@ generatedFiles:
|
|||||||
- docs/components/toolresponsemessage.md
|
- docs/components/toolresponsemessage.md
|
||||||
- docs/components/toolresponsemessagecontent.md
|
- docs/components/toolresponsemessagecontent.md
|
||||||
- docs/components/toomanyrequestsresponseerrordata.md
|
- docs/components/toomanyrequestsresponseerrordata.md
|
||||||
- docs/components/toplogprob.md
|
|
||||||
- docs/components/topproviderinfo.md
|
- docs/components/topproviderinfo.md
|
||||||
- docs/components/truncation.md
|
- docs/components/truncation.md
|
||||||
- docs/components/ttl.md
|
- docs/components/ttl.md
|
||||||
@@ -727,6 +737,7 @@ generatedFiles:
|
|||||||
- src/openrouter/components/responseinputfile.py
|
- src/openrouter/components/responseinputfile.py
|
||||||
- src/openrouter/components/responseinputimage.py
|
- src/openrouter/components/responseinputimage.py
|
||||||
- src/openrouter/components/responseinputtext.py
|
- src/openrouter/components/responseinputtext.py
|
||||||
|
- src/openrouter/components/responseinputvideo.py
|
||||||
- src/openrouter/components/responseoutputtext.py
|
- src/openrouter/components/responseoutputtext.py
|
||||||
- src/openrouter/components/responseserrorfield.py
|
- src/openrouter/components/responseserrorfield.py
|
||||||
- src/openrouter/components/responsesformatjsonobject.py
|
- src/openrouter/components/responsesformatjsonobject.py
|
||||||
@@ -842,7 +853,7 @@ examples:
|
|||||||
application/json: {"store": false, "service_tier": "auto", "stream": false}
|
application/json: {"store": false, "service_tier": "auto", "stream": false}
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
application/json: {"id": "resp-abc123", "object": "response", "created_at": 1704067200, "model": "gpt-4", "output": [{"id": "msg-abc123", "role": "assistant", "type": "message", "content": [{"type": "output_text", "text": "Hello! How can I help you today?"}]}], "error": null, "incomplete_details": null, "temperature": null, "top_p": null, "instructions": null, "metadata": null, "tools": [], "tool_choice": "auto", "parallel_tool_calls": true}
|
application/json: {"id": "resp-abc123", "object": "response", "created_at": 1704067200, "model": "gpt-4", "status": "completed", "completed_at": 2510.63, "output": [{"id": "msg-abc123", "role": "assistant", "type": "message", "content": [{"type": "output_text", "text": "Hello! How can I help you today?"}]}], "error": null, "incomplete_details": null, "temperature": null, "top_p": null, "presence_penalty": 7468.94, "frequency_penalty": 3967.09, "instructions": null, "metadata": null, "tools": [], "tool_choice": "auto", "parallel_tool_calls": true}
|
||||||
"400":
|
"400":
|
||||||
application/json: {"error": {"code": 400, "message": "Invalid request parameters"}}
|
application/json: {"error": {"code": 400, "message": "Invalid request parameters"}}
|
||||||
"401":
|
"401":
|
||||||
@@ -955,7 +966,7 @@ examples:
|
|||||||
id: "<id>"
|
id: "<id>"
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
application/json: {"data": {"id": "gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG", "upstream_id": "chatcmpl-791bcf62-080e-4568-87d0-94c72e3b4946", "total_cost": 0.0015, "cache_discount": 0.0002, "upstream_inference_cost": 0.0012, "created_at": "2024-07-15T23:33:19.433273+00:00", "model": "sao10k/l3-stheno-8b", "app_id": 12345, "streamed": true, "cancelled": false, "provider_name": "Infermatic", "latency": 1250, "moderation_latency": 50, "generation_time": 1200, "finish_reason": "stop", "tokens_prompt": 10, "tokens_completion": 25, "native_tokens_prompt": 10, "native_tokens_completion": 25, "native_tokens_completion_images": 0, "native_tokens_reasoning": 5, "native_tokens_cached": 3, "num_media_prompt": 1, "num_input_audio_prompt": 0, "num_media_completion": 0, "num_search_results": 5, "origin": "https://openrouter.ai/", "usage": 0.0015, "is_byok": false, "native_finish_reason": "stop", "external_user": "user-123", "api_type": "completions"}}
|
application/json: {"data": {"id": "gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG", "upstream_id": "chatcmpl-791bcf62-080e-4568-87d0-94c72e3b4946", "total_cost": 0.0015, "cache_discount": 0.0002, "upstream_inference_cost": 0.0012, "created_at": "2024-07-15T23:33:19.433273+00:00", "model": "sao10k/l3-stheno-8b", "app_id": 12345, "streamed": true, "cancelled": false, "provider_name": "Infermatic", "latency": 1250, "moderation_latency": 50, "generation_time": 1200, "finish_reason": "stop", "tokens_prompt": 10, "tokens_completion": 25, "native_tokens_prompt": 10, "native_tokens_completion": 25, "native_tokens_completion_images": 0, "native_tokens_reasoning": 5, "native_tokens_cached": 3, "num_media_prompt": 1, "num_input_audio_prompt": 0, "num_media_completion": 0, "num_search_results": 5, "origin": "https://openrouter.ai/", "usage": 0.0015, "is_byok": false, "native_finish_reason": "stop", "external_user": "user-123", "api_type": "completions", "router": "openrouter/auto"}}
|
||||||
"401":
|
"401":
|
||||||
application/json: {"error": {"code": 401, "message": "Missing Authentication header"}}
|
application/json: {"error": {"code": 401, "message": "Missing Authentication header"}}
|
||||||
"402":
|
"402":
|
||||||
|
|||||||
+1
-1
@@ -31,7 +31,7 @@ generation:
|
|||||||
skipResponseBodyAssertions: false
|
skipResponseBodyAssertions: false
|
||||||
preApplyUnionDiscriminators: true
|
preApplyUnionDiscriminators: true
|
||||||
python:
|
python:
|
||||||
version: 0.0.17
|
version: 0.0.18
|
||||||
additionalDependencies:
|
additionalDependencies:
|
||||||
dev: {}
|
dev: {}
|
||||||
main: {}
|
main: {}
|
||||||
|
|||||||
+110
-16
@@ -108,6 +108,41 @@ components:
|
|||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
$ref: '#/components/schemas/OpenAIResponsesAnnotation'
|
$ref: '#/components/schemas/OpenAIResponsesAnnotation'
|
||||||
|
logprobs:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
token:
|
||||||
|
type: string
|
||||||
|
bytes:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: number
|
||||||
|
logprob:
|
||||||
|
type: number
|
||||||
|
top_logprobs:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
token:
|
||||||
|
type: string
|
||||||
|
bytes:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: number
|
||||||
|
logprob:
|
||||||
|
type: number
|
||||||
|
required:
|
||||||
|
- token
|
||||||
|
- bytes
|
||||||
|
- logprob
|
||||||
|
required:
|
||||||
|
- token
|
||||||
|
- bytes
|
||||||
|
- logprob
|
||||||
|
- top_logprobs
|
||||||
required:
|
required:
|
||||||
- type
|
- type
|
||||||
- text
|
- text
|
||||||
@@ -557,6 +592,7 @@ components:
|
|||||||
allOf:
|
allOf:
|
||||||
- $ref: '#/components/schemas/OpenAIResponsesUsage'
|
- $ref: '#/components/schemas/OpenAIResponsesUsage'
|
||||||
- type: object
|
- type: object
|
||||||
|
nullable: true
|
||||||
properties:
|
properties:
|
||||||
cost:
|
cost:
|
||||||
type: number
|
type: number
|
||||||
@@ -1208,6 +1244,9 @@ components:
|
|||||||
type: string
|
type: string
|
||||||
status:
|
status:
|
||||||
$ref: '#/components/schemas/OpenAIResponsesResponseStatus'
|
$ref: '#/components/schemas/OpenAIResponsesResponseStatus'
|
||||||
|
completed_at:
|
||||||
|
type: number
|
||||||
|
nullable: true
|
||||||
output:
|
output:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
@@ -1258,6 +1297,12 @@ components:
|
|||||||
top_p:
|
top_p:
|
||||||
type: number
|
type: number
|
||||||
nullable: true
|
nullable: true
|
||||||
|
presence_penalty:
|
||||||
|
type: number
|
||||||
|
nullable: true
|
||||||
|
frequency_penalty:
|
||||||
|
type: number
|
||||||
|
nullable: true
|
||||||
instructions:
|
instructions:
|
||||||
$ref: '#/components/schemas/OpenAIResponsesInput'
|
$ref: '#/components/schemas/OpenAIResponsesInput'
|
||||||
metadata:
|
metadata:
|
||||||
@@ -1319,11 +1364,15 @@ components:
|
|||||||
- object
|
- object
|
||||||
- created_at
|
- created_at
|
||||||
- model
|
- model
|
||||||
|
- status
|
||||||
|
- completed_at
|
||||||
- output
|
- output
|
||||||
- error
|
- error
|
||||||
- incomplete_details
|
- incomplete_details
|
||||||
- temperature
|
- temperature
|
||||||
- top_p
|
- top_p
|
||||||
|
- presence_penalty
|
||||||
|
- frequency_penalty
|
||||||
- instructions
|
- instructions
|
||||||
- metadata
|
- metadata
|
||||||
- tools
|
- tools
|
||||||
@@ -3254,6 +3303,23 @@ components:
|
|||||||
- type: summary_text
|
- type: summary_text
|
||||||
text: Step by step analysis
|
text: Step by step analysis
|
||||||
description: Reasoning output item with signature and format extensions
|
description: Reasoning output item with signature and format extensions
|
||||||
|
ResponseInputVideo:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- input_video
|
||||||
|
video_url:
|
||||||
|
type: string
|
||||||
|
description: A base64 data URL or remote URL that resolves to a video file
|
||||||
|
required:
|
||||||
|
- type
|
||||||
|
- video_url
|
||||||
|
description: Video input content item
|
||||||
|
example:
|
||||||
|
type: input_video
|
||||||
|
video_url: https://example.com/video.mp4
|
||||||
OpenResponsesEasyInputMessage:
|
OpenResponsesEasyInputMessage:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
@@ -3281,16 +3347,18 @@ components:
|
|||||||
items:
|
items:
|
||||||
oneOf:
|
oneOf:
|
||||||
- $ref: '#/components/schemas/ResponseInputText'
|
- $ref: '#/components/schemas/ResponseInputText'
|
||||||
- $ref: '#/components/schemas/ResponseInputImage'
|
- allOf:
|
||||||
|
- $ref: '#/components/schemas/ResponseInputImage'
|
||||||
|
- type: object
|
||||||
|
properties: {}
|
||||||
|
description: Image input content item
|
||||||
|
example:
|
||||||
|
type: input_image
|
||||||
|
detail: auto
|
||||||
|
image_url: https://example.com/image.jpg
|
||||||
- $ref: '#/components/schemas/ResponseInputFile'
|
- $ref: '#/components/schemas/ResponseInputFile'
|
||||||
- $ref: '#/components/schemas/ResponseInputAudio'
|
- $ref: '#/components/schemas/ResponseInputAudio'
|
||||||
discriminator:
|
- $ref: '#/components/schemas/ResponseInputVideo'
|
||||||
propertyName: type
|
|
||||||
mapping:
|
|
||||||
input_text: '#/components/schemas/ResponseInputText'
|
|
||||||
input_image: '#/components/schemas/ResponseInputImage'
|
|
||||||
input_file: '#/components/schemas/ResponseInputFile'
|
|
||||||
input_audio: '#/components/schemas/ResponseInputAudio'
|
|
||||||
- type: string
|
- type: string
|
||||||
required:
|
required:
|
||||||
- role
|
- role
|
||||||
@@ -3320,16 +3388,18 @@ components:
|
|||||||
items:
|
items:
|
||||||
oneOf:
|
oneOf:
|
||||||
- $ref: '#/components/schemas/ResponseInputText'
|
- $ref: '#/components/schemas/ResponseInputText'
|
||||||
- $ref: '#/components/schemas/ResponseInputImage'
|
- allOf:
|
||||||
|
- $ref: '#/components/schemas/ResponseInputImage'
|
||||||
|
- type: object
|
||||||
|
properties: {}
|
||||||
|
description: Image input content item
|
||||||
|
example:
|
||||||
|
type: input_image
|
||||||
|
detail: auto
|
||||||
|
image_url: https://example.com/image.jpg
|
||||||
- $ref: '#/components/schemas/ResponseInputFile'
|
- $ref: '#/components/schemas/ResponseInputFile'
|
||||||
- $ref: '#/components/schemas/ResponseInputAudio'
|
- $ref: '#/components/schemas/ResponseInputAudio'
|
||||||
discriminator:
|
- $ref: '#/components/schemas/ResponseInputVideo'
|
||||||
propertyName: type
|
|
||||||
mapping:
|
|
||||||
input_text: '#/components/schemas/ResponseInputText'
|
|
||||||
input_image: '#/components/schemas/ResponseInputImage'
|
|
||||||
input_file: '#/components/schemas/ResponseInputFile'
|
|
||||||
input_audio: '#/components/schemas/ResponseInputAudio'
|
|
||||||
required:
|
required:
|
||||||
- role
|
- role
|
||||||
- content
|
- content
|
||||||
@@ -3731,6 +3801,24 @@ components:
|
|||||||
type: number
|
type: number
|
||||||
nullable: true
|
nullable: true
|
||||||
minimum: 0
|
minimum: 0
|
||||||
|
top_logprobs:
|
||||||
|
type: integer
|
||||||
|
nullable: true
|
||||||
|
minimum: 0
|
||||||
|
maximum: 20
|
||||||
|
max_tool_calls:
|
||||||
|
type: integer
|
||||||
|
nullable: true
|
||||||
|
presence_penalty:
|
||||||
|
type: number
|
||||||
|
nullable: true
|
||||||
|
minimum: -2
|
||||||
|
maximum: 2
|
||||||
|
frequency_penalty:
|
||||||
|
type: number
|
||||||
|
nullable: true
|
||||||
|
minimum: -2
|
||||||
|
maximum: 2
|
||||||
top_k:
|
top_k:
|
||||||
type: number
|
type: number
|
||||||
image_config:
|
image_config:
|
||||||
@@ -7198,6 +7286,11 @@ paths:
|
|||||||
- completions
|
- completions
|
||||||
- embeddings
|
- embeddings
|
||||||
description: Type of API used for the generation
|
description: Type of API used for the generation
|
||||||
|
router:
|
||||||
|
type: string
|
||||||
|
nullable: true
|
||||||
|
description: Router used for the request (e.g., openrouter/auto)
|
||||||
|
example: openrouter/auto
|
||||||
required:
|
required:
|
||||||
- id
|
- id
|
||||||
- upstream_id
|
- upstream_id
|
||||||
@@ -7231,6 +7324,7 @@ paths:
|
|||||||
- native_finish_reason
|
- native_finish_reason
|
||||||
- external_user
|
- external_user
|
||||||
- api_type
|
- api_type
|
||||||
|
- router
|
||||||
description: Generation data
|
description: Generation data
|
||||||
required:
|
required:
|
||||||
- data
|
- data
|
||||||
|
|||||||
+110
-16
@@ -109,6 +109,41 @@ components:
|
|||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
$ref: '#/components/schemas/OpenAIResponsesAnnotation'
|
$ref: '#/components/schemas/OpenAIResponsesAnnotation'
|
||||||
|
logprobs:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
token:
|
||||||
|
type: string
|
||||||
|
bytes:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: number
|
||||||
|
logprob:
|
||||||
|
type: number
|
||||||
|
top_logprobs:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
token:
|
||||||
|
type: string
|
||||||
|
bytes:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: number
|
||||||
|
logprob:
|
||||||
|
type: number
|
||||||
|
required:
|
||||||
|
- token
|
||||||
|
- bytes
|
||||||
|
- logprob
|
||||||
|
required:
|
||||||
|
- token
|
||||||
|
- bytes
|
||||||
|
- logprob
|
||||||
|
- top_logprobs
|
||||||
required:
|
required:
|
||||||
- type
|
- type
|
||||||
- text
|
- text
|
||||||
@@ -563,6 +598,7 @@ components:
|
|||||||
allOf:
|
allOf:
|
||||||
- $ref: '#/components/schemas/OpenAIResponsesUsage'
|
- $ref: '#/components/schemas/OpenAIResponsesUsage'
|
||||||
- type: object
|
- type: object
|
||||||
|
nullable: true
|
||||||
properties:
|
properties:
|
||||||
cost:
|
cost:
|
||||||
type: number
|
type: number
|
||||||
@@ -1223,6 +1259,9 @@ components:
|
|||||||
type: string
|
type: string
|
||||||
status:
|
status:
|
||||||
$ref: '#/components/schemas/OpenAIResponsesResponseStatus'
|
$ref: '#/components/schemas/OpenAIResponsesResponseStatus'
|
||||||
|
completed_at:
|
||||||
|
type: number
|
||||||
|
nullable: true
|
||||||
output:
|
output:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
@@ -1273,6 +1312,12 @@ components:
|
|||||||
top_p:
|
top_p:
|
||||||
type: number
|
type: number
|
||||||
nullable: true
|
nullable: true
|
||||||
|
presence_penalty:
|
||||||
|
type: number
|
||||||
|
nullable: true
|
||||||
|
frequency_penalty:
|
||||||
|
type: number
|
||||||
|
nullable: true
|
||||||
instructions:
|
instructions:
|
||||||
$ref: '#/components/schemas/OpenAIResponsesInput'
|
$ref: '#/components/schemas/OpenAIResponsesInput'
|
||||||
metadata:
|
metadata:
|
||||||
@@ -1335,11 +1380,15 @@ components:
|
|||||||
- object
|
- object
|
||||||
- created_at
|
- created_at
|
||||||
- model
|
- model
|
||||||
|
- status
|
||||||
|
- completed_at
|
||||||
- output
|
- output
|
||||||
- error
|
- error
|
||||||
- incomplete_details
|
- incomplete_details
|
||||||
- temperature
|
- temperature
|
||||||
- top_p
|
- top_p
|
||||||
|
- presence_penalty
|
||||||
|
- frequency_penalty
|
||||||
- instructions
|
- instructions
|
||||||
- metadata
|
- metadata
|
||||||
- tools
|
- tools
|
||||||
@@ -3271,6 +3320,23 @@ components:
|
|||||||
- type: summary_text
|
- type: summary_text
|
||||||
text: Step by step analysis
|
text: Step by step analysis
|
||||||
description: Reasoning output item with signature and format extensions
|
description: Reasoning output item with signature and format extensions
|
||||||
|
ResponseInputVideo:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- input_video
|
||||||
|
video_url:
|
||||||
|
type: string
|
||||||
|
description: A base64 data URL or remote URL that resolves to a video file
|
||||||
|
required:
|
||||||
|
- type
|
||||||
|
- video_url
|
||||||
|
description: Video input content item
|
||||||
|
example:
|
||||||
|
type: input_video
|
||||||
|
video_url: https://example.com/video.mp4
|
||||||
OpenResponsesEasyInputMessage:
|
OpenResponsesEasyInputMessage:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
@@ -3298,16 +3364,18 @@ components:
|
|||||||
items:
|
items:
|
||||||
oneOf:
|
oneOf:
|
||||||
- $ref: '#/components/schemas/ResponseInputText'
|
- $ref: '#/components/schemas/ResponseInputText'
|
||||||
- $ref: '#/components/schemas/ResponseInputImage'
|
- allOf:
|
||||||
|
- $ref: '#/components/schemas/ResponseInputImage'
|
||||||
|
- type: object
|
||||||
|
properties: {}
|
||||||
|
description: Image input content item
|
||||||
|
example:
|
||||||
|
type: input_image
|
||||||
|
detail: auto
|
||||||
|
image_url: https://example.com/image.jpg
|
||||||
- $ref: '#/components/schemas/ResponseInputFile'
|
- $ref: '#/components/schemas/ResponseInputFile'
|
||||||
- $ref: '#/components/schemas/ResponseInputAudio'
|
- $ref: '#/components/schemas/ResponseInputAudio'
|
||||||
discriminator:
|
- $ref: '#/components/schemas/ResponseInputVideo'
|
||||||
propertyName: type
|
|
||||||
mapping:
|
|
||||||
input_text: '#/components/schemas/ResponseInputText'
|
|
||||||
input_image: '#/components/schemas/ResponseInputImage'
|
|
||||||
input_file: '#/components/schemas/ResponseInputFile'
|
|
||||||
input_audio: '#/components/schemas/ResponseInputAudio'
|
|
||||||
- type: string
|
- type: string
|
||||||
required:
|
required:
|
||||||
- role
|
- role
|
||||||
@@ -3337,16 +3405,18 @@ components:
|
|||||||
items:
|
items:
|
||||||
oneOf:
|
oneOf:
|
||||||
- $ref: '#/components/schemas/ResponseInputText'
|
- $ref: '#/components/schemas/ResponseInputText'
|
||||||
- $ref: '#/components/schemas/ResponseInputImage'
|
- allOf:
|
||||||
|
- $ref: '#/components/schemas/ResponseInputImage'
|
||||||
|
- type: object
|
||||||
|
properties: {}
|
||||||
|
description: Image input content item
|
||||||
|
example:
|
||||||
|
type: input_image
|
||||||
|
detail: auto
|
||||||
|
image_url: https://example.com/image.jpg
|
||||||
- $ref: '#/components/schemas/ResponseInputFile'
|
- $ref: '#/components/schemas/ResponseInputFile'
|
||||||
- $ref: '#/components/schemas/ResponseInputAudio'
|
- $ref: '#/components/schemas/ResponseInputAudio'
|
||||||
discriminator:
|
- $ref: '#/components/schemas/ResponseInputVideo'
|
||||||
propertyName: type
|
|
||||||
mapping:
|
|
||||||
input_text: '#/components/schemas/ResponseInputText'
|
|
||||||
input_image: '#/components/schemas/ResponseInputImage'
|
|
||||||
input_file: '#/components/schemas/ResponseInputFile'
|
|
||||||
input_audio: '#/components/schemas/ResponseInputAudio'
|
|
||||||
required:
|
required:
|
||||||
- role
|
- role
|
||||||
- content
|
- content
|
||||||
@@ -3751,6 +3821,24 @@ components:
|
|||||||
type: number
|
type: number
|
||||||
nullable: true
|
nullable: true
|
||||||
minimum: 0
|
minimum: 0
|
||||||
|
top_logprobs:
|
||||||
|
type: integer
|
||||||
|
nullable: true
|
||||||
|
minimum: 0
|
||||||
|
maximum: 20
|
||||||
|
max_tool_calls:
|
||||||
|
type: integer
|
||||||
|
nullable: true
|
||||||
|
presence_penalty:
|
||||||
|
type: number
|
||||||
|
nullable: true
|
||||||
|
minimum: -2
|
||||||
|
maximum: 2
|
||||||
|
frequency_penalty:
|
||||||
|
type: number
|
||||||
|
nullable: true
|
||||||
|
minimum: -2
|
||||||
|
maximum: 2
|
||||||
top_k:
|
top_k:
|
||||||
type: number
|
type: number
|
||||||
image_config:
|
image_config:
|
||||||
@@ -7195,6 +7283,11 @@ paths:
|
|||||||
- embeddings
|
- embeddings
|
||||||
description: Type of API used for the generation
|
description: Type of API used for the generation
|
||||||
x-speakeasy-unknown-values: allow
|
x-speakeasy-unknown-values: allow
|
||||||
|
router:
|
||||||
|
type: string
|
||||||
|
nullable: true
|
||||||
|
description: Router used for the request (e.g., openrouter/auto)
|
||||||
|
example: openrouter/auto
|
||||||
required:
|
required:
|
||||||
- id
|
- id
|
||||||
- upstream_id
|
- upstream_id
|
||||||
@@ -7228,6 +7321,7 @@ paths:
|
|||||||
- native_finish_reason
|
- native_finish_reason
|
||||||
- external_user
|
- external_user
|
||||||
- api_type
|
- api_type
|
||||||
|
- router
|
||||||
description: Generation data
|
description: Generation data
|
||||||
required:
|
required:
|
||||||
- data
|
- data
|
||||||
|
|||||||
@@ -8,20 +8,19 @@ sources:
|
|||||||
- latest
|
- latest
|
||||||
OpenRouter API:
|
OpenRouter API:
|
||||||
sourceNamespace: open-router-chat-completions-api
|
sourceNamespace: open-router-chat-completions-api
|
||||||
sourceRevisionDigest: sha256:5615c05050362c0944a59e3b5b0437157f9d152faac1509d3c390bbc85e93b1e
|
sourceRevisionDigest: sha256:74aa60ddccc9442b797432138c9ea1577f922ae537a659f129b4102d3a8124d7
|
||||||
sourceBlobDigest: sha256:4f08bbf0b65fd4e617996964ccb1fa33ed7e807f81d8731ba4d00b0a7fd2da98
|
sourceBlobDigest: sha256:c9ae686141914431fb09ce7f0ff685c5b20c19006a92ade6d8686358616f6925
|
||||||
tags:
|
tags:
|
||||||
- latest
|
- latest
|
||||||
- subtree-sync-import-python-sdk
|
|
||||||
- 1.0.0
|
- 1.0.0
|
||||||
targets:
|
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:5615c05050362c0944a59e3b5b0437157f9d152faac1509d3c390bbc85e93b1e
|
sourceRevisionDigest: sha256:74aa60ddccc9442b797432138c9ea1577f922ae537a659f129b4102d3a8124d7
|
||||||
sourceBlobDigest: sha256:4f08bbf0b65fd4e617996964ccb1fa33ed7e807f81d8731ba4d00b0a7fd2da98
|
sourceBlobDigest: sha256:c9ae686141914431fb09ce7f0ff685c5b20c19006a92ade6d8686358616f6925
|
||||||
codeSamplesNamespace: open-router-python-code-samples
|
codeSamplesNamespace: open-router-python-code-samples
|
||||||
codeSamplesRevisionDigest: sha256:c60fe0121ecdbfb79af3a344b52b8daade826fb9648b925f229e5b1d93b5c7ac
|
codeSamplesRevisionDigest: sha256:95a78f7dc072063abfd68a880ad1054c27a9a9077449cbf667d07de13a15112a
|
||||||
workflow:
|
workflow:
|
||||||
workflowVersion: 1.0.0
|
workflowVersion: 1.0.0
|
||||||
speakeasyVersion: 1.666.0
|
speakeasyVersion: 1.666.0
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
| Field | Type | Required | Description |
|
||||||
| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- |
|
| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
|
||||||
| `token` | *str* | :heavy_check_mark: | N/A |
|
| `token` | *str* | :heavy_check_mark: | N/A |
|
||||||
| `logprob` | *float* | :heavy_check_mark: | N/A |
|
| `logprob` | *float* | :heavy_check_mark: | N/A |
|
||||||
| `bytes_` | List[*float*] | :heavy_check_mark: | N/A |
|
| `bytes_` | List[*float*] | :heavy_check_mark: | N/A |
|
||||||
| `top_logprobs` | List[[components.TopLogprob](../components/toplogprob.md)] | :heavy_check_mark: | N/A |
|
| `top_logprobs` | List[[components.ChatMessageTokenLogprobTopLogprob](../components/chatmessagetokenlogprobtoplogprob.md)] | :heavy_check_mark: | N/A |
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
# ChatMessageTokenLogprobTopLogprob
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| ------------------ | ------------------ | ------------------ | ------------------ |
|
||||||
|
| `token` | *str* | :heavy_check_mark: | N/A |
|
||||||
|
| `logprob` | *float* | :heavy_check_mark: | N/A |
|
||||||
|
| `bytes_` | List[*float*] | :heavy_check_mark: | N/A |
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
# Logprob
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
|
||||||
|
| `token` | *str* | :heavy_check_mark: | N/A |
|
||||||
|
| `bytes_` | List[*float*] | :heavy_check_mark: | N/A |
|
||||||
|
| `logprob` | *float* | :heavy_check_mark: | N/A |
|
||||||
|
| `top_logprobs` | List[[components.ResponseOutputTextTopLogprob](../components/responseoutputtexttoplogprob.md)] | :heavy_check_mark: | N/A |
|
||||||
@@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
| Field | Type | Required | Description |
|
||||||
| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |
|
| -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `type` | [Optional[components.OpenResponsesEasyInputMessageType]](../components/openresponseseasyinputmessagetype.md) | :heavy_minus_sign: | N/A |
|
| `type` | [Optional[components.OpenResponsesEasyInputMessageTypeMessage]](../components/openresponseseasyinputmessagetypemessage.md) | :heavy_minus_sign: | N/A |
|
||||||
| `role` | [components.OpenResponsesEasyInputMessageRoleUnion](../components/openresponseseasyinputmessageroleunion.md) | :heavy_check_mark: | N/A |
|
| `role` | [components.OpenResponsesEasyInputMessageRoleUnion](../components/openresponseseasyinputmessageroleunion.md) | :heavy_check_mark: | N/A |
|
||||||
| `content` | [components.OpenResponsesEasyInputMessageContent2](../components/openresponseseasyinputmessagecontent2.md) | :heavy_check_mark: | N/A |
|
| `content` | [components.OpenResponsesEasyInputMessageContentUnion2](../components/openresponseseasyinputmessagecontentunion2.md) | :heavy_check_mark: | N/A |
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
# OpenResponsesEasyInputMessageContent2
|
|
||||||
|
|
||||||
|
|
||||||
## Supported Types
|
|
||||||
|
|
||||||
### `List[components.OpenResponsesEasyInputMessageContent1]`
|
|
||||||
|
|
||||||
```python
|
|
||||||
value: List[components.OpenResponsesEasyInputMessageContent1] = /* values here */
|
|
||||||
```
|
|
||||||
|
|
||||||
### `str`
|
|
||||||
|
|
||||||
```python
|
|
||||||
value: str = /* values here */
|
|
||||||
```
|
|
||||||
|
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# OpenResponsesEasyInputMessageContentInputImage
|
||||||
|
|
||||||
|
Image input content item
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `type` | [components.OpenResponsesEasyInputMessageContentType](../components/openresponseseasyinputmessagecontenttype.md) | :heavy_check_mark: | N/A |
|
||||||
|
| `detail` | [components.OpenResponsesEasyInputMessageDetail](../components/openresponseseasyinputmessagedetail.md) | :heavy_check_mark: | N/A |
|
||||||
|
| `image_url` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# OpenResponsesEasyInputMessageContentType
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ------------- | ------------- |
|
||||||
|
| `INPUT_IMAGE` | input_image |
|
||||||
+9
-3
@@ -1,4 +1,4 @@
|
|||||||
# OpenResponsesInputMessageItemContent
|
# OpenResponsesEasyInputMessageContentUnion1
|
||||||
|
|
||||||
|
|
||||||
## Supported Types
|
## Supported Types
|
||||||
@@ -9,10 +9,10 @@
|
|||||||
value: components.ResponseInputText = /* values here */
|
value: components.ResponseInputText = /* values here */
|
||||||
```
|
```
|
||||||
|
|
||||||
### `components.ResponseInputImage`
|
### `components.OpenResponsesEasyInputMessageContentInputImage`
|
||||||
|
|
||||||
```python
|
```python
|
||||||
value: components.ResponseInputImage = /* values here */
|
value: components.OpenResponsesEasyInputMessageContentInputImage = /* values here */
|
||||||
```
|
```
|
||||||
|
|
||||||
### `components.ResponseInputFile`
|
### `components.ResponseInputFile`
|
||||||
@@ -27,3 +27,9 @@ value: components.ResponseInputFile = /* values here */
|
|||||||
value: components.ResponseInputAudio = /* values here */
|
value: components.ResponseInputAudio = /* values here */
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### `components.ResponseInputVideo`
|
||||||
|
|
||||||
|
```python
|
||||||
|
value: components.ResponseInputVideo = /* values here */
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
# OpenResponsesEasyInputMessageContentUnion2
|
||||||
|
|
||||||
|
|
||||||
|
## Supported Types
|
||||||
|
|
||||||
|
### `List[components.OpenResponsesEasyInputMessageContentUnion1]`
|
||||||
|
|
||||||
|
```python
|
||||||
|
value: List[components.OpenResponsesEasyInputMessageContentUnion1] = /* values here */
|
||||||
|
```
|
||||||
|
|
||||||
|
### `str`
|
||||||
|
|
||||||
|
```python
|
||||||
|
value: str = /* values here */
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
# OpenResponsesEasyInputMessageDetail
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ------ | ------ |
|
||||||
|
| `AUTO` | auto |
|
||||||
|
| `HIGH` | high |
|
||||||
|
| `LOW` | low |
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
# OpenResponsesInputMessageItemType
|
# OpenResponsesEasyInputMessageTypeMessage
|
||||||
|
|
||||||
|
|
||||||
## Values
|
## Values
|
||||||
@@ -3,9 +3,9 @@
|
|||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
| Field | Type | Required | Description |
|
||||||
| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
|
| -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `id` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
| `id` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||||
| `type` | [Optional[components.OpenResponsesInputMessageItemType]](../components/openresponsesinputmessageitemtype.md) | :heavy_minus_sign: | N/A |
|
| `type` | [Optional[components.OpenResponsesInputMessageItemTypeMessage]](../components/openresponsesinputmessageitemtypemessage.md) | :heavy_minus_sign: | N/A |
|
||||||
| `role` | [components.OpenResponsesInputMessageItemRoleUnion](../components/openresponsesinputmessageitemroleunion.md) | :heavy_check_mark: | N/A |
|
| `role` | [components.OpenResponsesInputMessageItemRoleUnion](../components/openresponsesinputmessageitemroleunion.md) | :heavy_check_mark: | N/A |
|
||||||
| `content` | List[[components.OpenResponsesInputMessageItemContent](../components/openresponsesinputmessageitemcontent.md)] | :heavy_check_mark: | N/A |
|
| `content` | List[[components.OpenResponsesInputMessageItemContentUnion](../components/openresponsesinputmessageitemcontentunion.md)] | :heavy_check_mark: | N/A |
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# OpenResponsesInputMessageItemContentInputImage
|
||||||
|
|
||||||
|
Image input content item
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `type` | [components.OpenResponsesInputMessageItemContentType](../components/openresponsesinputmessageitemcontenttype.md) | :heavy_check_mark: | N/A |
|
||||||
|
| `detail` | [components.OpenResponsesInputMessageItemDetail](../components/openresponsesinputmessageitemdetail.md) | :heavy_check_mark: | N/A |
|
||||||
|
| `image_url` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# OpenResponsesInputMessageItemContentType
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ------------- | ------------- |
|
||||||
|
| `INPUT_IMAGE` | input_image |
|
||||||
+9
-3
@@ -1,4 +1,4 @@
|
|||||||
# OpenResponsesEasyInputMessageContent1
|
# OpenResponsesInputMessageItemContentUnion
|
||||||
|
|
||||||
|
|
||||||
## Supported Types
|
## Supported Types
|
||||||
@@ -9,10 +9,10 @@
|
|||||||
value: components.ResponseInputText = /* values here */
|
value: components.ResponseInputText = /* values here */
|
||||||
```
|
```
|
||||||
|
|
||||||
### `components.ResponseInputImage`
|
### `components.OpenResponsesInputMessageItemContentInputImage`
|
||||||
|
|
||||||
```python
|
```python
|
||||||
value: components.ResponseInputImage = /* values here */
|
value: components.OpenResponsesInputMessageItemContentInputImage = /* values here */
|
||||||
```
|
```
|
||||||
|
|
||||||
### `components.ResponseInputFile`
|
### `components.ResponseInputFile`
|
||||||
@@ -27,3 +27,9 @@ value: components.ResponseInputFile = /* values here */
|
|||||||
value: components.ResponseInputAudio = /* values here */
|
value: components.ResponseInputAudio = /* values here */
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### `components.ResponseInputVideo`
|
||||||
|
|
||||||
|
```python
|
||||||
|
value: components.ResponseInputVideo = /* values here */
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
# OpenResponsesInputMessageItemDetail
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ------ | ------ |
|
||||||
|
| `AUTO` | auto |
|
||||||
|
| `HIGH` | high |
|
||||||
|
| `LOW` | low |
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
# OpenResponsesEasyInputMessageType
|
# OpenResponsesInputMessageItemTypeMessage
|
||||||
|
|
||||||
|
|
||||||
## Values
|
## Values
|
||||||
@@ -11,7 +11,8 @@ Complete non-streaming response from the Responses API
|
|||||||
| `object` | [components.Object](../components/object.md) | :heavy_check_mark: | N/A | |
|
| `object` | [components.Object](../components/object.md) | :heavy_check_mark: | N/A | |
|
||||||
| `created_at` | *float* | :heavy_check_mark: | N/A | |
|
| `created_at` | *float* | :heavy_check_mark: | N/A | |
|
||||||
| `model` | *str* | :heavy_check_mark: | N/A | |
|
| `model` | *str* | :heavy_check_mark: | N/A | |
|
||||||
| `status` | [Optional[components.OpenAIResponsesResponseStatus]](../components/openairesponsesresponsestatus.md) | :heavy_minus_sign: | N/A | |
|
| `status` | [components.OpenAIResponsesResponseStatus](../components/openairesponsesresponsestatus.md) | :heavy_check_mark: | N/A | |
|
||||||
|
| `completed_at` | *Nullable[float]* | :heavy_check_mark: | N/A | |
|
||||||
| `output` | List[[components.ResponsesOutputItem](../components/responsesoutputitem.md)] | :heavy_check_mark: | N/A | |
|
| `output` | List[[components.ResponsesOutputItem](../components/responsesoutputitem.md)] | :heavy_check_mark: | N/A | |
|
||||||
| `user` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
|
| `user` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
|
||||||
| `output_text` | *Optional[str]* | :heavy_minus_sign: | N/A | |
|
| `output_text` | *Optional[str]* | :heavy_minus_sign: | N/A | |
|
||||||
@@ -19,12 +20,14 @@ Complete non-streaming response from the Responses API
|
|||||||
| `safety_identifier` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
|
| `safety_identifier` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
|
||||||
| `error` | [Nullable[components.ResponsesErrorField]](../components/responseserrorfield.md) | :heavy_check_mark: | Error information returned from the API | {<br/>"code": "rate_limit_exceeded",<br/>"message": "Rate limit exceeded. Please try again later."<br/>} |
|
| `error` | [Nullable[components.ResponsesErrorField]](../components/responseserrorfield.md) | :heavy_check_mark: | Error information returned from the API | {<br/>"code": "rate_limit_exceeded",<br/>"message": "Rate limit exceeded. Please try again later."<br/>} |
|
||||||
| `incomplete_details` | [Nullable[components.OpenAIResponsesIncompleteDetails]](../components/openairesponsesincompletedetails.md) | :heavy_check_mark: | N/A | |
|
| `incomplete_details` | [Nullable[components.OpenAIResponsesIncompleteDetails]](../components/openairesponsesincompletedetails.md) | :heavy_check_mark: | N/A | |
|
||||||
| `usage` | [Optional[components.OpenResponsesUsage]](../components/openresponsesusage.md) | :heavy_minus_sign: | Token usage information for the response | {<br/>"input_tokens": 10,<br/>"output_tokens": 25,<br/>"total_tokens": 35,<br/>"input_tokens_details": {<br/>"cached_tokens": 0<br/>},<br/>"output_tokens_details": {<br/>"reasoning_tokens": 0<br/>},<br/>"cost": 0.0012,<br/>"cost_details": {<br/>"upstream_inference_cost": null,<br/>"upstream_inference_input_cost": 0.0008,<br/>"upstream_inference_output_cost": 0.0004<br/>}<br/>} |
|
| `usage` | [OptionalNullable[components.OpenResponsesUsage]](../components/openresponsesusage.md) | :heavy_minus_sign: | Token usage information for the response | {<br/>"input_tokens": 10,<br/>"output_tokens": 25,<br/>"total_tokens": 35,<br/>"input_tokens_details": {<br/>"cached_tokens": 0<br/>},<br/>"output_tokens_details": {<br/>"reasoning_tokens": 0<br/>},<br/>"cost": 0.0012,<br/>"cost_details": {<br/>"upstream_inference_cost": null,<br/>"upstream_inference_input_cost": 0.0008,<br/>"upstream_inference_output_cost": 0.0004<br/>}<br/>} |
|
||||||
| `max_tool_calls` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | |
|
| `max_tool_calls` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | |
|
||||||
| `top_logprobs` | *Optional[float]* | :heavy_minus_sign: | N/A | |
|
| `top_logprobs` | *Optional[float]* | :heavy_minus_sign: | N/A | |
|
||||||
| `max_output_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | |
|
| `max_output_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | |
|
||||||
| `temperature` | *Nullable[float]* | :heavy_check_mark: | N/A | |
|
| `temperature` | *Nullable[float]* | :heavy_check_mark: | N/A | |
|
||||||
| `top_p` | *Nullable[float]* | :heavy_check_mark: | N/A | |
|
| `top_p` | *Nullable[float]* | :heavy_check_mark: | N/A | |
|
||||||
|
| `presence_penalty` | *Nullable[float]* | :heavy_check_mark: | N/A | |
|
||||||
|
| `frequency_penalty` | *Nullable[float]* | :heavy_check_mark: | N/A | |
|
||||||
| `instructions` | [Nullable[components.OpenAIResponsesInputUnion]](../components/openairesponsesinputunion.md) | :heavy_check_mark: | N/A | |
|
| `instructions` | [Nullable[components.OpenAIResponsesInputUnion]](../components/openairesponsesinputunion.md) | :heavy_check_mark: | N/A | |
|
||||||
| `metadata` | Dict[str, *str*] | :heavy_check_mark: | Metadata key-value pairs for the request. Keys must be ≤64 characters and cannot contain brackets. Values must be ≤512 characters. Maximum 16 pairs allowed. | {<br/>"user_id": "123",<br/>"session_id": "abc-def-ghi"<br/>} |
|
| `metadata` | Dict[str, *str*] | :heavy_check_mark: | Metadata key-value pairs for the request. Keys must be ≤64 characters and cannot contain brackets. Values must be ≤512 characters. Maximum 16 pairs allowed. | {<br/>"user_id": "123",<br/>"session_id": "abc-def-ghi"<br/>} |
|
||||||
| `tools` | List[[components.OpenResponsesNonStreamingResponseToolUnion](../components/openresponsesnonstreamingresponsetoolunion.md)] | :heavy_check_mark: | N/A | |
|
| `tools` | List[[components.OpenResponsesNonStreamingResponseToolUnion](../components/openresponsesnonstreamingresponsetoolunion.md)] | :heavy_check_mark: | N/A | |
|
||||||
|
|||||||
@@ -20,6 +20,10 @@ Request schema for Responses endpoint
|
|||||||
| `max_output_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | |
|
| `max_output_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | |
|
||||||
| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | |
|
| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | |
|
||||||
| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | |
|
| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | |
|
||||||
|
| `top_logprobs` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | |
|
||||||
|
| `max_tool_calls` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | |
|
||||||
|
| `presence_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | |
|
||||||
|
| `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | |
|
||||||
| `top_k` | *Optional[float]* | :heavy_minus_sign: | N/A | |
|
| `top_k` | *Optional[float]* | :heavy_minus_sign: | N/A | |
|
||||||
| `image_config` | Dict[str, [components.OpenResponsesRequestImageConfig](../components/openresponsesrequestimageconfig.md)] | :heavy_minus_sign: | Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details. | {<br/>"aspect_ratio": "16:9"<br/>} |
|
| `image_config` | Dict[str, [components.OpenResponsesRequestImageConfig](../components/openresponsesrequestimageconfig.md)] | :heavy_minus_sign: | Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details. | {<br/>"aspect_ratio": "16:9"<br/>} |
|
||||||
| `modalities` | List[[components.ResponsesOutputModality](../components/responsesoutputmodality.md)] | :heavy_minus_sign: | Output modalities for the response. Supported values are "text" and "image". | [<br/>"text",<br/>"image"<br/>] |
|
| `modalities` | List[[components.ResponsesOutputModality](../components/responsesoutputmodality.md)] | :heavy_minus_sign: | Output modalities for the response. Supported values are "text" and "image". | [<br/>"text",<br/>"image"<br/>] |
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
# ResponseInputVideo
|
||||||
|
|
||||||
|
Video input content item
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
|
||||||
|
| `type` | [components.ResponseInputVideoType](../components/responseinputvideotype.md) | :heavy_check_mark: | N/A |
|
||||||
|
| `video_url` | *str* | :heavy_check_mark: | A base64 data URL or remote URL that resolves to a video file |
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# ResponseInputVideoType
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ------------- | ------------- |
|
||||||
|
| `INPUT_VIDEO` | input_video |
|
||||||
@@ -7,4 +7,5 @@
|
|||||||
| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
|
| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
|
||||||
| `type` | [components.ResponseOutputTextType](../components/responseoutputtexttype.md) | :heavy_check_mark: | N/A |
|
| `type` | [components.ResponseOutputTextType](../components/responseoutputtexttype.md) | :heavy_check_mark: | N/A |
|
||||||
| `text` | *str* | :heavy_check_mark: | N/A |
|
| `text` | *str* | :heavy_check_mark: | N/A |
|
||||||
| `annotations` | List[[components.OpenAIResponsesAnnotation](../components/openairesponsesannotation.md)] | :heavy_minus_sign: | N/A |
|
| `annotations` | List[[components.OpenAIResponsesAnnotation](../components/openairesponsesannotation.md)] | :heavy_minus_sign: | N/A |
|
||||||
|
| `logprobs` | List[[components.Logprob](../components/logprob.md)] | :heavy_minus_sign: | N/A |
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
# TopLogprob
|
# ResponseOutputTextTopLogprob
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
@@ -6,5 +6,5 @@
|
|||||||
| Field | Type | Required | Description |
|
| Field | Type | Required | Description |
|
||||||
| ------------------ | ------------------ | ------------------ | ------------------ |
|
| ------------------ | ------------------ | ------------------ | ------------------ |
|
||||||
| `token` | *str* | :heavy_check_mark: | N/A |
|
| `token` | *str* | :heavy_check_mark: | N/A |
|
||||||
| `logprob` | *float* | :heavy_check_mark: | N/A |
|
| `bytes_` | List[*float*] | :heavy_check_mark: | N/A |
|
||||||
| `bytes_` | List[*float*] | :heavy_check_mark: | N/A |
|
| `logprob` | *float* | :heavy_check_mark: | N/A |
|
||||||
@@ -38,4 +38,5 @@ Generation data
|
|||||||
| `is_byok` | *bool* | :heavy_check_mark: | Whether this used bring-your-own-key | false |
|
| `is_byok` | *bool* | :heavy_check_mark: | Whether this used bring-your-own-key | false |
|
||||||
| `native_finish_reason` | *Nullable[str]* | :heavy_check_mark: | Native finish reason as reported by provider | stop |
|
| `native_finish_reason` | *Nullable[str]* | :heavy_check_mark: | Native finish reason as reported by provider | stop |
|
||||||
| `external_user` | *Nullable[str]* | :heavy_check_mark: | External user identifier | user-123 |
|
| `external_user` | *Nullable[str]* | :heavy_check_mark: | External user identifier | user-123 |
|
||||||
| `api_type` | [Nullable[operations.APIType]](../operations/apitype.md) | :heavy_check_mark: | Type of API used for the generation | |
|
| `api_type` | [Nullable[operations.APIType]](../operations/apitype.md) | :heavy_check_mark: | Type of API used for the generation | |
|
||||||
|
| `router` | *Nullable[str]* | :heavy_check_mark: | Router used for the request (e.g., openrouter/auto) | openrouter/auto |
|
||||||
@@ -51,6 +51,10 @@ with OpenRouter(
|
|||||||
| `max_output_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | |
|
| `max_output_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | |
|
||||||
| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | |
|
| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | |
|
||||||
| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | |
|
| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | |
|
||||||
|
| `top_logprobs` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | |
|
||||||
|
| `max_tool_calls` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | |
|
||||||
|
| `presence_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | |
|
||||||
|
| `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | |
|
||||||
| `top_k` | *Optional[float]* | :heavy_minus_sign: | N/A | |
|
| `top_k` | *Optional[float]* | :heavy_minus_sign: | N/A | |
|
||||||
| `image_config` | Dict[str, [components.OpenResponsesRequestImageConfig](../../components/openresponsesrequestimageconfig.md)] | :heavy_minus_sign: | Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details. | {<br/>"aspect_ratio": "16:9"<br/>} |
|
| `image_config` | Dict[str, [components.OpenResponsesRequestImageConfig](../../components/openresponsesrequestimageconfig.md)] | :heavy_minus_sign: | Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details. | {<br/>"aspect_ratio": "16:9"<br/>} |
|
||||||
| `modalities` | List[[components.ResponsesOutputModality](../../components/responsesoutputmodality.md)] | :heavy_minus_sign: | Output modalities for the response. Supported values are "text" and "image". | [<br/>"text",<br/>"image"<br/>] |
|
| `modalities` | List[[components.ResponsesOutputModality](../../components/responsesoutputmodality.md)] | :heavy_minus_sign: | Output modalities for the response. Supported values are "text" and "image". | [<br/>"text",<br/>"image"<br/>] |
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "openrouter"
|
name = "openrouter"
|
||||||
version = "0.0.17"
|
version = "0.1.2"
|
||||||
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"
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
import importlib.metadata
|
import importlib.metadata
|
||||||
|
|
||||||
__title__: str = "openrouter"
|
__title__: str = "openrouter"
|
||||||
__version__: str = "0.0.17"
|
__version__: str = "0.0.18"
|
||||||
__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.0.17 2.768.0 1.0.0 openrouter"
|
__user_agent__: str = "speakeasy-sdk/python 0.0.18 2.768.0 1.0.0 openrouter"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if __package__ is not None:
|
if __package__ is not None:
|
||||||
|
|||||||
@@ -136,9 +136,9 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
from .chatmessagetokenlogprob import (
|
from .chatmessagetokenlogprob import (
|
||||||
ChatMessageTokenLogprob,
|
ChatMessageTokenLogprob,
|
||||||
|
ChatMessageTokenLogprobTopLogprob,
|
||||||
|
ChatMessageTokenLogprobTopLogprobTypedDict,
|
||||||
ChatMessageTokenLogprobTypedDict,
|
ChatMessageTokenLogprobTypedDict,
|
||||||
TopLogprob,
|
|
||||||
TopLogprobTypedDict,
|
|
||||||
)
|
)
|
||||||
from .chatmessagetokenlogprobs import (
|
from .chatmessagetokenlogprobs import (
|
||||||
ChatMessageTokenLogprobs,
|
ChatMessageTokenLogprobs,
|
||||||
@@ -346,17 +346,21 @@ if TYPE_CHECKING:
|
|||||||
from .openairesponsestruncation import OpenAIResponsesTruncation
|
from .openairesponsestruncation import OpenAIResponsesTruncation
|
||||||
from .openresponseseasyinputmessage import (
|
from .openresponseseasyinputmessage import (
|
||||||
OpenResponsesEasyInputMessage,
|
OpenResponsesEasyInputMessage,
|
||||||
OpenResponsesEasyInputMessageContent1,
|
OpenResponsesEasyInputMessageContentInputImage,
|
||||||
OpenResponsesEasyInputMessageContent1TypedDict,
|
OpenResponsesEasyInputMessageContentInputImageTypedDict,
|
||||||
OpenResponsesEasyInputMessageContent2,
|
OpenResponsesEasyInputMessageContentType,
|
||||||
OpenResponsesEasyInputMessageContent2TypedDict,
|
OpenResponsesEasyInputMessageContentUnion1,
|
||||||
|
OpenResponsesEasyInputMessageContentUnion1TypedDict,
|
||||||
|
OpenResponsesEasyInputMessageContentUnion2,
|
||||||
|
OpenResponsesEasyInputMessageContentUnion2TypedDict,
|
||||||
|
OpenResponsesEasyInputMessageDetail,
|
||||||
OpenResponsesEasyInputMessageRoleAssistant,
|
OpenResponsesEasyInputMessageRoleAssistant,
|
||||||
OpenResponsesEasyInputMessageRoleDeveloper,
|
OpenResponsesEasyInputMessageRoleDeveloper,
|
||||||
OpenResponsesEasyInputMessageRoleSystem,
|
OpenResponsesEasyInputMessageRoleSystem,
|
||||||
OpenResponsesEasyInputMessageRoleUnion,
|
OpenResponsesEasyInputMessageRoleUnion,
|
||||||
OpenResponsesEasyInputMessageRoleUnionTypedDict,
|
OpenResponsesEasyInputMessageRoleUnionTypedDict,
|
||||||
OpenResponsesEasyInputMessageRoleUser,
|
OpenResponsesEasyInputMessageRoleUser,
|
||||||
OpenResponsesEasyInputMessageType,
|
OpenResponsesEasyInputMessageTypeMessage,
|
||||||
OpenResponsesEasyInputMessageTypedDict,
|
OpenResponsesEasyInputMessageTypedDict,
|
||||||
)
|
)
|
||||||
from .openresponseserrorevent import (
|
from .openresponseserrorevent import (
|
||||||
@@ -402,14 +406,18 @@ if TYPE_CHECKING:
|
|||||||
)
|
)
|
||||||
from .openresponsesinputmessageitem import (
|
from .openresponsesinputmessageitem import (
|
||||||
OpenResponsesInputMessageItem,
|
OpenResponsesInputMessageItem,
|
||||||
OpenResponsesInputMessageItemContent,
|
OpenResponsesInputMessageItemContentInputImage,
|
||||||
OpenResponsesInputMessageItemContentTypedDict,
|
OpenResponsesInputMessageItemContentInputImageTypedDict,
|
||||||
|
OpenResponsesInputMessageItemContentType,
|
||||||
|
OpenResponsesInputMessageItemContentUnion,
|
||||||
|
OpenResponsesInputMessageItemContentUnionTypedDict,
|
||||||
|
OpenResponsesInputMessageItemDetail,
|
||||||
OpenResponsesInputMessageItemRoleDeveloper,
|
OpenResponsesInputMessageItemRoleDeveloper,
|
||||||
OpenResponsesInputMessageItemRoleSystem,
|
OpenResponsesInputMessageItemRoleSystem,
|
||||||
OpenResponsesInputMessageItemRoleUnion,
|
OpenResponsesInputMessageItemRoleUnion,
|
||||||
OpenResponsesInputMessageItemRoleUnionTypedDict,
|
OpenResponsesInputMessageItemRoleUnionTypedDict,
|
||||||
OpenResponsesInputMessageItemRoleUser,
|
OpenResponsesInputMessageItemRoleUser,
|
||||||
OpenResponsesInputMessageItemType,
|
OpenResponsesInputMessageItemTypeMessage,
|
||||||
OpenResponsesInputMessageItemTypedDict,
|
OpenResponsesInputMessageItemTypedDict,
|
||||||
)
|
)
|
||||||
from .openresponseslogprobs import (
|
from .openresponseslogprobs import (
|
||||||
@@ -749,8 +757,17 @@ if TYPE_CHECKING:
|
|||||||
ResponseInputTextType,
|
ResponseInputTextType,
|
||||||
ResponseInputTextTypedDict,
|
ResponseInputTextTypedDict,
|
||||||
)
|
)
|
||||||
|
from .responseinputvideo import (
|
||||||
|
ResponseInputVideo,
|
||||||
|
ResponseInputVideoType,
|
||||||
|
ResponseInputVideoTypedDict,
|
||||||
|
)
|
||||||
from .responseoutputtext import (
|
from .responseoutputtext import (
|
||||||
|
Logprob,
|
||||||
|
LogprobTypedDict,
|
||||||
ResponseOutputText,
|
ResponseOutputText,
|
||||||
|
ResponseOutputTextTopLogprob,
|
||||||
|
ResponseOutputTextTopLogprobTypedDict,
|
||||||
ResponseOutputTextType,
|
ResponseOutputTextType,
|
||||||
ResponseOutputTextTypedDict,
|
ResponseOutputTextTypedDict,
|
||||||
)
|
)
|
||||||
@@ -966,6 +983,8 @@ __all__ = [
|
|||||||
"ChatMessageContentItemVideoVideoURL",
|
"ChatMessageContentItemVideoVideoURL",
|
||||||
"ChatMessageContentItemVideoVideoURLTypedDict",
|
"ChatMessageContentItemVideoVideoURLTypedDict",
|
||||||
"ChatMessageTokenLogprob",
|
"ChatMessageTokenLogprob",
|
||||||
|
"ChatMessageTokenLogprobTopLogprob",
|
||||||
|
"ChatMessageTokenLogprobTopLogprobTypedDict",
|
||||||
"ChatMessageTokenLogprobTypedDict",
|
"ChatMessageTokenLogprobTypedDict",
|
||||||
"ChatMessageTokenLogprobs",
|
"ChatMessageTokenLogprobs",
|
||||||
"ChatMessageTokenLogprobsTypedDict",
|
"ChatMessageTokenLogprobsTypedDict",
|
||||||
@@ -1060,6 +1079,8 @@ __all__ = [
|
|||||||
"JSONSchemaConfigTypedDict",
|
"JSONSchemaConfigTypedDict",
|
||||||
"ListEndpointsResponse",
|
"ListEndpointsResponse",
|
||||||
"ListEndpointsResponseTypedDict",
|
"ListEndpointsResponseTypedDict",
|
||||||
|
"Logprob",
|
||||||
|
"LogprobTypedDict",
|
||||||
"Message",
|
"Message",
|
||||||
"MessageContent",
|
"MessageContent",
|
||||||
"MessageContentTypedDict",
|
"MessageContentTypedDict",
|
||||||
@@ -1148,17 +1169,21 @@ __all__ = [
|
|||||||
"OpenAIResponsesToolChoiceUnionTypedDict",
|
"OpenAIResponsesToolChoiceUnionTypedDict",
|
||||||
"OpenAIResponsesTruncation",
|
"OpenAIResponsesTruncation",
|
||||||
"OpenResponsesEasyInputMessage",
|
"OpenResponsesEasyInputMessage",
|
||||||
"OpenResponsesEasyInputMessageContent1",
|
"OpenResponsesEasyInputMessageContentInputImage",
|
||||||
"OpenResponsesEasyInputMessageContent1TypedDict",
|
"OpenResponsesEasyInputMessageContentInputImageTypedDict",
|
||||||
"OpenResponsesEasyInputMessageContent2",
|
"OpenResponsesEasyInputMessageContentType",
|
||||||
"OpenResponsesEasyInputMessageContent2TypedDict",
|
"OpenResponsesEasyInputMessageContentUnion1",
|
||||||
|
"OpenResponsesEasyInputMessageContentUnion1TypedDict",
|
||||||
|
"OpenResponsesEasyInputMessageContentUnion2",
|
||||||
|
"OpenResponsesEasyInputMessageContentUnion2TypedDict",
|
||||||
|
"OpenResponsesEasyInputMessageDetail",
|
||||||
"OpenResponsesEasyInputMessageRoleAssistant",
|
"OpenResponsesEasyInputMessageRoleAssistant",
|
||||||
"OpenResponsesEasyInputMessageRoleDeveloper",
|
"OpenResponsesEasyInputMessageRoleDeveloper",
|
||||||
"OpenResponsesEasyInputMessageRoleSystem",
|
"OpenResponsesEasyInputMessageRoleSystem",
|
||||||
"OpenResponsesEasyInputMessageRoleUnion",
|
"OpenResponsesEasyInputMessageRoleUnion",
|
||||||
"OpenResponsesEasyInputMessageRoleUnionTypedDict",
|
"OpenResponsesEasyInputMessageRoleUnionTypedDict",
|
||||||
"OpenResponsesEasyInputMessageRoleUser",
|
"OpenResponsesEasyInputMessageRoleUser",
|
||||||
"OpenResponsesEasyInputMessageType",
|
"OpenResponsesEasyInputMessageTypeMessage",
|
||||||
"OpenResponsesEasyInputMessageTypedDict",
|
"OpenResponsesEasyInputMessageTypedDict",
|
||||||
"OpenResponsesErrorEvent",
|
"OpenResponsesErrorEvent",
|
||||||
"OpenResponsesErrorEventType",
|
"OpenResponsesErrorEventType",
|
||||||
@@ -1185,14 +1210,18 @@ __all__ = [
|
|||||||
"OpenResponsesInput1",
|
"OpenResponsesInput1",
|
||||||
"OpenResponsesInput1TypedDict",
|
"OpenResponsesInput1TypedDict",
|
||||||
"OpenResponsesInputMessageItem",
|
"OpenResponsesInputMessageItem",
|
||||||
"OpenResponsesInputMessageItemContent",
|
"OpenResponsesInputMessageItemContentInputImage",
|
||||||
"OpenResponsesInputMessageItemContentTypedDict",
|
"OpenResponsesInputMessageItemContentInputImageTypedDict",
|
||||||
|
"OpenResponsesInputMessageItemContentType",
|
||||||
|
"OpenResponsesInputMessageItemContentUnion",
|
||||||
|
"OpenResponsesInputMessageItemContentUnionTypedDict",
|
||||||
|
"OpenResponsesInputMessageItemDetail",
|
||||||
"OpenResponsesInputMessageItemRoleDeveloper",
|
"OpenResponsesInputMessageItemRoleDeveloper",
|
||||||
"OpenResponsesInputMessageItemRoleSystem",
|
"OpenResponsesInputMessageItemRoleSystem",
|
||||||
"OpenResponsesInputMessageItemRoleUnion",
|
"OpenResponsesInputMessageItemRoleUnion",
|
||||||
"OpenResponsesInputMessageItemRoleUnionTypedDict",
|
"OpenResponsesInputMessageItemRoleUnionTypedDict",
|
||||||
"OpenResponsesInputMessageItemRoleUser",
|
"OpenResponsesInputMessageItemRoleUser",
|
||||||
"OpenResponsesInputMessageItemType",
|
"OpenResponsesInputMessageItemTypeMessage",
|
||||||
"OpenResponsesInputMessageItemTypedDict",
|
"OpenResponsesInputMessageItemTypedDict",
|
||||||
"OpenResponsesInputTypedDict",
|
"OpenResponsesInputTypedDict",
|
||||||
"OpenResponsesLogProbs",
|
"OpenResponsesLogProbs",
|
||||||
@@ -1441,7 +1470,12 @@ __all__ = [
|
|||||||
"ResponseInputText",
|
"ResponseInputText",
|
||||||
"ResponseInputTextType",
|
"ResponseInputTextType",
|
||||||
"ResponseInputTextTypedDict",
|
"ResponseInputTextTypedDict",
|
||||||
|
"ResponseInputVideo",
|
||||||
|
"ResponseInputVideoType",
|
||||||
|
"ResponseInputVideoTypedDict",
|
||||||
"ResponseOutputText",
|
"ResponseOutputText",
|
||||||
|
"ResponseOutputTextTopLogprob",
|
||||||
|
"ResponseOutputTextTopLogprobTypedDict",
|
||||||
"ResponseOutputTextType",
|
"ResponseOutputTextType",
|
||||||
"ResponseOutputTextTypedDict",
|
"ResponseOutputTextTypedDict",
|
||||||
"ResponseTextConfig",
|
"ResponseTextConfig",
|
||||||
@@ -1540,8 +1574,6 @@ __all__ = [
|
|||||||
"ToolResponseMessageContent",
|
"ToolResponseMessageContent",
|
||||||
"ToolResponseMessageContentTypedDict",
|
"ToolResponseMessageContentTypedDict",
|
||||||
"ToolResponseMessageTypedDict",
|
"ToolResponseMessageTypedDict",
|
||||||
"TopLogprob",
|
|
||||||
"TopLogprobTypedDict",
|
|
||||||
"TopProviderInfo",
|
"TopProviderInfo",
|
||||||
"TopProviderInfoTypedDict",
|
"TopProviderInfoTypedDict",
|
||||||
"Truncation",
|
"Truncation",
|
||||||
@@ -1700,9 +1732,9 @@ _dynamic_imports: dict[str, str] = {
|
|||||||
"VideoURL2": ".chatmessagecontentitemvideo",
|
"VideoURL2": ".chatmessagecontentitemvideo",
|
||||||
"VideoURL2TypedDict": ".chatmessagecontentitemvideo",
|
"VideoURL2TypedDict": ".chatmessagecontentitemvideo",
|
||||||
"ChatMessageTokenLogprob": ".chatmessagetokenlogprob",
|
"ChatMessageTokenLogprob": ".chatmessagetokenlogprob",
|
||||||
|
"ChatMessageTokenLogprobTopLogprob": ".chatmessagetokenlogprob",
|
||||||
|
"ChatMessageTokenLogprobTopLogprobTypedDict": ".chatmessagetokenlogprob",
|
||||||
"ChatMessageTokenLogprobTypedDict": ".chatmessagetokenlogprob",
|
"ChatMessageTokenLogprobTypedDict": ".chatmessagetokenlogprob",
|
||||||
"TopLogprob": ".chatmessagetokenlogprob",
|
|
||||||
"TopLogprobTypedDict": ".chatmessagetokenlogprob",
|
|
||||||
"ChatMessageTokenLogprobs": ".chatmessagetokenlogprobs",
|
"ChatMessageTokenLogprobs": ".chatmessagetokenlogprobs",
|
||||||
"ChatMessageTokenLogprobsTypedDict": ".chatmessagetokenlogprobs",
|
"ChatMessageTokenLogprobsTypedDict": ".chatmessagetokenlogprobs",
|
||||||
"ChatMessageToolCall": ".chatmessagetoolcall",
|
"ChatMessageToolCall": ".chatmessagetoolcall",
|
||||||
@@ -1875,17 +1907,21 @@ _dynamic_imports: dict[str, str] = {
|
|||||||
"TypeTypedDict": ".openairesponsestoolchoice_union",
|
"TypeTypedDict": ".openairesponsestoolchoice_union",
|
||||||
"OpenAIResponsesTruncation": ".openairesponsestruncation",
|
"OpenAIResponsesTruncation": ".openairesponsestruncation",
|
||||||
"OpenResponsesEasyInputMessage": ".openresponseseasyinputmessage",
|
"OpenResponsesEasyInputMessage": ".openresponseseasyinputmessage",
|
||||||
"OpenResponsesEasyInputMessageContent1": ".openresponseseasyinputmessage",
|
"OpenResponsesEasyInputMessageContentInputImage": ".openresponseseasyinputmessage",
|
||||||
"OpenResponsesEasyInputMessageContent1TypedDict": ".openresponseseasyinputmessage",
|
"OpenResponsesEasyInputMessageContentInputImageTypedDict": ".openresponseseasyinputmessage",
|
||||||
"OpenResponsesEasyInputMessageContent2": ".openresponseseasyinputmessage",
|
"OpenResponsesEasyInputMessageContentType": ".openresponseseasyinputmessage",
|
||||||
"OpenResponsesEasyInputMessageContent2TypedDict": ".openresponseseasyinputmessage",
|
"OpenResponsesEasyInputMessageContentUnion1": ".openresponseseasyinputmessage",
|
||||||
|
"OpenResponsesEasyInputMessageContentUnion1TypedDict": ".openresponseseasyinputmessage",
|
||||||
|
"OpenResponsesEasyInputMessageContentUnion2": ".openresponseseasyinputmessage",
|
||||||
|
"OpenResponsesEasyInputMessageContentUnion2TypedDict": ".openresponseseasyinputmessage",
|
||||||
|
"OpenResponsesEasyInputMessageDetail": ".openresponseseasyinputmessage",
|
||||||
"OpenResponsesEasyInputMessageRoleAssistant": ".openresponseseasyinputmessage",
|
"OpenResponsesEasyInputMessageRoleAssistant": ".openresponseseasyinputmessage",
|
||||||
"OpenResponsesEasyInputMessageRoleDeveloper": ".openresponseseasyinputmessage",
|
"OpenResponsesEasyInputMessageRoleDeveloper": ".openresponseseasyinputmessage",
|
||||||
"OpenResponsesEasyInputMessageRoleSystem": ".openresponseseasyinputmessage",
|
"OpenResponsesEasyInputMessageRoleSystem": ".openresponseseasyinputmessage",
|
||||||
"OpenResponsesEasyInputMessageRoleUnion": ".openresponseseasyinputmessage",
|
"OpenResponsesEasyInputMessageRoleUnion": ".openresponseseasyinputmessage",
|
||||||
"OpenResponsesEasyInputMessageRoleUnionTypedDict": ".openresponseseasyinputmessage",
|
"OpenResponsesEasyInputMessageRoleUnionTypedDict": ".openresponseseasyinputmessage",
|
||||||
"OpenResponsesEasyInputMessageRoleUser": ".openresponseseasyinputmessage",
|
"OpenResponsesEasyInputMessageRoleUser": ".openresponseseasyinputmessage",
|
||||||
"OpenResponsesEasyInputMessageType": ".openresponseseasyinputmessage",
|
"OpenResponsesEasyInputMessageTypeMessage": ".openresponseseasyinputmessage",
|
||||||
"OpenResponsesEasyInputMessageTypedDict": ".openresponseseasyinputmessage",
|
"OpenResponsesEasyInputMessageTypedDict": ".openresponseseasyinputmessage",
|
||||||
"OpenResponsesErrorEvent": ".openresponseserrorevent",
|
"OpenResponsesErrorEvent": ".openresponseserrorevent",
|
||||||
"OpenResponsesErrorEventType": ".openresponseserrorevent",
|
"OpenResponsesErrorEventType": ".openresponseserrorevent",
|
||||||
@@ -1913,14 +1949,18 @@ _dynamic_imports: dict[str, str] = {
|
|||||||
"OpenResponsesInput1TypedDict": ".openresponsesinput",
|
"OpenResponsesInput1TypedDict": ".openresponsesinput",
|
||||||
"OpenResponsesInputTypedDict": ".openresponsesinput",
|
"OpenResponsesInputTypedDict": ".openresponsesinput",
|
||||||
"OpenResponsesInputMessageItem": ".openresponsesinputmessageitem",
|
"OpenResponsesInputMessageItem": ".openresponsesinputmessageitem",
|
||||||
"OpenResponsesInputMessageItemContent": ".openresponsesinputmessageitem",
|
"OpenResponsesInputMessageItemContentInputImage": ".openresponsesinputmessageitem",
|
||||||
"OpenResponsesInputMessageItemContentTypedDict": ".openresponsesinputmessageitem",
|
"OpenResponsesInputMessageItemContentInputImageTypedDict": ".openresponsesinputmessageitem",
|
||||||
|
"OpenResponsesInputMessageItemContentType": ".openresponsesinputmessageitem",
|
||||||
|
"OpenResponsesInputMessageItemContentUnion": ".openresponsesinputmessageitem",
|
||||||
|
"OpenResponsesInputMessageItemContentUnionTypedDict": ".openresponsesinputmessageitem",
|
||||||
|
"OpenResponsesInputMessageItemDetail": ".openresponsesinputmessageitem",
|
||||||
"OpenResponsesInputMessageItemRoleDeveloper": ".openresponsesinputmessageitem",
|
"OpenResponsesInputMessageItemRoleDeveloper": ".openresponsesinputmessageitem",
|
||||||
"OpenResponsesInputMessageItemRoleSystem": ".openresponsesinputmessageitem",
|
"OpenResponsesInputMessageItemRoleSystem": ".openresponsesinputmessageitem",
|
||||||
"OpenResponsesInputMessageItemRoleUnion": ".openresponsesinputmessageitem",
|
"OpenResponsesInputMessageItemRoleUnion": ".openresponsesinputmessageitem",
|
||||||
"OpenResponsesInputMessageItemRoleUnionTypedDict": ".openresponsesinputmessageitem",
|
"OpenResponsesInputMessageItemRoleUnionTypedDict": ".openresponsesinputmessageitem",
|
||||||
"OpenResponsesInputMessageItemRoleUser": ".openresponsesinputmessageitem",
|
"OpenResponsesInputMessageItemRoleUser": ".openresponsesinputmessageitem",
|
||||||
"OpenResponsesInputMessageItemType": ".openresponsesinputmessageitem",
|
"OpenResponsesInputMessageItemTypeMessage": ".openresponsesinputmessageitem",
|
||||||
"OpenResponsesInputMessageItemTypedDict": ".openresponsesinputmessageitem",
|
"OpenResponsesInputMessageItemTypedDict": ".openresponsesinputmessageitem",
|
||||||
"OpenResponsesLogProbs": ".openresponseslogprobs",
|
"OpenResponsesLogProbs": ".openresponseslogprobs",
|
||||||
"OpenResponsesLogProbsTypedDict": ".openresponseslogprobs",
|
"OpenResponsesLogProbsTypedDict": ".openresponseslogprobs",
|
||||||
@@ -2187,7 +2227,14 @@ _dynamic_imports: dict[str, str] = {
|
|||||||
"ResponseInputText": ".responseinputtext",
|
"ResponseInputText": ".responseinputtext",
|
||||||
"ResponseInputTextType": ".responseinputtext",
|
"ResponseInputTextType": ".responseinputtext",
|
||||||
"ResponseInputTextTypedDict": ".responseinputtext",
|
"ResponseInputTextTypedDict": ".responseinputtext",
|
||||||
|
"ResponseInputVideo": ".responseinputvideo",
|
||||||
|
"ResponseInputVideoType": ".responseinputvideo",
|
||||||
|
"ResponseInputVideoTypedDict": ".responseinputvideo",
|
||||||
|
"Logprob": ".responseoutputtext",
|
||||||
|
"LogprobTypedDict": ".responseoutputtext",
|
||||||
"ResponseOutputText": ".responseoutputtext",
|
"ResponseOutputText": ".responseoutputtext",
|
||||||
|
"ResponseOutputTextTopLogprob": ".responseoutputtext",
|
||||||
|
"ResponseOutputTextTopLogprobTypedDict": ".responseoutputtext",
|
||||||
"ResponseOutputTextType": ".responseoutputtext",
|
"ResponseOutputTextType": ".responseoutputtext",
|
||||||
"ResponseOutputTextTypedDict": ".responseoutputtext",
|
"ResponseOutputTextTypedDict": ".responseoutputtext",
|
||||||
"CodeEnum": ".responseserrorfield",
|
"CodeEnum": ".responseserrorfield",
|
||||||
|
|||||||
@@ -8,13 +8,13 @@ from typing import List
|
|||||||
from typing_extensions import Annotated, TypedDict
|
from typing_extensions import Annotated, TypedDict
|
||||||
|
|
||||||
|
|
||||||
class TopLogprobTypedDict(TypedDict):
|
class ChatMessageTokenLogprobTopLogprobTypedDict(TypedDict):
|
||||||
token: str
|
token: str
|
||||||
logprob: float
|
logprob: float
|
||||||
bytes_: Nullable[List[float]]
|
bytes_: Nullable[List[float]]
|
||||||
|
|
||||||
|
|
||||||
class TopLogprob(BaseModel):
|
class ChatMessageTokenLogprobTopLogprob(BaseModel):
|
||||||
token: str
|
token: str
|
||||||
|
|
||||||
logprob: float
|
logprob: float
|
||||||
@@ -56,7 +56,7 @@ class ChatMessageTokenLogprobTypedDict(TypedDict):
|
|||||||
token: str
|
token: str
|
||||||
logprob: float
|
logprob: float
|
||||||
bytes_: Nullable[List[float]]
|
bytes_: Nullable[List[float]]
|
||||||
top_logprobs: List[TopLogprobTypedDict]
|
top_logprobs: List[ChatMessageTokenLogprobTopLogprobTypedDict]
|
||||||
|
|
||||||
|
|
||||||
class ChatMessageTokenLogprob(BaseModel):
|
class ChatMessageTokenLogprob(BaseModel):
|
||||||
@@ -66,7 +66,7 @@ class ChatMessageTokenLogprob(BaseModel):
|
|||||||
|
|
||||||
bytes_: Annotated[Nullable[List[float]], pydantic.Field(alias="bytes")]
|
bytes_: Annotated[Nullable[List[float]], pydantic.Field(alias="bytes")]
|
||||||
|
|
||||||
top_logprobs: List[TopLogprob]
|
top_logprobs: List[ChatMessageTokenLogprobTopLogprob]
|
||||||
|
|
||||||
@model_serializer(mode="wrap")
|
@model_serializer(mode="wrap")
|
||||||
def serialize_model(self, handler):
|
def serialize_model(self, handler):
|
||||||
|
|||||||
@@ -3,16 +3,24 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
from .responseinputaudio import ResponseInputAudio, ResponseInputAudioTypedDict
|
from .responseinputaudio import ResponseInputAudio, ResponseInputAudioTypedDict
|
||||||
from .responseinputfile import ResponseInputFile, ResponseInputFileTypedDict
|
from .responseinputfile import ResponseInputFile, ResponseInputFileTypedDict
|
||||||
from .responseinputimage import ResponseInputImage, ResponseInputImageTypedDict
|
|
||||||
from .responseinputtext import ResponseInputText, ResponseInputTextTypedDict
|
from .responseinputtext import ResponseInputText, ResponseInputTextTypedDict
|
||||||
from openrouter.types import BaseModel
|
from .responseinputvideo import ResponseInputVideo, ResponseInputVideoTypedDict
|
||||||
from openrouter.utils import get_discriminator
|
from openrouter.types import (
|
||||||
from pydantic import Discriminator, Tag
|
BaseModel,
|
||||||
|
Nullable,
|
||||||
|
OptionalNullable,
|
||||||
|
UNSET,
|
||||||
|
UNSET_SENTINEL,
|
||||||
|
UnrecognizedStr,
|
||||||
|
)
|
||||||
|
from openrouter.utils import get_discriminator, validate_open_enum
|
||||||
|
from pydantic import Discriminator, Tag, model_serializer
|
||||||
|
from pydantic.functional_validators import PlainValidator
|
||||||
from typing import List, Literal, Optional, Union
|
from typing import List, Literal, Optional, Union
|
||||||
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
||||||
|
|
||||||
|
|
||||||
OpenResponsesEasyInputMessageType = Literal["message",]
|
OpenResponsesEasyInputMessageTypeMessage = Literal["message",]
|
||||||
|
|
||||||
|
|
||||||
OpenResponsesEasyInputMessageRoleDeveloper = Literal["developer",]
|
OpenResponsesEasyInputMessageRoleDeveloper = Literal["developer",]
|
||||||
@@ -49,49 +57,114 @@ OpenResponsesEasyInputMessageRoleUnion = TypeAliasType(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
OpenResponsesEasyInputMessageContent1TypedDict = TypeAliasType(
|
OpenResponsesEasyInputMessageContentType = Literal["input_image",]
|
||||||
"OpenResponsesEasyInputMessageContent1TypedDict",
|
|
||||||
|
|
||||||
|
OpenResponsesEasyInputMessageDetail = Union[
|
||||||
|
Literal[
|
||||||
|
"auto",
|
||||||
|
"high",
|
||||||
|
"low",
|
||||||
|
],
|
||||||
|
UnrecognizedStr,
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
class OpenResponsesEasyInputMessageContentInputImageTypedDict(TypedDict):
|
||||||
|
r"""Image input content item"""
|
||||||
|
|
||||||
|
type: OpenResponsesEasyInputMessageContentType
|
||||||
|
detail: OpenResponsesEasyInputMessageDetail
|
||||||
|
image_url: NotRequired[Nullable[str]]
|
||||||
|
|
||||||
|
|
||||||
|
class OpenResponsesEasyInputMessageContentInputImage(BaseModel):
|
||||||
|
r"""Image input content item"""
|
||||||
|
|
||||||
|
type: OpenResponsesEasyInputMessageContentType
|
||||||
|
|
||||||
|
detail: Annotated[
|
||||||
|
OpenResponsesEasyInputMessageDetail, PlainValidator(validate_open_enum(False))
|
||||||
|
]
|
||||||
|
|
||||||
|
image_url: OptionalNullable[str] = UNSET
|
||||||
|
|
||||||
|
@model_serializer(mode="wrap")
|
||||||
|
def serialize_model(self, handler):
|
||||||
|
optional_fields = ["image_url"]
|
||||||
|
nullable_fields = ["image_url"]
|
||||||
|
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
|
||||||
|
|
||||||
|
|
||||||
|
OpenResponsesEasyInputMessageContentUnion1TypedDict = TypeAliasType(
|
||||||
|
"OpenResponsesEasyInputMessageContentUnion1TypedDict",
|
||||||
Union[
|
Union[
|
||||||
ResponseInputTextTypedDict,
|
ResponseInputTextTypedDict,
|
||||||
ResponseInputAudioTypedDict,
|
ResponseInputAudioTypedDict,
|
||||||
ResponseInputImageTypedDict,
|
ResponseInputVideoTypedDict,
|
||||||
|
OpenResponsesEasyInputMessageContentInputImageTypedDict,
|
||||||
ResponseInputFileTypedDict,
|
ResponseInputFileTypedDict,
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
OpenResponsesEasyInputMessageContent1 = Annotated[
|
OpenResponsesEasyInputMessageContentUnion1 = Annotated[
|
||||||
Union[
|
Union[
|
||||||
Annotated[ResponseInputText, Tag("input_text")],
|
Annotated[ResponseInputText, Tag("input_text")],
|
||||||
Annotated[ResponseInputImage, Tag("input_image")],
|
Annotated[OpenResponsesEasyInputMessageContentInputImage, Tag("input_image")],
|
||||||
Annotated[ResponseInputFile, Tag("input_file")],
|
Annotated[ResponseInputFile, Tag("input_file")],
|
||||||
Annotated[ResponseInputAudio, Tag("input_audio")],
|
Annotated[ResponseInputAudio, Tag("input_audio")],
|
||||||
|
Annotated[ResponseInputVideo, Tag("input_video")],
|
||||||
],
|
],
|
||||||
Discriminator(lambda m: get_discriminator(m, "type", "type")),
|
Discriminator(lambda m: get_discriminator(m, "type", "type")),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
OpenResponsesEasyInputMessageContent2TypedDict = TypeAliasType(
|
OpenResponsesEasyInputMessageContentUnion2TypedDict = TypeAliasType(
|
||||||
"OpenResponsesEasyInputMessageContent2TypedDict",
|
"OpenResponsesEasyInputMessageContentUnion2TypedDict",
|
||||||
Union[List[OpenResponsesEasyInputMessageContent1TypedDict], str],
|
Union[List[OpenResponsesEasyInputMessageContentUnion1TypedDict], str],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
OpenResponsesEasyInputMessageContent2 = TypeAliasType(
|
OpenResponsesEasyInputMessageContentUnion2 = TypeAliasType(
|
||||||
"OpenResponsesEasyInputMessageContent2",
|
"OpenResponsesEasyInputMessageContentUnion2",
|
||||||
Union[List[OpenResponsesEasyInputMessageContent1], str],
|
Union[List[OpenResponsesEasyInputMessageContentUnion1], str],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class OpenResponsesEasyInputMessageTypedDict(TypedDict):
|
class OpenResponsesEasyInputMessageTypedDict(TypedDict):
|
||||||
role: OpenResponsesEasyInputMessageRoleUnionTypedDict
|
role: OpenResponsesEasyInputMessageRoleUnionTypedDict
|
||||||
content: OpenResponsesEasyInputMessageContent2TypedDict
|
content: OpenResponsesEasyInputMessageContentUnion2TypedDict
|
||||||
type: NotRequired[OpenResponsesEasyInputMessageType]
|
type: NotRequired[OpenResponsesEasyInputMessageTypeMessage]
|
||||||
|
|
||||||
|
|
||||||
class OpenResponsesEasyInputMessage(BaseModel):
|
class OpenResponsesEasyInputMessage(BaseModel):
|
||||||
role: OpenResponsesEasyInputMessageRoleUnion
|
role: OpenResponsesEasyInputMessageRoleUnion
|
||||||
|
|
||||||
content: OpenResponsesEasyInputMessageContent2
|
content: OpenResponsesEasyInputMessageContentUnion2
|
||||||
|
|
||||||
type: Optional[OpenResponsesEasyInputMessageType] = None
|
type: Optional[OpenResponsesEasyInputMessageTypeMessage] = None
|
||||||
|
|||||||
@@ -3,16 +3,24 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
from .responseinputaudio import ResponseInputAudio, ResponseInputAudioTypedDict
|
from .responseinputaudio import ResponseInputAudio, ResponseInputAudioTypedDict
|
||||||
from .responseinputfile import ResponseInputFile, ResponseInputFileTypedDict
|
from .responseinputfile import ResponseInputFile, ResponseInputFileTypedDict
|
||||||
from .responseinputimage import ResponseInputImage, ResponseInputImageTypedDict
|
|
||||||
from .responseinputtext import ResponseInputText, ResponseInputTextTypedDict
|
from .responseinputtext import ResponseInputText, ResponseInputTextTypedDict
|
||||||
from openrouter.types import BaseModel
|
from .responseinputvideo import ResponseInputVideo, ResponseInputVideoTypedDict
|
||||||
from openrouter.utils import get_discriminator
|
from openrouter.types import (
|
||||||
from pydantic import Discriminator, Tag
|
BaseModel,
|
||||||
|
Nullable,
|
||||||
|
OptionalNullable,
|
||||||
|
UNSET,
|
||||||
|
UNSET_SENTINEL,
|
||||||
|
UnrecognizedStr,
|
||||||
|
)
|
||||||
|
from openrouter.utils import get_discriminator, validate_open_enum
|
||||||
|
from pydantic import Discriminator, Tag, model_serializer
|
||||||
|
from pydantic.functional_validators import PlainValidator
|
||||||
from typing import List, Literal, Optional, Union
|
from typing import List, Literal, Optional, Union
|
||||||
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
||||||
|
|
||||||
|
|
||||||
OpenResponsesInputMessageItemType = Literal["message",]
|
OpenResponsesInputMessageItemTypeMessage = Literal["message",]
|
||||||
|
|
||||||
|
|
||||||
OpenResponsesInputMessageItemRoleDeveloper = Literal["developer",]
|
OpenResponsesInputMessageItemRoleDeveloper = Literal["developer",]
|
||||||
@@ -44,23 +52,88 @@ OpenResponsesInputMessageItemRoleUnion = TypeAliasType(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
OpenResponsesInputMessageItemContentTypedDict = TypeAliasType(
|
OpenResponsesInputMessageItemContentType = Literal["input_image",]
|
||||||
"OpenResponsesInputMessageItemContentTypedDict",
|
|
||||||
|
|
||||||
|
OpenResponsesInputMessageItemDetail = Union[
|
||||||
|
Literal[
|
||||||
|
"auto",
|
||||||
|
"high",
|
||||||
|
"low",
|
||||||
|
],
|
||||||
|
UnrecognizedStr,
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
class OpenResponsesInputMessageItemContentInputImageTypedDict(TypedDict):
|
||||||
|
r"""Image input content item"""
|
||||||
|
|
||||||
|
type: OpenResponsesInputMessageItemContentType
|
||||||
|
detail: OpenResponsesInputMessageItemDetail
|
||||||
|
image_url: NotRequired[Nullable[str]]
|
||||||
|
|
||||||
|
|
||||||
|
class OpenResponsesInputMessageItemContentInputImage(BaseModel):
|
||||||
|
r"""Image input content item"""
|
||||||
|
|
||||||
|
type: OpenResponsesInputMessageItemContentType
|
||||||
|
|
||||||
|
detail: Annotated[
|
||||||
|
OpenResponsesInputMessageItemDetail, PlainValidator(validate_open_enum(False))
|
||||||
|
]
|
||||||
|
|
||||||
|
image_url: OptionalNullable[str] = UNSET
|
||||||
|
|
||||||
|
@model_serializer(mode="wrap")
|
||||||
|
def serialize_model(self, handler):
|
||||||
|
optional_fields = ["image_url"]
|
||||||
|
nullable_fields = ["image_url"]
|
||||||
|
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
|
||||||
|
|
||||||
|
|
||||||
|
OpenResponsesInputMessageItemContentUnionTypedDict = TypeAliasType(
|
||||||
|
"OpenResponsesInputMessageItemContentUnionTypedDict",
|
||||||
Union[
|
Union[
|
||||||
ResponseInputTextTypedDict,
|
ResponseInputTextTypedDict,
|
||||||
ResponseInputAudioTypedDict,
|
ResponseInputAudioTypedDict,
|
||||||
ResponseInputImageTypedDict,
|
ResponseInputVideoTypedDict,
|
||||||
|
OpenResponsesInputMessageItemContentInputImageTypedDict,
|
||||||
ResponseInputFileTypedDict,
|
ResponseInputFileTypedDict,
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
OpenResponsesInputMessageItemContent = Annotated[
|
OpenResponsesInputMessageItemContentUnion = Annotated[
|
||||||
Union[
|
Union[
|
||||||
Annotated[ResponseInputText, Tag("input_text")],
|
Annotated[ResponseInputText, Tag("input_text")],
|
||||||
Annotated[ResponseInputImage, Tag("input_image")],
|
Annotated[OpenResponsesInputMessageItemContentInputImage, Tag("input_image")],
|
||||||
Annotated[ResponseInputFile, Tag("input_file")],
|
Annotated[ResponseInputFile, Tag("input_file")],
|
||||||
Annotated[ResponseInputAudio, Tag("input_audio")],
|
Annotated[ResponseInputAudio, Tag("input_audio")],
|
||||||
|
Annotated[ResponseInputVideo, Tag("input_video")],
|
||||||
],
|
],
|
||||||
Discriminator(lambda m: get_discriminator(m, "type", "type")),
|
Discriminator(lambda m: get_discriminator(m, "type", "type")),
|
||||||
]
|
]
|
||||||
@@ -68,16 +141,16 @@ OpenResponsesInputMessageItemContent = Annotated[
|
|||||||
|
|
||||||
class OpenResponsesInputMessageItemTypedDict(TypedDict):
|
class OpenResponsesInputMessageItemTypedDict(TypedDict):
|
||||||
role: OpenResponsesInputMessageItemRoleUnionTypedDict
|
role: OpenResponsesInputMessageItemRoleUnionTypedDict
|
||||||
content: List[OpenResponsesInputMessageItemContentTypedDict]
|
content: List[OpenResponsesInputMessageItemContentUnionTypedDict]
|
||||||
id: NotRequired[str]
|
id: NotRequired[str]
|
||||||
type: NotRequired[OpenResponsesInputMessageItemType]
|
type: NotRequired[OpenResponsesInputMessageItemTypeMessage]
|
||||||
|
|
||||||
|
|
||||||
class OpenResponsesInputMessageItem(BaseModel):
|
class OpenResponsesInputMessageItem(BaseModel):
|
||||||
role: OpenResponsesInputMessageItemRoleUnion
|
role: OpenResponsesInputMessageItemRoleUnion
|
||||||
|
|
||||||
content: List[OpenResponsesInputMessageItemContent]
|
content: List[OpenResponsesInputMessageItemContentUnion]
|
||||||
|
|
||||||
id: Optional[str] = None
|
id: Optional[str] = None
|
||||||
|
|
||||||
type: Optional[OpenResponsesInputMessageItemType] = None
|
type: Optional[OpenResponsesInputMessageItemTypeMessage] = None
|
||||||
|
|||||||
@@ -149,24 +149,27 @@ class OpenResponsesNonStreamingResponseTypedDict(TypedDict):
|
|||||||
object: Object
|
object: Object
|
||||||
created_at: float
|
created_at: float
|
||||||
model: str
|
model: str
|
||||||
|
status: OpenAIResponsesResponseStatus
|
||||||
|
completed_at: Nullable[float]
|
||||||
output: List[ResponsesOutputItemTypedDict]
|
output: List[ResponsesOutputItemTypedDict]
|
||||||
error: Nullable[ResponsesErrorFieldTypedDict]
|
error: Nullable[ResponsesErrorFieldTypedDict]
|
||||||
r"""Error information returned from the API"""
|
r"""Error information returned from the API"""
|
||||||
incomplete_details: Nullable[OpenAIResponsesIncompleteDetailsTypedDict]
|
incomplete_details: Nullable[OpenAIResponsesIncompleteDetailsTypedDict]
|
||||||
temperature: Nullable[float]
|
temperature: Nullable[float]
|
||||||
top_p: Nullable[float]
|
top_p: Nullable[float]
|
||||||
|
presence_penalty: Nullable[float]
|
||||||
|
frequency_penalty: Nullable[float]
|
||||||
instructions: Nullable[OpenAIResponsesInputUnionTypedDict]
|
instructions: Nullable[OpenAIResponsesInputUnionTypedDict]
|
||||||
metadata: Nullable[Dict[str, str]]
|
metadata: Nullable[Dict[str, str]]
|
||||||
r"""Metadata key-value pairs for the request. Keys must be ≤64 characters and cannot contain brackets. Values must be ≤512 characters. Maximum 16 pairs allowed."""
|
r"""Metadata key-value pairs for the request. Keys must be ≤64 characters and cannot contain brackets. Values must be ≤512 characters. Maximum 16 pairs allowed."""
|
||||||
tools: List[OpenResponsesNonStreamingResponseToolUnionTypedDict]
|
tools: List[OpenResponsesNonStreamingResponseToolUnionTypedDict]
|
||||||
tool_choice: OpenAIResponsesToolChoiceUnionTypedDict
|
tool_choice: OpenAIResponsesToolChoiceUnionTypedDict
|
||||||
parallel_tool_calls: bool
|
parallel_tool_calls: bool
|
||||||
status: NotRequired[OpenAIResponsesResponseStatus]
|
|
||||||
user: NotRequired[Nullable[str]]
|
user: NotRequired[Nullable[str]]
|
||||||
output_text: NotRequired[str]
|
output_text: NotRequired[str]
|
||||||
prompt_cache_key: NotRequired[Nullable[str]]
|
prompt_cache_key: NotRequired[Nullable[str]]
|
||||||
safety_identifier: NotRequired[Nullable[str]]
|
safety_identifier: NotRequired[Nullable[str]]
|
||||||
usage: NotRequired[OpenResponsesUsageTypedDict]
|
usage: NotRequired[Nullable[OpenResponsesUsageTypedDict]]
|
||||||
r"""Token usage information for the response"""
|
r"""Token usage information for the response"""
|
||||||
max_tool_calls: NotRequired[Nullable[float]]
|
max_tool_calls: NotRequired[Nullable[float]]
|
||||||
top_logprobs: NotRequired[float]
|
top_logprobs: NotRequired[float]
|
||||||
@@ -193,6 +196,12 @@ class OpenResponsesNonStreamingResponse(BaseModel):
|
|||||||
|
|
||||||
model: str
|
model: str
|
||||||
|
|
||||||
|
status: Annotated[
|
||||||
|
OpenAIResponsesResponseStatus, PlainValidator(validate_open_enum(False))
|
||||||
|
]
|
||||||
|
|
||||||
|
completed_at: Nullable[float]
|
||||||
|
|
||||||
output: List[ResponsesOutputItem]
|
output: List[ResponsesOutputItem]
|
||||||
|
|
||||||
error: Nullable[ResponsesErrorField]
|
error: Nullable[ResponsesErrorField]
|
||||||
@@ -204,6 +213,10 @@ class OpenResponsesNonStreamingResponse(BaseModel):
|
|||||||
|
|
||||||
top_p: Nullable[float]
|
top_p: Nullable[float]
|
||||||
|
|
||||||
|
presence_penalty: Nullable[float]
|
||||||
|
|
||||||
|
frequency_penalty: Nullable[float]
|
||||||
|
|
||||||
instructions: Nullable[OpenAIResponsesInputUnion]
|
instructions: Nullable[OpenAIResponsesInputUnion]
|
||||||
|
|
||||||
metadata: Nullable[Dict[str, str]]
|
metadata: Nullable[Dict[str, str]]
|
||||||
@@ -215,11 +228,6 @@ class OpenResponsesNonStreamingResponse(BaseModel):
|
|||||||
|
|
||||||
parallel_tool_calls: bool
|
parallel_tool_calls: bool
|
||||||
|
|
||||||
status: Annotated[
|
|
||||||
Optional[OpenAIResponsesResponseStatus],
|
|
||||||
PlainValidator(validate_open_enum(False)),
|
|
||||||
] = None
|
|
||||||
|
|
||||||
user: OptionalNullable[str] = UNSET
|
user: OptionalNullable[str] = UNSET
|
||||||
|
|
||||||
output_text: Optional[str] = None
|
output_text: Optional[str] = None
|
||||||
@@ -228,7 +236,7 @@ class OpenResponsesNonStreamingResponse(BaseModel):
|
|||||||
|
|
||||||
safety_identifier: OptionalNullable[str] = UNSET
|
safety_identifier: OptionalNullable[str] = UNSET
|
||||||
|
|
||||||
usage: Optional[OpenResponsesUsage] = None
|
usage: OptionalNullable[OpenResponsesUsage] = UNSET
|
||||||
r"""Token usage information for the response"""
|
r"""Token usage information for the response"""
|
||||||
|
|
||||||
max_tool_calls: OptionalNullable[float] = UNSET
|
max_tool_calls: OptionalNullable[float] = UNSET
|
||||||
@@ -263,7 +271,6 @@ class OpenResponsesNonStreamingResponse(BaseModel):
|
|||||||
@model_serializer(mode="wrap")
|
@model_serializer(mode="wrap")
|
||||||
def serialize_model(self, handler):
|
def serialize_model(self, handler):
|
||||||
optional_fields = [
|
optional_fields = [
|
||||||
"status",
|
|
||||||
"user",
|
"user",
|
||||||
"output_text",
|
"output_text",
|
||||||
"prompt_cache_key",
|
"prompt_cache_key",
|
||||||
@@ -282,15 +289,19 @@ class OpenResponsesNonStreamingResponse(BaseModel):
|
|||||||
"text",
|
"text",
|
||||||
]
|
]
|
||||||
nullable_fields = [
|
nullable_fields = [
|
||||||
|
"completed_at",
|
||||||
"user",
|
"user",
|
||||||
"prompt_cache_key",
|
"prompt_cache_key",
|
||||||
"safety_identifier",
|
"safety_identifier",
|
||||||
"error",
|
"error",
|
||||||
"incomplete_details",
|
"incomplete_details",
|
||||||
|
"usage",
|
||||||
"max_tool_calls",
|
"max_tool_calls",
|
||||||
"max_output_tokens",
|
"max_output_tokens",
|
||||||
"temperature",
|
"temperature",
|
||||||
"top_p",
|
"top_p",
|
||||||
|
"presence_penalty",
|
||||||
|
"frequency_penalty",
|
||||||
"instructions",
|
"instructions",
|
||||||
"metadata",
|
"metadata",
|
||||||
"prompt",
|
"prompt",
|
||||||
|
|||||||
@@ -545,6 +545,10 @@ class OpenResponsesRequestTypedDict(TypedDict):
|
|||||||
max_output_tokens: NotRequired[Nullable[float]]
|
max_output_tokens: NotRequired[Nullable[float]]
|
||||||
temperature: NotRequired[Nullable[float]]
|
temperature: NotRequired[Nullable[float]]
|
||||||
top_p: NotRequired[Nullable[float]]
|
top_p: NotRequired[Nullable[float]]
|
||||||
|
top_logprobs: NotRequired[Nullable[int]]
|
||||||
|
max_tool_calls: NotRequired[Nullable[int]]
|
||||||
|
presence_penalty: NotRequired[Nullable[float]]
|
||||||
|
frequency_penalty: NotRequired[Nullable[float]]
|
||||||
top_k: NotRequired[float]
|
top_k: NotRequired[float]
|
||||||
image_config: NotRequired[Dict[str, OpenResponsesRequestImageConfigTypedDict]]
|
image_config: NotRequired[Dict[str, OpenResponsesRequestImageConfigTypedDict]]
|
||||||
r"""Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details."""
|
r"""Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details."""
|
||||||
@@ -603,6 +607,14 @@ class OpenResponsesRequest(BaseModel):
|
|||||||
|
|
||||||
top_p: OptionalNullable[float] = UNSET
|
top_p: OptionalNullable[float] = UNSET
|
||||||
|
|
||||||
|
top_logprobs: OptionalNullable[int] = UNSET
|
||||||
|
|
||||||
|
max_tool_calls: OptionalNullable[int] = UNSET
|
||||||
|
|
||||||
|
presence_penalty: OptionalNullable[float] = UNSET
|
||||||
|
|
||||||
|
frequency_penalty: OptionalNullable[float] = UNSET
|
||||||
|
|
||||||
top_k: Optional[float] = None
|
top_k: Optional[float] = None
|
||||||
|
|
||||||
image_config: Optional[Dict[str, OpenResponsesRequestImageConfig]] = None
|
image_config: Optional[Dict[str, OpenResponsesRequestImageConfig]] = None
|
||||||
@@ -676,6 +688,10 @@ class OpenResponsesRequest(BaseModel):
|
|||||||
"max_output_tokens",
|
"max_output_tokens",
|
||||||
"temperature",
|
"temperature",
|
||||||
"top_p",
|
"top_p",
|
||||||
|
"top_logprobs",
|
||||||
|
"max_tool_calls",
|
||||||
|
"presence_penalty",
|
||||||
|
"frequency_penalty",
|
||||||
"top_k",
|
"top_k",
|
||||||
"image_config",
|
"image_config",
|
||||||
"modalities",
|
"modalities",
|
||||||
@@ -702,6 +718,10 @@ class OpenResponsesRequest(BaseModel):
|
|||||||
"max_output_tokens",
|
"max_output_tokens",
|
||||||
"temperature",
|
"temperature",
|
||||||
"top_p",
|
"top_p",
|
||||||
|
"top_logprobs",
|
||||||
|
"max_tool_calls",
|
||||||
|
"presence_penalty",
|
||||||
|
"frequency_penalty",
|
||||||
"prompt_cache_key",
|
"prompt_cache_key",
|
||||||
"previous_response_id",
|
"previous_response_id",
|
||||||
"prompt",
|
"prompt",
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
from openrouter.types import BaseModel
|
||||||
|
from typing import Literal
|
||||||
|
from typing_extensions import TypedDict
|
||||||
|
|
||||||
|
|
||||||
|
ResponseInputVideoType = Literal["input_video",]
|
||||||
|
|
||||||
|
|
||||||
|
class ResponseInputVideoTypedDict(TypedDict):
|
||||||
|
r"""Video input content item"""
|
||||||
|
|
||||||
|
type: ResponseInputVideoType
|
||||||
|
video_url: str
|
||||||
|
r"""A base64 data URL or remote URL that resolves to a video file"""
|
||||||
|
|
||||||
|
|
||||||
|
class ResponseInputVideo(BaseModel):
|
||||||
|
r"""Video input content item"""
|
||||||
|
|
||||||
|
type: ResponseInputVideoType
|
||||||
|
|
||||||
|
video_url: str
|
||||||
|
r"""A base64 data URL or remote URL that resolves to a video file"""
|
||||||
@@ -6,17 +6,50 @@ from .openairesponsesannotation import (
|
|||||||
OpenAIResponsesAnnotationTypedDict,
|
OpenAIResponsesAnnotationTypedDict,
|
||||||
)
|
)
|
||||||
from openrouter.types import BaseModel
|
from openrouter.types import BaseModel
|
||||||
|
import pydantic
|
||||||
from typing import List, Literal, Optional
|
from typing import List, Literal, Optional
|
||||||
from typing_extensions import NotRequired, TypedDict
|
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||||
|
|
||||||
|
|
||||||
ResponseOutputTextType = Literal["output_text",]
|
ResponseOutputTextType = Literal["output_text",]
|
||||||
|
|
||||||
|
|
||||||
|
class ResponseOutputTextTopLogprobTypedDict(TypedDict):
|
||||||
|
token: str
|
||||||
|
bytes_: List[float]
|
||||||
|
logprob: float
|
||||||
|
|
||||||
|
|
||||||
|
class ResponseOutputTextTopLogprob(BaseModel):
|
||||||
|
token: str
|
||||||
|
|
||||||
|
bytes_: Annotated[List[float], pydantic.Field(alias="bytes")]
|
||||||
|
|
||||||
|
logprob: float
|
||||||
|
|
||||||
|
|
||||||
|
class LogprobTypedDict(TypedDict):
|
||||||
|
token: str
|
||||||
|
bytes_: List[float]
|
||||||
|
logprob: float
|
||||||
|
top_logprobs: List[ResponseOutputTextTopLogprobTypedDict]
|
||||||
|
|
||||||
|
|
||||||
|
class Logprob(BaseModel):
|
||||||
|
token: str
|
||||||
|
|
||||||
|
bytes_: Annotated[List[float], pydantic.Field(alias="bytes")]
|
||||||
|
|
||||||
|
logprob: float
|
||||||
|
|
||||||
|
top_logprobs: List[ResponseOutputTextTopLogprob]
|
||||||
|
|
||||||
|
|
||||||
class ResponseOutputTextTypedDict(TypedDict):
|
class ResponseOutputTextTypedDict(TypedDict):
|
||||||
type: ResponseOutputTextType
|
type: ResponseOutputTextType
|
||||||
text: str
|
text: str
|
||||||
annotations: NotRequired[List[OpenAIResponsesAnnotationTypedDict]]
|
annotations: NotRequired[List[OpenAIResponsesAnnotationTypedDict]]
|
||||||
|
logprobs: NotRequired[List[LogprobTypedDict]]
|
||||||
|
|
||||||
|
|
||||||
class ResponseOutputText(BaseModel):
|
class ResponseOutputText(BaseModel):
|
||||||
@@ -25,3 +58,5 @@ class ResponseOutputText(BaseModel):
|
|||||||
text: str
|
text: str
|
||||||
|
|
||||||
annotations: Optional[List[OpenAIResponsesAnnotation]] = None
|
annotations: Optional[List[OpenAIResponsesAnnotation]] = None
|
||||||
|
|
||||||
|
logprobs: Optional[List[Logprob]] = None
|
||||||
|
|||||||
@@ -96,6 +96,8 @@ class GetGenerationDataTypedDict(TypedDict):
|
|||||||
r"""External user identifier"""
|
r"""External user identifier"""
|
||||||
api_type: Nullable[APIType]
|
api_type: Nullable[APIType]
|
||||||
r"""Type of API used for the generation"""
|
r"""Type of API used for the generation"""
|
||||||
|
router: Nullable[str]
|
||||||
|
r"""Router used for the request (e.g., openrouter/auto)"""
|
||||||
|
|
||||||
|
|
||||||
class GetGenerationData(BaseModel):
|
class GetGenerationData(BaseModel):
|
||||||
@@ -197,6 +199,9 @@ class GetGenerationData(BaseModel):
|
|||||||
api_type: Annotated[Nullable[APIType], PlainValidator(validate_open_enum(False))]
|
api_type: Annotated[Nullable[APIType], PlainValidator(validate_open_enum(False))]
|
||||||
r"""Type of API used for the generation"""
|
r"""Type of API used for the generation"""
|
||||||
|
|
||||||
|
router: Nullable[str]
|
||||||
|
r"""Router used for the request (e.g., openrouter/auto)"""
|
||||||
|
|
||||||
@model_serializer(mode="wrap")
|
@model_serializer(mode="wrap")
|
||||||
def serialize_model(self, handler):
|
def serialize_model(self, handler):
|
||||||
optional_fields = []
|
optional_fields = []
|
||||||
@@ -226,6 +231,7 @@ class GetGenerationData(BaseModel):
|
|||||||
"native_finish_reason",
|
"native_finish_reason",
|
||||||
"external_user",
|
"external_user",
|
||||||
"api_type",
|
"api_type",
|
||||||
|
"router",
|
||||||
]
|
]
|
||||||
null_default_fields = []
|
null_default_fields = []
|
||||||
|
|
||||||
|
|||||||
@@ -57,6 +57,10 @@ class Responses(BaseSDK):
|
|||||||
max_output_tokens: OptionalNullable[float] = UNSET,
|
max_output_tokens: OptionalNullable[float] = UNSET,
|
||||||
temperature: OptionalNullable[float] = UNSET,
|
temperature: OptionalNullable[float] = UNSET,
|
||||||
top_p: OptionalNullable[float] = UNSET,
|
top_p: OptionalNullable[float] = UNSET,
|
||||||
|
top_logprobs: OptionalNullable[int] = UNSET,
|
||||||
|
max_tool_calls: OptionalNullable[int] = UNSET,
|
||||||
|
presence_penalty: OptionalNullable[float] = UNSET,
|
||||||
|
frequency_penalty: OptionalNullable[float] = UNSET,
|
||||||
top_k: Optional[float] = None,
|
top_k: Optional[float] = None,
|
||||||
image_config: Optional[
|
image_config: Optional[
|
||||||
Union[
|
Union[
|
||||||
@@ -115,6 +119,10 @@ class Responses(BaseSDK):
|
|||||||
:param max_output_tokens:
|
:param max_output_tokens:
|
||||||
:param temperature:
|
:param temperature:
|
||||||
:param top_p:
|
:param top_p:
|
||||||
|
:param top_logprobs:
|
||||||
|
:param max_tool_calls:
|
||||||
|
:param presence_penalty:
|
||||||
|
:param frequency_penalty:
|
||||||
:param top_k:
|
:param top_k:
|
||||||
:param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details.
|
:param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details.
|
||||||
:param modalities: Output modalities for the response. Supported values are \"text\" and \"image\".
|
:param modalities: Output modalities for the response. Supported values are \"text\" and \"image\".
|
||||||
@@ -177,6 +185,10 @@ class Responses(BaseSDK):
|
|||||||
max_output_tokens: OptionalNullable[float] = UNSET,
|
max_output_tokens: OptionalNullable[float] = UNSET,
|
||||||
temperature: OptionalNullable[float] = UNSET,
|
temperature: OptionalNullable[float] = UNSET,
|
||||||
top_p: OptionalNullable[float] = UNSET,
|
top_p: OptionalNullable[float] = UNSET,
|
||||||
|
top_logprobs: OptionalNullable[int] = UNSET,
|
||||||
|
max_tool_calls: OptionalNullable[int] = UNSET,
|
||||||
|
presence_penalty: OptionalNullable[float] = UNSET,
|
||||||
|
frequency_penalty: OptionalNullable[float] = UNSET,
|
||||||
top_k: Optional[float] = None,
|
top_k: Optional[float] = None,
|
||||||
image_config: Optional[
|
image_config: Optional[
|
||||||
Union[
|
Union[
|
||||||
@@ -235,6 +247,10 @@ class Responses(BaseSDK):
|
|||||||
:param max_output_tokens:
|
:param max_output_tokens:
|
||||||
:param temperature:
|
:param temperature:
|
||||||
:param top_p:
|
:param top_p:
|
||||||
|
:param top_logprobs:
|
||||||
|
:param max_tool_calls:
|
||||||
|
:param presence_penalty:
|
||||||
|
:param frequency_penalty:
|
||||||
:param top_k:
|
:param top_k:
|
||||||
:param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details.
|
:param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details.
|
||||||
:param modalities: Output modalities for the response. Supported values are \"text\" and \"image\".
|
:param modalities: Output modalities for the response. Supported values are \"text\" and \"image\".
|
||||||
@@ -296,6 +312,10 @@ class Responses(BaseSDK):
|
|||||||
max_output_tokens: OptionalNullable[float] = UNSET,
|
max_output_tokens: OptionalNullable[float] = UNSET,
|
||||||
temperature: OptionalNullable[float] = UNSET,
|
temperature: OptionalNullable[float] = UNSET,
|
||||||
top_p: OptionalNullable[float] = UNSET,
|
top_p: OptionalNullable[float] = UNSET,
|
||||||
|
top_logprobs: OptionalNullable[int] = UNSET,
|
||||||
|
max_tool_calls: OptionalNullable[int] = UNSET,
|
||||||
|
presence_penalty: OptionalNullable[float] = UNSET,
|
||||||
|
frequency_penalty: OptionalNullable[float] = UNSET,
|
||||||
top_k: Optional[float] = None,
|
top_k: Optional[float] = None,
|
||||||
image_config: Optional[
|
image_config: Optional[
|
||||||
Union[
|
Union[
|
||||||
@@ -354,6 +374,10 @@ class Responses(BaseSDK):
|
|||||||
:param max_output_tokens:
|
:param max_output_tokens:
|
||||||
:param temperature:
|
:param temperature:
|
||||||
:param top_p:
|
:param top_p:
|
||||||
|
:param top_logprobs:
|
||||||
|
:param max_tool_calls:
|
||||||
|
:param presence_penalty:
|
||||||
|
:param frequency_penalty:
|
||||||
:param top_k:
|
:param top_k:
|
||||||
:param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details.
|
:param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details.
|
||||||
:param modalities: Output modalities for the response. Supported values are \"text\" and \"image\".
|
:param modalities: Output modalities for the response. Supported values are \"text\" and \"image\".
|
||||||
@@ -410,6 +434,10 @@ class Responses(BaseSDK):
|
|||||||
max_output_tokens=max_output_tokens,
|
max_output_tokens=max_output_tokens,
|
||||||
temperature=temperature,
|
temperature=temperature,
|
||||||
top_p=top_p,
|
top_p=top_p,
|
||||||
|
top_logprobs=top_logprobs,
|
||||||
|
max_tool_calls=max_tool_calls,
|
||||||
|
presence_penalty=presence_penalty,
|
||||||
|
frequency_penalty=frequency_penalty,
|
||||||
top_k=top_k,
|
top_k=top_k,
|
||||||
image_config=image_config,
|
image_config=image_config,
|
||||||
modalities=modalities,
|
modalities=modalities,
|
||||||
@@ -662,6 +690,10 @@ class Responses(BaseSDK):
|
|||||||
max_output_tokens: OptionalNullable[float] = UNSET,
|
max_output_tokens: OptionalNullable[float] = UNSET,
|
||||||
temperature: OptionalNullable[float] = UNSET,
|
temperature: OptionalNullable[float] = UNSET,
|
||||||
top_p: OptionalNullable[float] = UNSET,
|
top_p: OptionalNullable[float] = UNSET,
|
||||||
|
top_logprobs: OptionalNullable[int] = UNSET,
|
||||||
|
max_tool_calls: OptionalNullable[int] = UNSET,
|
||||||
|
presence_penalty: OptionalNullable[float] = UNSET,
|
||||||
|
frequency_penalty: OptionalNullable[float] = UNSET,
|
||||||
top_k: Optional[float] = None,
|
top_k: Optional[float] = None,
|
||||||
image_config: Optional[
|
image_config: Optional[
|
||||||
Union[
|
Union[
|
||||||
@@ -720,6 +752,10 @@ class Responses(BaseSDK):
|
|||||||
:param max_output_tokens:
|
:param max_output_tokens:
|
||||||
:param temperature:
|
:param temperature:
|
||||||
:param top_p:
|
:param top_p:
|
||||||
|
:param top_logprobs:
|
||||||
|
:param max_tool_calls:
|
||||||
|
:param presence_penalty:
|
||||||
|
:param frequency_penalty:
|
||||||
:param top_k:
|
:param top_k:
|
||||||
:param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details.
|
:param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details.
|
||||||
:param modalities: Output modalities for the response. Supported values are \"text\" and \"image\".
|
:param modalities: Output modalities for the response. Supported values are \"text\" and \"image\".
|
||||||
@@ -782,6 +818,10 @@ class Responses(BaseSDK):
|
|||||||
max_output_tokens: OptionalNullable[float] = UNSET,
|
max_output_tokens: OptionalNullable[float] = UNSET,
|
||||||
temperature: OptionalNullable[float] = UNSET,
|
temperature: OptionalNullable[float] = UNSET,
|
||||||
top_p: OptionalNullable[float] = UNSET,
|
top_p: OptionalNullable[float] = UNSET,
|
||||||
|
top_logprobs: OptionalNullable[int] = UNSET,
|
||||||
|
max_tool_calls: OptionalNullable[int] = UNSET,
|
||||||
|
presence_penalty: OptionalNullable[float] = UNSET,
|
||||||
|
frequency_penalty: OptionalNullable[float] = UNSET,
|
||||||
top_k: Optional[float] = None,
|
top_k: Optional[float] = None,
|
||||||
image_config: Optional[
|
image_config: Optional[
|
||||||
Union[
|
Union[
|
||||||
@@ -840,6 +880,10 @@ class Responses(BaseSDK):
|
|||||||
:param max_output_tokens:
|
:param max_output_tokens:
|
||||||
:param temperature:
|
:param temperature:
|
||||||
:param top_p:
|
:param top_p:
|
||||||
|
:param top_logprobs:
|
||||||
|
:param max_tool_calls:
|
||||||
|
:param presence_penalty:
|
||||||
|
:param frequency_penalty:
|
||||||
:param top_k:
|
:param top_k:
|
||||||
:param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details.
|
:param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details.
|
||||||
:param modalities: Output modalities for the response. Supported values are \"text\" and \"image\".
|
:param modalities: Output modalities for the response. Supported values are \"text\" and \"image\".
|
||||||
@@ -901,6 +945,10 @@ class Responses(BaseSDK):
|
|||||||
max_output_tokens: OptionalNullable[float] = UNSET,
|
max_output_tokens: OptionalNullable[float] = UNSET,
|
||||||
temperature: OptionalNullable[float] = UNSET,
|
temperature: OptionalNullable[float] = UNSET,
|
||||||
top_p: OptionalNullable[float] = UNSET,
|
top_p: OptionalNullable[float] = UNSET,
|
||||||
|
top_logprobs: OptionalNullable[int] = UNSET,
|
||||||
|
max_tool_calls: OptionalNullable[int] = UNSET,
|
||||||
|
presence_penalty: OptionalNullable[float] = UNSET,
|
||||||
|
frequency_penalty: OptionalNullable[float] = UNSET,
|
||||||
top_k: Optional[float] = None,
|
top_k: Optional[float] = None,
|
||||||
image_config: Optional[
|
image_config: Optional[
|
||||||
Union[
|
Union[
|
||||||
@@ -959,6 +1007,10 @@ class Responses(BaseSDK):
|
|||||||
:param max_output_tokens:
|
:param max_output_tokens:
|
||||||
:param temperature:
|
:param temperature:
|
||||||
:param top_p:
|
:param top_p:
|
||||||
|
:param top_logprobs:
|
||||||
|
:param max_tool_calls:
|
||||||
|
:param presence_penalty:
|
||||||
|
:param frequency_penalty:
|
||||||
:param top_k:
|
:param top_k:
|
||||||
:param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details.
|
:param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details.
|
||||||
:param modalities: Output modalities for the response. Supported values are \"text\" and \"image\".
|
:param modalities: Output modalities for the response. Supported values are \"text\" and \"image\".
|
||||||
@@ -1015,6 +1067,10 @@ class Responses(BaseSDK):
|
|||||||
max_output_tokens=max_output_tokens,
|
max_output_tokens=max_output_tokens,
|
||||||
temperature=temperature,
|
temperature=temperature,
|
||||||
top_p=top_p,
|
top_p=top_p,
|
||||||
|
top_logprobs=top_logprobs,
|
||||||
|
max_tool_calls=max_tool_calls,
|
||||||
|
presence_penalty=presence_penalty,
|
||||||
|
frequency_penalty=frequency_penalty,
|
||||||
top_k=top_k,
|
top_k=top_k,
|
||||||
image_config=image_config,
|
image_config=image_config,
|
||||||
modalities=modalities,
|
modalities=modalities,
|
||||||
|
|||||||
Reference in New Issue
Block a user