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 | |
|---|---|---|---|
|
|
db88c559c2 | ||
|
|
5d804916ec | ||
|
|
e3361882cd | ||
|
|
9073d38dc1 | ||
|
|
a35486030a |
+11
-22
@@ -1,12 +1,12 @@
|
||||
lockVersion: 2.0.0
|
||||
id: cfd52247-6a25-4c6d-bbce-fe6fce0cd69d
|
||||
management:
|
||||
docChecksum: 331e8a1f7c97c6a4a6b57eaddc80fc39
|
||||
docChecksum: 7419f3b58a64f08efb375ead9e169446
|
||||
docVersion: 1.0.0
|
||||
speakeasyVersion: 1.666.0
|
||||
generationVersion: 2.768.0
|
||||
releaseVersion: 0.0.18
|
||||
configChecksum: 1f58284fadb5b2b9029e9ef747f2a7e9
|
||||
releaseVersion: 0.0.17
|
||||
configChecksum: 50ef18bf69272fc09c257e3562e1b0df
|
||||
repoURL: https://github.com/OpenRouterTeam/python-sdk.git
|
||||
installationURL: https://github.com/OpenRouterTeam/python-sdk.git
|
||||
published: true
|
||||
@@ -91,7 +91,6 @@ generatedFiles:
|
||||
- docs/components/chatmessagecontentitemvideovideourl.md
|
||||
- docs/components/chatmessagetokenlogprob.md
|
||||
- docs/components/chatmessagetokenlogprobs.md
|
||||
- docs/components/chatmessagetokenlogprobtoplogprob.md
|
||||
- docs/components/chatmessagetoolcall.md
|
||||
- docs/components/chatmessagetoolcallfunction.md
|
||||
- docs/components/chatresponse.md
|
||||
@@ -146,7 +145,6 @@ generatedFiles:
|
||||
- docs/components/internalserverresponseerrordata.md
|
||||
- docs/components/jsonschemaconfig.md
|
||||
- docs/components/listendpointsresponse.md
|
||||
- docs/components/logprob.md
|
||||
- docs/components/message.md
|
||||
- docs/components/messagecontent.md
|
||||
- docs/components/messagedeveloper.md
|
||||
@@ -205,17 +203,14 @@ generatedFiles:
|
||||
- docs/components/openairesponsestoolchoiceunion.md
|
||||
- docs/components/openairesponsestruncation.md
|
||||
- docs/components/openresponseseasyinputmessage.md
|
||||
- docs/components/openresponseseasyinputmessagecontentinputimage.md
|
||||
- docs/components/openresponseseasyinputmessagecontenttype.md
|
||||
- docs/components/openresponseseasyinputmessagecontentunion1.md
|
||||
- docs/components/openresponseseasyinputmessagecontentunion2.md
|
||||
- docs/components/openresponseseasyinputmessagedetail.md
|
||||
- docs/components/openresponseseasyinputmessagecontent1.md
|
||||
- docs/components/openresponseseasyinputmessagecontent2.md
|
||||
- docs/components/openresponseseasyinputmessageroleassistant.md
|
||||
- docs/components/openresponseseasyinputmessageroledeveloper.md
|
||||
- docs/components/openresponseseasyinputmessagerolesystem.md
|
||||
- docs/components/openresponseseasyinputmessageroleunion.md
|
||||
- docs/components/openresponseseasyinputmessageroleuser.md
|
||||
- docs/components/openresponseseasyinputmessagetypemessage.md
|
||||
- docs/components/openresponseseasyinputmessagetype.md
|
||||
- docs/components/openresponseserrorevent.md
|
||||
- docs/components/openresponseserroreventtype.md
|
||||
- docs/components/openresponsesfunctioncalloutput.md
|
||||
@@ -233,15 +228,12 @@ generatedFiles:
|
||||
- docs/components/openresponsesinput.md
|
||||
- docs/components/openresponsesinput1.md
|
||||
- docs/components/openresponsesinputmessageitem.md
|
||||
- docs/components/openresponsesinputmessageitemcontentinputimage.md
|
||||
- docs/components/openresponsesinputmessageitemcontenttype.md
|
||||
- docs/components/openresponsesinputmessageitemcontentunion.md
|
||||
- docs/components/openresponsesinputmessageitemdetail.md
|
||||
- docs/components/openresponsesinputmessageitemcontent.md
|
||||
- docs/components/openresponsesinputmessageitemroledeveloper.md
|
||||
- docs/components/openresponsesinputmessageitemrolesystem.md
|
||||
- docs/components/openresponsesinputmessageitemroleunion.md
|
||||
- docs/components/openresponsesinputmessageitemroleuser.md
|
||||
- docs/components/openresponsesinputmessageitemtypemessage.md
|
||||
- docs/components/openresponsesinputmessageitemtype.md
|
||||
- docs/components/openresponseslogprobs.md
|
||||
- docs/components/openresponsesnonstreamingresponse.md
|
||||
- docs/components/openresponsesnonstreamingresponsetoolfunction.md
|
||||
@@ -388,10 +380,7 @@ generatedFiles:
|
||||
- docs/components/responseinputimagetype.md
|
||||
- docs/components/responseinputtext.md
|
||||
- docs/components/responseinputtexttype.md
|
||||
- docs/components/responseinputvideo.md
|
||||
- docs/components/responseinputvideotype.md
|
||||
- docs/components/responseoutputtext.md
|
||||
- docs/components/responseoutputtexttoplogprob.md
|
||||
- docs/components/responseoutputtexttype.md
|
||||
- docs/components/responseserrorfield.md
|
||||
- docs/components/responsesformatjsonobject.md
|
||||
@@ -456,6 +445,7 @@ generatedFiles:
|
||||
- docs/components/toolresponsemessage.md
|
||||
- docs/components/toolresponsemessagecontent.md
|
||||
- docs/components/toomanyrequestsresponseerrordata.md
|
||||
- docs/components/toplogprob.md
|
||||
- docs/components/topproviderinfo.md
|
||||
- docs/components/truncation.md
|
||||
- docs/components/ttl.md
|
||||
@@ -737,7 +727,6 @@ generatedFiles:
|
||||
- src/openrouter/components/responseinputfile.py
|
||||
- src/openrouter/components/responseinputimage.py
|
||||
- src/openrouter/components/responseinputtext.py
|
||||
- src/openrouter/components/responseinputvideo.py
|
||||
- src/openrouter/components/responseoutputtext.py
|
||||
- src/openrouter/components/responseserrorfield.py
|
||||
- src/openrouter/components/responsesformatjsonobject.py
|
||||
@@ -853,7 +842,7 @@ examples:
|
||||
application/json: {"store": false, "service_tier": "auto", "stream": false}
|
||||
responses:
|
||||
"200":
|
||||
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}
|
||||
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}
|
||||
"400":
|
||||
application/json: {"error": {"code": 400, "message": "Invalid request parameters"}}
|
||||
"401":
|
||||
@@ -966,7 +955,7 @@ examples:
|
||||
id: "<id>"
|
||||
responses:
|
||||
"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", "router": "openrouter/auto"}}
|
||||
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"}}
|
||||
"401":
|
||||
application/json: {"error": {"code": 401, "message": "Missing Authentication header"}}
|
||||
"402":
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ generation:
|
||||
skipResponseBodyAssertions: false
|
||||
preApplyUnionDiscriminators: true
|
||||
python:
|
||||
version: 0.0.18
|
||||
version: 0.0.17
|
||||
additionalDependencies:
|
||||
dev: {}
|
||||
main: {}
|
||||
|
||||
+16
-110
@@ -108,41 +108,6 @@ components:
|
||||
type: array
|
||||
items:
|
||||
$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:
|
||||
- type
|
||||
- text
|
||||
@@ -592,7 +557,6 @@ components:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/OpenAIResponsesUsage'
|
||||
- type: object
|
||||
nullable: true
|
||||
properties:
|
||||
cost:
|
||||
type: number
|
||||
@@ -1244,9 +1208,6 @@ components:
|
||||
type: string
|
||||
status:
|
||||
$ref: '#/components/schemas/OpenAIResponsesResponseStatus'
|
||||
completed_at:
|
||||
type: number
|
||||
nullable: true
|
||||
output:
|
||||
type: array
|
||||
items:
|
||||
@@ -1297,12 +1258,6 @@ components:
|
||||
top_p:
|
||||
type: number
|
||||
nullable: true
|
||||
presence_penalty:
|
||||
type: number
|
||||
nullable: true
|
||||
frequency_penalty:
|
||||
type: number
|
||||
nullable: true
|
||||
instructions:
|
||||
$ref: '#/components/schemas/OpenAIResponsesInput'
|
||||
metadata:
|
||||
@@ -1364,15 +1319,11 @@ components:
|
||||
- object
|
||||
- created_at
|
||||
- model
|
||||
- status
|
||||
- completed_at
|
||||
- output
|
||||
- error
|
||||
- incomplete_details
|
||||
- temperature
|
||||
- top_p
|
||||
- presence_penalty
|
||||
- frequency_penalty
|
||||
- instructions
|
||||
- metadata
|
||||
- tools
|
||||
@@ -3303,23 +3254,6 @@ components:
|
||||
- type: summary_text
|
||||
text: Step by step analysis
|
||||
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:
|
||||
type: object
|
||||
properties:
|
||||
@@ -3347,18 +3281,16 @@ components:
|
||||
items:
|
||||
oneOf:
|
||||
- $ref: '#/components/schemas/ResponseInputText'
|
||||
- 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/ResponseInputImage'
|
||||
- $ref: '#/components/schemas/ResponseInputFile'
|
||||
- $ref: '#/components/schemas/ResponseInputAudio'
|
||||
- $ref: '#/components/schemas/ResponseInputVideo'
|
||||
discriminator:
|
||||
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
|
||||
required:
|
||||
- role
|
||||
@@ -3388,18 +3320,16 @@ components:
|
||||
items:
|
||||
oneOf:
|
||||
- $ref: '#/components/schemas/ResponseInputText'
|
||||
- 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/ResponseInputImage'
|
||||
- $ref: '#/components/schemas/ResponseInputFile'
|
||||
- $ref: '#/components/schemas/ResponseInputAudio'
|
||||
- $ref: '#/components/schemas/ResponseInputVideo'
|
||||
discriminator:
|
||||
propertyName: type
|
||||
mapping:
|
||||
input_text: '#/components/schemas/ResponseInputText'
|
||||
input_image: '#/components/schemas/ResponseInputImage'
|
||||
input_file: '#/components/schemas/ResponseInputFile'
|
||||
input_audio: '#/components/schemas/ResponseInputAudio'
|
||||
required:
|
||||
- role
|
||||
- content
|
||||
@@ -3801,24 +3731,6 @@ components:
|
||||
type: number
|
||||
nullable: true
|
||||
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:
|
||||
type: number
|
||||
image_config:
|
||||
@@ -7286,11 +7198,6 @@ paths:
|
||||
- completions
|
||||
- embeddings
|
||||
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:
|
||||
- id
|
||||
- upstream_id
|
||||
@@ -7324,7 +7231,6 @@ paths:
|
||||
- native_finish_reason
|
||||
- external_user
|
||||
- api_type
|
||||
- router
|
||||
description: Generation data
|
||||
required:
|
||||
- data
|
||||
|
||||
+16
-110
@@ -109,41 +109,6 @@ components:
|
||||
type: array
|
||||
items:
|
||||
$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:
|
||||
- type
|
||||
- text
|
||||
@@ -598,7 +563,6 @@ components:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/OpenAIResponsesUsage'
|
||||
- type: object
|
||||
nullable: true
|
||||
properties:
|
||||
cost:
|
||||
type: number
|
||||
@@ -1259,9 +1223,6 @@ components:
|
||||
type: string
|
||||
status:
|
||||
$ref: '#/components/schemas/OpenAIResponsesResponseStatus'
|
||||
completed_at:
|
||||
type: number
|
||||
nullable: true
|
||||
output:
|
||||
type: array
|
||||
items:
|
||||
@@ -1312,12 +1273,6 @@ components:
|
||||
top_p:
|
||||
type: number
|
||||
nullable: true
|
||||
presence_penalty:
|
||||
type: number
|
||||
nullable: true
|
||||
frequency_penalty:
|
||||
type: number
|
||||
nullable: true
|
||||
instructions:
|
||||
$ref: '#/components/schemas/OpenAIResponsesInput'
|
||||
metadata:
|
||||
@@ -1380,15 +1335,11 @@ components:
|
||||
- object
|
||||
- created_at
|
||||
- model
|
||||
- status
|
||||
- completed_at
|
||||
- output
|
||||
- error
|
||||
- incomplete_details
|
||||
- temperature
|
||||
- top_p
|
||||
- presence_penalty
|
||||
- frequency_penalty
|
||||
- instructions
|
||||
- metadata
|
||||
- tools
|
||||
@@ -3320,23 +3271,6 @@ components:
|
||||
- type: summary_text
|
||||
text: Step by step analysis
|
||||
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:
|
||||
type: object
|
||||
properties:
|
||||
@@ -3364,18 +3298,16 @@ components:
|
||||
items:
|
||||
oneOf:
|
||||
- $ref: '#/components/schemas/ResponseInputText'
|
||||
- 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/ResponseInputImage'
|
||||
- $ref: '#/components/schemas/ResponseInputFile'
|
||||
- $ref: '#/components/schemas/ResponseInputAudio'
|
||||
- $ref: '#/components/schemas/ResponseInputVideo'
|
||||
discriminator:
|
||||
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
|
||||
required:
|
||||
- role
|
||||
@@ -3405,18 +3337,16 @@ components:
|
||||
items:
|
||||
oneOf:
|
||||
- $ref: '#/components/schemas/ResponseInputText'
|
||||
- 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/ResponseInputImage'
|
||||
- $ref: '#/components/schemas/ResponseInputFile'
|
||||
- $ref: '#/components/schemas/ResponseInputAudio'
|
||||
- $ref: '#/components/schemas/ResponseInputVideo'
|
||||
discriminator:
|
||||
propertyName: type
|
||||
mapping:
|
||||
input_text: '#/components/schemas/ResponseInputText'
|
||||
input_image: '#/components/schemas/ResponseInputImage'
|
||||
input_file: '#/components/schemas/ResponseInputFile'
|
||||
input_audio: '#/components/schemas/ResponseInputAudio'
|
||||
required:
|
||||
- role
|
||||
- content
|
||||
@@ -3821,24 +3751,6 @@ components:
|
||||
type: number
|
||||
nullable: true
|
||||
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:
|
||||
type: number
|
||||
image_config:
|
||||
@@ -7283,11 +7195,6 @@ paths:
|
||||
- embeddings
|
||||
description: Type of API used for the generation
|
||||
x-speakeasy-unknown-values: allow
|
||||
router:
|
||||
type: string
|
||||
nullable: true
|
||||
description: Router used for the request (e.g., openrouter/auto)
|
||||
example: openrouter/auto
|
||||
required:
|
||||
- id
|
||||
- upstream_id
|
||||
@@ -7321,7 +7228,6 @@ paths:
|
||||
- native_finish_reason
|
||||
- external_user
|
||||
- api_type
|
||||
- router
|
||||
description: Generation data
|
||||
required:
|
||||
- data
|
||||
|
||||
@@ -8,19 +8,20 @@ sources:
|
||||
- latest
|
||||
OpenRouter API:
|
||||
sourceNamespace: open-router-chat-completions-api
|
||||
sourceRevisionDigest: sha256:74aa60ddccc9442b797432138c9ea1577f922ae537a659f129b4102d3a8124d7
|
||||
sourceBlobDigest: sha256:c9ae686141914431fb09ce7f0ff685c5b20c19006a92ade6d8686358616f6925
|
||||
sourceRevisionDigest: sha256:5615c05050362c0944a59e3b5b0437157f9d152faac1509d3c390bbc85e93b1e
|
||||
sourceBlobDigest: sha256:4f08bbf0b65fd4e617996964ccb1fa33ed7e807f81d8731ba4d00b0a7fd2da98
|
||||
tags:
|
||||
- latest
|
||||
- subtree-sync-import-python-sdk
|
||||
- 1.0.0
|
||||
targets:
|
||||
open-router:
|
||||
source: OpenRouter API
|
||||
sourceNamespace: open-router-chat-completions-api
|
||||
sourceRevisionDigest: sha256:74aa60ddccc9442b797432138c9ea1577f922ae537a659f129b4102d3a8124d7
|
||||
sourceBlobDigest: sha256:c9ae686141914431fb09ce7f0ff685c5b20c19006a92ade6d8686358616f6925
|
||||
sourceRevisionDigest: sha256:5615c05050362c0944a59e3b5b0437157f9d152faac1509d3c390bbc85e93b1e
|
||||
sourceBlobDigest: sha256:4f08bbf0b65fd4e617996964ccb1fa33ed7e807f81d8731ba4d00b0a7fd2da98
|
||||
codeSamplesNamespace: open-router-python-code-samples
|
||||
codeSamplesRevisionDigest: sha256:95a78f7dc072063abfd68a880ad1054c27a9a9077449cbf667d07de13a15112a
|
||||
codeSamplesRevisionDigest: sha256:c60fe0121ecdbfb79af3a344b52b8daade826fb9648b925f229e5b1d93b5c7ac
|
||||
workflow:
|
||||
workflowVersion: 1.0.0
|
||||
speakeasyVersion: 1.666.0
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
## 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 |
|
||||
| `top_logprobs` | List[[components.ChatMessageTokenLogprobTopLogprob](../components/chatmessagetokenlogprobtoplogprob.md)] | :heavy_check_mark: | N/A |
|
||||
| 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 |
|
||||
| `top_logprobs` | List[[components.TopLogprob](../components/toplogprob.md)] | :heavy_check_mark: | N/A |
|
||||
@@ -1,10 +0,0 @@
|
||||
# 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 |
|
||||
@@ -1,11 +0,0 @@
|
||||
# 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
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `type` | [Optional[components.OpenResponsesEasyInputMessageTypeMessage]](../components/openresponseseasyinputmessagetypemessage.md) | :heavy_minus_sign: | N/A |
|
||||
| `role` | [components.OpenResponsesEasyInputMessageRoleUnion](../components/openresponseseasyinputmessageroleunion.md) | :heavy_check_mark: | N/A |
|
||||
| `content` | [components.OpenResponsesEasyInputMessageContentUnion2](../components/openresponseseasyinputmessagecontentunion2.md) | :heavy_check_mark: | N/A |
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |
|
||||
| `type` | [Optional[components.OpenResponsesEasyInputMessageType]](../components/openresponseseasyinputmessagetype.md) | :heavy_minus_sign: | N/A |
|
||||
| `role` | [components.OpenResponsesEasyInputMessageRoleUnion](../components/openresponseseasyinputmessageroleunion.md) | :heavy_check_mark: | N/A |
|
||||
| `content` | [components.OpenResponsesEasyInputMessageContent2](../components/openresponseseasyinputmessagecontent2.md) | :heavy_check_mark: | N/A |
|
||||
+3
-9
@@ -1,4 +1,4 @@
|
||||
# OpenResponsesInputMessageItemContentUnion
|
||||
# OpenResponsesEasyInputMessageContent1
|
||||
|
||||
|
||||
## Supported Types
|
||||
@@ -9,10 +9,10 @@
|
||||
value: components.ResponseInputText = /* values here */
|
||||
```
|
||||
|
||||
### `components.OpenResponsesInputMessageItemContentInputImage`
|
||||
### `components.ResponseInputImage`
|
||||
|
||||
```python
|
||||
value: components.OpenResponsesInputMessageItemContentInputImage = /* values here */
|
||||
value: components.ResponseInputImage = /* values here */
|
||||
```
|
||||
|
||||
### `components.ResponseInputFile`
|
||||
@@ -27,9 +27,3 @@ value: components.ResponseInputFile = /* values here */
|
||||
value: components.ResponseInputAudio = /* values here */
|
||||
```
|
||||
|
||||
### `components.ResponseInputVideo`
|
||||
|
||||
```python
|
||||
value: components.ResponseInputVideo = /* values here */
|
||||
```
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
# OpenResponsesEasyInputMessageContent2
|
||||
|
||||
|
||||
## Supported Types
|
||||
|
||||
### `List[components.OpenResponsesEasyInputMessageContent1]`
|
||||
|
||||
```python
|
||||
value: List[components.OpenResponsesEasyInputMessageContent1] = /* values here */
|
||||
```
|
||||
|
||||
### `str`
|
||||
|
||||
```python
|
||||
value: str = /* values here */
|
||||
```
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
# 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 |
|
||||
@@ -1,8 +0,0 @@
|
||||
# OpenResponsesEasyInputMessageContentType
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ------------- | ------------- |
|
||||
| `INPUT_IMAGE` | input_image |
|
||||
@@ -1,17 +0,0 @@
|
||||
# OpenResponsesEasyInputMessageContentUnion2
|
||||
|
||||
|
||||
## Supported Types
|
||||
|
||||
### `List[components.OpenResponsesEasyInputMessageContentUnion1]`
|
||||
|
||||
```python
|
||||
value: List[components.OpenResponsesEasyInputMessageContentUnion1] = /* values here */
|
||||
```
|
||||
|
||||
### `str`
|
||||
|
||||
```python
|
||||
value: str = /* values here */
|
||||
```
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
# OpenResponsesEasyInputMessageDetail
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ------ | ------ |
|
||||
| `AUTO` | auto |
|
||||
| `HIGH` | high |
|
||||
| `LOW` | low |
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# OpenResponsesEasyInputMessageTypeMessage
|
||||
# OpenResponsesEasyInputMessageType
|
||||
|
||||
|
||||
## Values
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `id` | *Optional[str]* | :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 |
|
||||
| `content` | List[[components.OpenResponsesInputMessageItemContentUnion](../components/openresponsesinputmessageitemcontentunion.md)] | :heavy_check_mark: | N/A |
|
||||
| Field | Type | Required | Description |
|
||||
| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
|
||||
| `id` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||
| `type` | [Optional[components.OpenResponsesInputMessageItemType]](../components/openresponsesinputmessageitemtype.md) | :heavy_minus_sign: | 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 |
|
||||
+3
-9
@@ -1,4 +1,4 @@
|
||||
# OpenResponsesEasyInputMessageContentUnion1
|
||||
# OpenResponsesInputMessageItemContent
|
||||
|
||||
|
||||
## Supported Types
|
||||
@@ -9,10 +9,10 @@
|
||||
value: components.ResponseInputText = /* values here */
|
||||
```
|
||||
|
||||
### `components.OpenResponsesEasyInputMessageContentInputImage`
|
||||
### `components.ResponseInputImage`
|
||||
|
||||
```python
|
||||
value: components.OpenResponsesEasyInputMessageContentInputImage = /* values here */
|
||||
value: components.ResponseInputImage = /* values here */
|
||||
```
|
||||
|
||||
### `components.ResponseInputFile`
|
||||
@@ -27,9 +27,3 @@ value: components.ResponseInputFile = /* values here */
|
||||
value: components.ResponseInputAudio = /* values here */
|
||||
```
|
||||
|
||||
### `components.ResponseInputVideo`
|
||||
|
||||
```python
|
||||
value: components.ResponseInputVideo = /* values here */
|
||||
```
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
# 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 |
|
||||
@@ -1,8 +0,0 @@
|
||||
# OpenResponsesInputMessageItemContentType
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ------------- | ------------- |
|
||||
| `INPUT_IMAGE` | input_image |
|
||||
@@ -1,10 +0,0 @@
|
||||
# OpenResponsesInputMessageItemDetail
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ------ | ------ |
|
||||
| `AUTO` | auto |
|
||||
| `HIGH` | high |
|
||||
| `LOW` | low |
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# OpenResponsesInputMessageItemTypeMessage
|
||||
# OpenResponsesInputMessageItemType
|
||||
|
||||
|
||||
## Values
|
||||
@@ -11,8 +11,7 @@ Complete non-streaming response from the Responses API
|
||||
| `object` | [components.Object](../components/object.md) | :heavy_check_mark: | N/A | |
|
||||
| `created_at` | *float* | :heavy_check_mark: | N/A | |
|
||||
| `model` | *str* | :heavy_check_mark: | N/A | |
|
||||
| `status` | [components.OpenAIResponsesResponseStatus](../components/openairesponsesresponsestatus.md) | :heavy_check_mark: | N/A | |
|
||||
| `completed_at` | *Nullable[float]* | :heavy_check_mark: | N/A | |
|
||||
| `status` | [Optional[components.OpenAIResponsesResponseStatus]](../components/openairesponsesresponsestatus.md) | :heavy_minus_sign: | N/A | |
|
||||
| `output` | List[[components.ResponsesOutputItem](../components/responsesoutputitem.md)] | :heavy_check_mark: | N/A | |
|
||||
| `user` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
|
||||
| `output_text` | *Optional[str]* | :heavy_minus_sign: | N/A | |
|
||||
@@ -20,14 +19,12 @@ Complete non-streaming response from the Responses API
|
||||
| `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/>} |
|
||||
| `incomplete_details` | [Nullable[components.OpenAIResponsesIncompleteDetails]](../components/openairesponsesincompletedetails.md) | :heavy_check_mark: | N/A | |
|
||||
| `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/>} |
|
||||
| `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/>} |
|
||||
| `max_tool_calls` | *OptionalNullable[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 | |
|
||||
| `temperature` | *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 | |
|
||||
| `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 | |
|
||||
|
||||
@@ -20,10 +20,6 @@ Request schema for Responses endpoint
|
||||
| `max_output_tokens` | *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_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 | |
|
||||
| `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/>] |
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
# 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 |
|
||||
@@ -1,8 +0,0 @@
|
||||
# ResponseInputVideoType
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ------------- | ------------- |
|
||||
| `INPUT_VIDEO` | input_video |
|
||||
@@ -8,4 +8,3 @@
|
||||
| `type` | [components.ResponseOutputTextType](../components/responseoutputtexttype.md) | :heavy_check_mark: | N/A |
|
||||
| `text` | *str* | :heavy_check_mark: | 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 @@
|
||||
# ResponseOutputTextTopLogprob
|
||||
# TopLogprob
|
||||
|
||||
|
||||
## Fields
|
||||
@@ -6,5 +6,5 @@
|
||||
| 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 |
|
||||
| `bytes_` | List[*float*] | :heavy_check_mark: | N/A |
|
||||
@@ -39,4 +39,3 @@ Generation data
|
||||
| `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 |
|
||||
| `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,10 +51,6 @@ with OpenRouter(
|
||||
| `max_output_tokens` | *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_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 | |
|
||||
| `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/>] |
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "openrouter"
|
||||
version = "0.1.2"
|
||||
version = "0.0.17"
|
||||
description = "Official Python Client SDK for OpenRouter."
|
||||
authors = [{ name = "OpenRouter" },]
|
||||
readme = "README-PYPI.md"
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
import importlib.metadata
|
||||
|
||||
__title__: str = "openrouter"
|
||||
__version__: str = "0.0.18"
|
||||
__version__: str = "0.0.17"
|
||||
__openapi_doc_version__: str = "1.0.0"
|
||||
__gen_version__: str = "2.768.0"
|
||||
__user_agent__: str = "speakeasy-sdk/python 0.0.18 2.768.0 1.0.0 openrouter"
|
||||
__user_agent__: str = "speakeasy-sdk/python 0.0.17 2.768.0 1.0.0 openrouter"
|
||||
|
||||
try:
|
||||
if __package__ is not None:
|
||||
|
||||
@@ -136,9 +136,9 @@ if TYPE_CHECKING:
|
||||
)
|
||||
from .chatmessagetokenlogprob import (
|
||||
ChatMessageTokenLogprob,
|
||||
ChatMessageTokenLogprobTopLogprob,
|
||||
ChatMessageTokenLogprobTopLogprobTypedDict,
|
||||
ChatMessageTokenLogprobTypedDict,
|
||||
TopLogprob,
|
||||
TopLogprobTypedDict,
|
||||
)
|
||||
from .chatmessagetokenlogprobs import (
|
||||
ChatMessageTokenLogprobs,
|
||||
@@ -346,21 +346,17 @@ if TYPE_CHECKING:
|
||||
from .openairesponsestruncation import OpenAIResponsesTruncation
|
||||
from .openresponseseasyinputmessage import (
|
||||
OpenResponsesEasyInputMessage,
|
||||
OpenResponsesEasyInputMessageContentInputImage,
|
||||
OpenResponsesEasyInputMessageContentInputImageTypedDict,
|
||||
OpenResponsesEasyInputMessageContentType,
|
||||
OpenResponsesEasyInputMessageContentUnion1,
|
||||
OpenResponsesEasyInputMessageContentUnion1TypedDict,
|
||||
OpenResponsesEasyInputMessageContentUnion2,
|
||||
OpenResponsesEasyInputMessageContentUnion2TypedDict,
|
||||
OpenResponsesEasyInputMessageDetail,
|
||||
OpenResponsesEasyInputMessageContent1,
|
||||
OpenResponsesEasyInputMessageContent1TypedDict,
|
||||
OpenResponsesEasyInputMessageContent2,
|
||||
OpenResponsesEasyInputMessageContent2TypedDict,
|
||||
OpenResponsesEasyInputMessageRoleAssistant,
|
||||
OpenResponsesEasyInputMessageRoleDeveloper,
|
||||
OpenResponsesEasyInputMessageRoleSystem,
|
||||
OpenResponsesEasyInputMessageRoleUnion,
|
||||
OpenResponsesEasyInputMessageRoleUnionTypedDict,
|
||||
OpenResponsesEasyInputMessageRoleUser,
|
||||
OpenResponsesEasyInputMessageTypeMessage,
|
||||
OpenResponsesEasyInputMessageType,
|
||||
OpenResponsesEasyInputMessageTypedDict,
|
||||
)
|
||||
from .openresponseserrorevent import (
|
||||
@@ -406,18 +402,14 @@ if TYPE_CHECKING:
|
||||
)
|
||||
from .openresponsesinputmessageitem import (
|
||||
OpenResponsesInputMessageItem,
|
||||
OpenResponsesInputMessageItemContentInputImage,
|
||||
OpenResponsesInputMessageItemContentInputImageTypedDict,
|
||||
OpenResponsesInputMessageItemContentType,
|
||||
OpenResponsesInputMessageItemContentUnion,
|
||||
OpenResponsesInputMessageItemContentUnionTypedDict,
|
||||
OpenResponsesInputMessageItemDetail,
|
||||
OpenResponsesInputMessageItemContent,
|
||||
OpenResponsesInputMessageItemContentTypedDict,
|
||||
OpenResponsesInputMessageItemRoleDeveloper,
|
||||
OpenResponsesInputMessageItemRoleSystem,
|
||||
OpenResponsesInputMessageItemRoleUnion,
|
||||
OpenResponsesInputMessageItemRoleUnionTypedDict,
|
||||
OpenResponsesInputMessageItemRoleUser,
|
||||
OpenResponsesInputMessageItemTypeMessage,
|
||||
OpenResponsesInputMessageItemType,
|
||||
OpenResponsesInputMessageItemTypedDict,
|
||||
)
|
||||
from .openresponseslogprobs import (
|
||||
@@ -757,17 +749,8 @@ if TYPE_CHECKING:
|
||||
ResponseInputTextType,
|
||||
ResponseInputTextTypedDict,
|
||||
)
|
||||
from .responseinputvideo import (
|
||||
ResponseInputVideo,
|
||||
ResponseInputVideoType,
|
||||
ResponseInputVideoTypedDict,
|
||||
)
|
||||
from .responseoutputtext import (
|
||||
Logprob,
|
||||
LogprobTypedDict,
|
||||
ResponseOutputText,
|
||||
ResponseOutputTextTopLogprob,
|
||||
ResponseOutputTextTopLogprobTypedDict,
|
||||
ResponseOutputTextType,
|
||||
ResponseOutputTextTypedDict,
|
||||
)
|
||||
@@ -983,8 +966,6 @@ __all__ = [
|
||||
"ChatMessageContentItemVideoVideoURL",
|
||||
"ChatMessageContentItemVideoVideoURLTypedDict",
|
||||
"ChatMessageTokenLogprob",
|
||||
"ChatMessageTokenLogprobTopLogprob",
|
||||
"ChatMessageTokenLogprobTopLogprobTypedDict",
|
||||
"ChatMessageTokenLogprobTypedDict",
|
||||
"ChatMessageTokenLogprobs",
|
||||
"ChatMessageTokenLogprobsTypedDict",
|
||||
@@ -1079,8 +1060,6 @@ __all__ = [
|
||||
"JSONSchemaConfigTypedDict",
|
||||
"ListEndpointsResponse",
|
||||
"ListEndpointsResponseTypedDict",
|
||||
"Logprob",
|
||||
"LogprobTypedDict",
|
||||
"Message",
|
||||
"MessageContent",
|
||||
"MessageContentTypedDict",
|
||||
@@ -1169,21 +1148,17 @@ __all__ = [
|
||||
"OpenAIResponsesToolChoiceUnionTypedDict",
|
||||
"OpenAIResponsesTruncation",
|
||||
"OpenResponsesEasyInputMessage",
|
||||
"OpenResponsesEasyInputMessageContentInputImage",
|
||||
"OpenResponsesEasyInputMessageContentInputImageTypedDict",
|
||||
"OpenResponsesEasyInputMessageContentType",
|
||||
"OpenResponsesEasyInputMessageContentUnion1",
|
||||
"OpenResponsesEasyInputMessageContentUnion1TypedDict",
|
||||
"OpenResponsesEasyInputMessageContentUnion2",
|
||||
"OpenResponsesEasyInputMessageContentUnion2TypedDict",
|
||||
"OpenResponsesEasyInputMessageDetail",
|
||||
"OpenResponsesEasyInputMessageContent1",
|
||||
"OpenResponsesEasyInputMessageContent1TypedDict",
|
||||
"OpenResponsesEasyInputMessageContent2",
|
||||
"OpenResponsesEasyInputMessageContent2TypedDict",
|
||||
"OpenResponsesEasyInputMessageRoleAssistant",
|
||||
"OpenResponsesEasyInputMessageRoleDeveloper",
|
||||
"OpenResponsesEasyInputMessageRoleSystem",
|
||||
"OpenResponsesEasyInputMessageRoleUnion",
|
||||
"OpenResponsesEasyInputMessageRoleUnionTypedDict",
|
||||
"OpenResponsesEasyInputMessageRoleUser",
|
||||
"OpenResponsesEasyInputMessageTypeMessage",
|
||||
"OpenResponsesEasyInputMessageType",
|
||||
"OpenResponsesEasyInputMessageTypedDict",
|
||||
"OpenResponsesErrorEvent",
|
||||
"OpenResponsesErrorEventType",
|
||||
@@ -1210,18 +1185,14 @@ __all__ = [
|
||||
"OpenResponsesInput1",
|
||||
"OpenResponsesInput1TypedDict",
|
||||
"OpenResponsesInputMessageItem",
|
||||
"OpenResponsesInputMessageItemContentInputImage",
|
||||
"OpenResponsesInputMessageItemContentInputImageTypedDict",
|
||||
"OpenResponsesInputMessageItemContentType",
|
||||
"OpenResponsesInputMessageItemContentUnion",
|
||||
"OpenResponsesInputMessageItemContentUnionTypedDict",
|
||||
"OpenResponsesInputMessageItemDetail",
|
||||
"OpenResponsesInputMessageItemContent",
|
||||
"OpenResponsesInputMessageItemContentTypedDict",
|
||||
"OpenResponsesInputMessageItemRoleDeveloper",
|
||||
"OpenResponsesInputMessageItemRoleSystem",
|
||||
"OpenResponsesInputMessageItemRoleUnion",
|
||||
"OpenResponsesInputMessageItemRoleUnionTypedDict",
|
||||
"OpenResponsesInputMessageItemRoleUser",
|
||||
"OpenResponsesInputMessageItemTypeMessage",
|
||||
"OpenResponsesInputMessageItemType",
|
||||
"OpenResponsesInputMessageItemTypedDict",
|
||||
"OpenResponsesInputTypedDict",
|
||||
"OpenResponsesLogProbs",
|
||||
@@ -1470,12 +1441,7 @@ __all__ = [
|
||||
"ResponseInputText",
|
||||
"ResponseInputTextType",
|
||||
"ResponseInputTextTypedDict",
|
||||
"ResponseInputVideo",
|
||||
"ResponseInputVideoType",
|
||||
"ResponseInputVideoTypedDict",
|
||||
"ResponseOutputText",
|
||||
"ResponseOutputTextTopLogprob",
|
||||
"ResponseOutputTextTopLogprobTypedDict",
|
||||
"ResponseOutputTextType",
|
||||
"ResponseOutputTextTypedDict",
|
||||
"ResponseTextConfig",
|
||||
@@ -1574,6 +1540,8 @@ __all__ = [
|
||||
"ToolResponseMessageContent",
|
||||
"ToolResponseMessageContentTypedDict",
|
||||
"ToolResponseMessageTypedDict",
|
||||
"TopLogprob",
|
||||
"TopLogprobTypedDict",
|
||||
"TopProviderInfo",
|
||||
"TopProviderInfoTypedDict",
|
||||
"Truncation",
|
||||
@@ -1732,9 +1700,9 @@ _dynamic_imports: dict[str, str] = {
|
||||
"VideoURL2": ".chatmessagecontentitemvideo",
|
||||
"VideoURL2TypedDict": ".chatmessagecontentitemvideo",
|
||||
"ChatMessageTokenLogprob": ".chatmessagetokenlogprob",
|
||||
"ChatMessageTokenLogprobTopLogprob": ".chatmessagetokenlogprob",
|
||||
"ChatMessageTokenLogprobTopLogprobTypedDict": ".chatmessagetokenlogprob",
|
||||
"ChatMessageTokenLogprobTypedDict": ".chatmessagetokenlogprob",
|
||||
"TopLogprob": ".chatmessagetokenlogprob",
|
||||
"TopLogprobTypedDict": ".chatmessagetokenlogprob",
|
||||
"ChatMessageTokenLogprobs": ".chatmessagetokenlogprobs",
|
||||
"ChatMessageTokenLogprobsTypedDict": ".chatmessagetokenlogprobs",
|
||||
"ChatMessageToolCall": ".chatmessagetoolcall",
|
||||
@@ -1907,21 +1875,17 @@ _dynamic_imports: dict[str, str] = {
|
||||
"TypeTypedDict": ".openairesponsestoolchoice_union",
|
||||
"OpenAIResponsesTruncation": ".openairesponsestruncation",
|
||||
"OpenResponsesEasyInputMessage": ".openresponseseasyinputmessage",
|
||||
"OpenResponsesEasyInputMessageContentInputImage": ".openresponseseasyinputmessage",
|
||||
"OpenResponsesEasyInputMessageContentInputImageTypedDict": ".openresponseseasyinputmessage",
|
||||
"OpenResponsesEasyInputMessageContentType": ".openresponseseasyinputmessage",
|
||||
"OpenResponsesEasyInputMessageContentUnion1": ".openresponseseasyinputmessage",
|
||||
"OpenResponsesEasyInputMessageContentUnion1TypedDict": ".openresponseseasyinputmessage",
|
||||
"OpenResponsesEasyInputMessageContentUnion2": ".openresponseseasyinputmessage",
|
||||
"OpenResponsesEasyInputMessageContentUnion2TypedDict": ".openresponseseasyinputmessage",
|
||||
"OpenResponsesEasyInputMessageDetail": ".openresponseseasyinputmessage",
|
||||
"OpenResponsesEasyInputMessageContent1": ".openresponseseasyinputmessage",
|
||||
"OpenResponsesEasyInputMessageContent1TypedDict": ".openresponseseasyinputmessage",
|
||||
"OpenResponsesEasyInputMessageContent2": ".openresponseseasyinputmessage",
|
||||
"OpenResponsesEasyInputMessageContent2TypedDict": ".openresponseseasyinputmessage",
|
||||
"OpenResponsesEasyInputMessageRoleAssistant": ".openresponseseasyinputmessage",
|
||||
"OpenResponsesEasyInputMessageRoleDeveloper": ".openresponseseasyinputmessage",
|
||||
"OpenResponsesEasyInputMessageRoleSystem": ".openresponseseasyinputmessage",
|
||||
"OpenResponsesEasyInputMessageRoleUnion": ".openresponseseasyinputmessage",
|
||||
"OpenResponsesEasyInputMessageRoleUnionTypedDict": ".openresponseseasyinputmessage",
|
||||
"OpenResponsesEasyInputMessageRoleUser": ".openresponseseasyinputmessage",
|
||||
"OpenResponsesEasyInputMessageTypeMessage": ".openresponseseasyinputmessage",
|
||||
"OpenResponsesEasyInputMessageType": ".openresponseseasyinputmessage",
|
||||
"OpenResponsesEasyInputMessageTypedDict": ".openresponseseasyinputmessage",
|
||||
"OpenResponsesErrorEvent": ".openresponseserrorevent",
|
||||
"OpenResponsesErrorEventType": ".openresponseserrorevent",
|
||||
@@ -1949,18 +1913,14 @@ _dynamic_imports: dict[str, str] = {
|
||||
"OpenResponsesInput1TypedDict": ".openresponsesinput",
|
||||
"OpenResponsesInputTypedDict": ".openresponsesinput",
|
||||
"OpenResponsesInputMessageItem": ".openresponsesinputmessageitem",
|
||||
"OpenResponsesInputMessageItemContentInputImage": ".openresponsesinputmessageitem",
|
||||
"OpenResponsesInputMessageItemContentInputImageTypedDict": ".openresponsesinputmessageitem",
|
||||
"OpenResponsesInputMessageItemContentType": ".openresponsesinputmessageitem",
|
||||
"OpenResponsesInputMessageItemContentUnion": ".openresponsesinputmessageitem",
|
||||
"OpenResponsesInputMessageItemContentUnionTypedDict": ".openresponsesinputmessageitem",
|
||||
"OpenResponsesInputMessageItemDetail": ".openresponsesinputmessageitem",
|
||||
"OpenResponsesInputMessageItemContent": ".openresponsesinputmessageitem",
|
||||
"OpenResponsesInputMessageItemContentTypedDict": ".openresponsesinputmessageitem",
|
||||
"OpenResponsesInputMessageItemRoleDeveloper": ".openresponsesinputmessageitem",
|
||||
"OpenResponsesInputMessageItemRoleSystem": ".openresponsesinputmessageitem",
|
||||
"OpenResponsesInputMessageItemRoleUnion": ".openresponsesinputmessageitem",
|
||||
"OpenResponsesInputMessageItemRoleUnionTypedDict": ".openresponsesinputmessageitem",
|
||||
"OpenResponsesInputMessageItemRoleUser": ".openresponsesinputmessageitem",
|
||||
"OpenResponsesInputMessageItemTypeMessage": ".openresponsesinputmessageitem",
|
||||
"OpenResponsesInputMessageItemType": ".openresponsesinputmessageitem",
|
||||
"OpenResponsesInputMessageItemTypedDict": ".openresponsesinputmessageitem",
|
||||
"OpenResponsesLogProbs": ".openresponseslogprobs",
|
||||
"OpenResponsesLogProbsTypedDict": ".openresponseslogprobs",
|
||||
@@ -2227,14 +2187,7 @@ _dynamic_imports: dict[str, str] = {
|
||||
"ResponseInputText": ".responseinputtext",
|
||||
"ResponseInputTextType": ".responseinputtext",
|
||||
"ResponseInputTextTypedDict": ".responseinputtext",
|
||||
"ResponseInputVideo": ".responseinputvideo",
|
||||
"ResponseInputVideoType": ".responseinputvideo",
|
||||
"ResponseInputVideoTypedDict": ".responseinputvideo",
|
||||
"Logprob": ".responseoutputtext",
|
||||
"LogprobTypedDict": ".responseoutputtext",
|
||||
"ResponseOutputText": ".responseoutputtext",
|
||||
"ResponseOutputTextTopLogprob": ".responseoutputtext",
|
||||
"ResponseOutputTextTopLogprobTypedDict": ".responseoutputtext",
|
||||
"ResponseOutputTextType": ".responseoutputtext",
|
||||
"ResponseOutputTextTypedDict": ".responseoutputtext",
|
||||
"CodeEnum": ".responseserrorfield",
|
||||
|
||||
@@ -8,13 +8,13 @@ from typing import List
|
||||
from typing_extensions import Annotated, TypedDict
|
||||
|
||||
|
||||
class ChatMessageTokenLogprobTopLogprobTypedDict(TypedDict):
|
||||
class TopLogprobTypedDict(TypedDict):
|
||||
token: str
|
||||
logprob: float
|
||||
bytes_: Nullable[List[float]]
|
||||
|
||||
|
||||
class ChatMessageTokenLogprobTopLogprob(BaseModel):
|
||||
class TopLogprob(BaseModel):
|
||||
token: str
|
||||
|
||||
logprob: float
|
||||
@@ -56,7 +56,7 @@ class ChatMessageTokenLogprobTypedDict(TypedDict):
|
||||
token: str
|
||||
logprob: float
|
||||
bytes_: Nullable[List[float]]
|
||||
top_logprobs: List[ChatMessageTokenLogprobTopLogprobTypedDict]
|
||||
top_logprobs: List[TopLogprobTypedDict]
|
||||
|
||||
|
||||
class ChatMessageTokenLogprob(BaseModel):
|
||||
@@ -66,7 +66,7 @@ class ChatMessageTokenLogprob(BaseModel):
|
||||
|
||||
bytes_: Annotated[Nullable[List[float]], pydantic.Field(alias="bytes")]
|
||||
|
||||
top_logprobs: List[ChatMessageTokenLogprobTopLogprob]
|
||||
top_logprobs: List[TopLogprob]
|
||||
|
||||
@model_serializer(mode="wrap")
|
||||
def serialize_model(self, handler):
|
||||
|
||||
@@ -3,24 +3,16 @@
|
||||
from __future__ import annotations
|
||||
from .responseinputaudio import ResponseInputAudio, ResponseInputAudioTypedDict
|
||||
from .responseinputfile import ResponseInputFile, ResponseInputFileTypedDict
|
||||
from .responseinputimage import ResponseInputImage, ResponseInputImageTypedDict
|
||||
from .responseinputtext import ResponseInputText, ResponseInputTextTypedDict
|
||||
from .responseinputvideo import ResponseInputVideo, ResponseInputVideoTypedDict
|
||||
from openrouter.types import (
|
||||
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 openrouter.types import BaseModel
|
||||
from openrouter.utils import get_discriminator
|
||||
from pydantic import Discriminator, Tag
|
||||
from typing import List, Literal, Optional, Union
|
||||
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
||||
|
||||
|
||||
OpenResponsesEasyInputMessageTypeMessage = Literal["message",]
|
||||
OpenResponsesEasyInputMessageType = Literal["message",]
|
||||
|
||||
|
||||
OpenResponsesEasyInputMessageRoleDeveloper = Literal["developer",]
|
||||
@@ -57,114 +49,49 @@ OpenResponsesEasyInputMessageRoleUnion = TypeAliasType(
|
||||
)
|
||||
|
||||
|
||||
OpenResponsesEasyInputMessageContentType = Literal["input_image",]
|
||||
|
||||
|
||||
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",
|
||||
OpenResponsesEasyInputMessageContent1TypedDict = TypeAliasType(
|
||||
"OpenResponsesEasyInputMessageContent1TypedDict",
|
||||
Union[
|
||||
ResponseInputTextTypedDict,
|
||||
ResponseInputAudioTypedDict,
|
||||
ResponseInputVideoTypedDict,
|
||||
OpenResponsesEasyInputMessageContentInputImageTypedDict,
|
||||
ResponseInputImageTypedDict,
|
||||
ResponseInputFileTypedDict,
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
OpenResponsesEasyInputMessageContentUnion1 = Annotated[
|
||||
OpenResponsesEasyInputMessageContent1 = Annotated[
|
||||
Union[
|
||||
Annotated[ResponseInputText, Tag("input_text")],
|
||||
Annotated[OpenResponsesEasyInputMessageContentInputImage, Tag("input_image")],
|
||||
Annotated[ResponseInputImage, Tag("input_image")],
|
||||
Annotated[ResponseInputFile, Tag("input_file")],
|
||||
Annotated[ResponseInputAudio, Tag("input_audio")],
|
||||
Annotated[ResponseInputVideo, Tag("input_video")],
|
||||
],
|
||||
Discriminator(lambda m: get_discriminator(m, "type", "type")),
|
||||
]
|
||||
|
||||
|
||||
OpenResponsesEasyInputMessageContentUnion2TypedDict = TypeAliasType(
|
||||
"OpenResponsesEasyInputMessageContentUnion2TypedDict",
|
||||
Union[List[OpenResponsesEasyInputMessageContentUnion1TypedDict], str],
|
||||
OpenResponsesEasyInputMessageContent2TypedDict = TypeAliasType(
|
||||
"OpenResponsesEasyInputMessageContent2TypedDict",
|
||||
Union[List[OpenResponsesEasyInputMessageContent1TypedDict], str],
|
||||
)
|
||||
|
||||
|
||||
OpenResponsesEasyInputMessageContentUnion2 = TypeAliasType(
|
||||
"OpenResponsesEasyInputMessageContentUnion2",
|
||||
Union[List[OpenResponsesEasyInputMessageContentUnion1], str],
|
||||
OpenResponsesEasyInputMessageContent2 = TypeAliasType(
|
||||
"OpenResponsesEasyInputMessageContent2",
|
||||
Union[List[OpenResponsesEasyInputMessageContent1], str],
|
||||
)
|
||||
|
||||
|
||||
class OpenResponsesEasyInputMessageTypedDict(TypedDict):
|
||||
role: OpenResponsesEasyInputMessageRoleUnionTypedDict
|
||||
content: OpenResponsesEasyInputMessageContentUnion2TypedDict
|
||||
type: NotRequired[OpenResponsesEasyInputMessageTypeMessage]
|
||||
content: OpenResponsesEasyInputMessageContent2TypedDict
|
||||
type: NotRequired[OpenResponsesEasyInputMessageType]
|
||||
|
||||
|
||||
class OpenResponsesEasyInputMessage(BaseModel):
|
||||
role: OpenResponsesEasyInputMessageRoleUnion
|
||||
|
||||
content: OpenResponsesEasyInputMessageContentUnion2
|
||||
content: OpenResponsesEasyInputMessageContent2
|
||||
|
||||
type: Optional[OpenResponsesEasyInputMessageTypeMessage] = None
|
||||
type: Optional[OpenResponsesEasyInputMessageType] = None
|
||||
|
||||
@@ -3,24 +3,16 @@
|
||||
from __future__ import annotations
|
||||
from .responseinputaudio import ResponseInputAudio, ResponseInputAudioTypedDict
|
||||
from .responseinputfile import ResponseInputFile, ResponseInputFileTypedDict
|
||||
from .responseinputimage import ResponseInputImage, ResponseInputImageTypedDict
|
||||
from .responseinputtext import ResponseInputText, ResponseInputTextTypedDict
|
||||
from .responseinputvideo import ResponseInputVideo, ResponseInputVideoTypedDict
|
||||
from openrouter.types import (
|
||||
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 openrouter.types import BaseModel
|
||||
from openrouter.utils import get_discriminator
|
||||
from pydantic import Discriminator, Tag
|
||||
from typing import List, Literal, Optional, Union
|
||||
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
||||
|
||||
|
||||
OpenResponsesInputMessageItemTypeMessage = Literal["message",]
|
||||
OpenResponsesInputMessageItemType = Literal["message",]
|
||||
|
||||
|
||||
OpenResponsesInputMessageItemRoleDeveloper = Literal["developer",]
|
||||
@@ -52,88 +44,23 @@ OpenResponsesInputMessageItemRoleUnion = TypeAliasType(
|
||||
)
|
||||
|
||||
|
||||
OpenResponsesInputMessageItemContentType = Literal["input_image",]
|
||||
|
||||
|
||||
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",
|
||||
OpenResponsesInputMessageItemContentTypedDict = TypeAliasType(
|
||||
"OpenResponsesInputMessageItemContentTypedDict",
|
||||
Union[
|
||||
ResponseInputTextTypedDict,
|
||||
ResponseInputAudioTypedDict,
|
||||
ResponseInputVideoTypedDict,
|
||||
OpenResponsesInputMessageItemContentInputImageTypedDict,
|
||||
ResponseInputImageTypedDict,
|
||||
ResponseInputFileTypedDict,
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
OpenResponsesInputMessageItemContentUnion = Annotated[
|
||||
OpenResponsesInputMessageItemContent = Annotated[
|
||||
Union[
|
||||
Annotated[ResponseInputText, Tag("input_text")],
|
||||
Annotated[OpenResponsesInputMessageItemContentInputImage, Tag("input_image")],
|
||||
Annotated[ResponseInputImage, Tag("input_image")],
|
||||
Annotated[ResponseInputFile, Tag("input_file")],
|
||||
Annotated[ResponseInputAudio, Tag("input_audio")],
|
||||
Annotated[ResponseInputVideo, Tag("input_video")],
|
||||
],
|
||||
Discriminator(lambda m: get_discriminator(m, "type", "type")),
|
||||
]
|
||||
@@ -141,16 +68,16 @@ OpenResponsesInputMessageItemContentUnion = Annotated[
|
||||
|
||||
class OpenResponsesInputMessageItemTypedDict(TypedDict):
|
||||
role: OpenResponsesInputMessageItemRoleUnionTypedDict
|
||||
content: List[OpenResponsesInputMessageItemContentUnionTypedDict]
|
||||
content: List[OpenResponsesInputMessageItemContentTypedDict]
|
||||
id: NotRequired[str]
|
||||
type: NotRequired[OpenResponsesInputMessageItemTypeMessage]
|
||||
type: NotRequired[OpenResponsesInputMessageItemType]
|
||||
|
||||
|
||||
class OpenResponsesInputMessageItem(BaseModel):
|
||||
role: OpenResponsesInputMessageItemRoleUnion
|
||||
|
||||
content: List[OpenResponsesInputMessageItemContentUnion]
|
||||
content: List[OpenResponsesInputMessageItemContent]
|
||||
|
||||
id: Optional[str] = None
|
||||
|
||||
type: Optional[OpenResponsesInputMessageItemTypeMessage] = None
|
||||
type: Optional[OpenResponsesInputMessageItemType] = None
|
||||
|
||||
@@ -149,27 +149,24 @@ class OpenResponsesNonStreamingResponseTypedDict(TypedDict):
|
||||
object: Object
|
||||
created_at: float
|
||||
model: str
|
||||
status: OpenAIResponsesResponseStatus
|
||||
completed_at: Nullable[float]
|
||||
output: List[ResponsesOutputItemTypedDict]
|
||||
error: Nullable[ResponsesErrorFieldTypedDict]
|
||||
r"""Error information returned from the API"""
|
||||
incomplete_details: Nullable[OpenAIResponsesIncompleteDetailsTypedDict]
|
||||
temperature: Nullable[float]
|
||||
top_p: Nullable[float]
|
||||
presence_penalty: Nullable[float]
|
||||
frequency_penalty: Nullable[float]
|
||||
instructions: Nullable[OpenAIResponsesInputUnionTypedDict]
|
||||
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."""
|
||||
tools: List[OpenResponsesNonStreamingResponseToolUnionTypedDict]
|
||||
tool_choice: OpenAIResponsesToolChoiceUnionTypedDict
|
||||
parallel_tool_calls: bool
|
||||
status: NotRequired[OpenAIResponsesResponseStatus]
|
||||
user: NotRequired[Nullable[str]]
|
||||
output_text: NotRequired[str]
|
||||
prompt_cache_key: NotRequired[Nullable[str]]
|
||||
safety_identifier: NotRequired[Nullable[str]]
|
||||
usage: NotRequired[Nullable[OpenResponsesUsageTypedDict]]
|
||||
usage: NotRequired[OpenResponsesUsageTypedDict]
|
||||
r"""Token usage information for the response"""
|
||||
max_tool_calls: NotRequired[Nullable[float]]
|
||||
top_logprobs: NotRequired[float]
|
||||
@@ -196,12 +193,6 @@ class OpenResponsesNonStreamingResponse(BaseModel):
|
||||
|
||||
model: str
|
||||
|
||||
status: Annotated[
|
||||
OpenAIResponsesResponseStatus, PlainValidator(validate_open_enum(False))
|
||||
]
|
||||
|
||||
completed_at: Nullable[float]
|
||||
|
||||
output: List[ResponsesOutputItem]
|
||||
|
||||
error: Nullable[ResponsesErrorField]
|
||||
@@ -213,10 +204,6 @@ class OpenResponsesNonStreamingResponse(BaseModel):
|
||||
|
||||
top_p: Nullable[float]
|
||||
|
||||
presence_penalty: Nullable[float]
|
||||
|
||||
frequency_penalty: Nullable[float]
|
||||
|
||||
instructions: Nullable[OpenAIResponsesInputUnion]
|
||||
|
||||
metadata: Nullable[Dict[str, str]]
|
||||
@@ -228,6 +215,11 @@ class OpenResponsesNonStreamingResponse(BaseModel):
|
||||
|
||||
parallel_tool_calls: bool
|
||||
|
||||
status: Annotated[
|
||||
Optional[OpenAIResponsesResponseStatus],
|
||||
PlainValidator(validate_open_enum(False)),
|
||||
] = None
|
||||
|
||||
user: OptionalNullable[str] = UNSET
|
||||
|
||||
output_text: Optional[str] = None
|
||||
@@ -236,7 +228,7 @@ class OpenResponsesNonStreamingResponse(BaseModel):
|
||||
|
||||
safety_identifier: OptionalNullable[str] = UNSET
|
||||
|
||||
usage: OptionalNullable[OpenResponsesUsage] = UNSET
|
||||
usage: Optional[OpenResponsesUsage] = None
|
||||
r"""Token usage information for the response"""
|
||||
|
||||
max_tool_calls: OptionalNullable[float] = UNSET
|
||||
@@ -271,6 +263,7 @@ class OpenResponsesNonStreamingResponse(BaseModel):
|
||||
@model_serializer(mode="wrap")
|
||||
def serialize_model(self, handler):
|
||||
optional_fields = [
|
||||
"status",
|
||||
"user",
|
||||
"output_text",
|
||||
"prompt_cache_key",
|
||||
@@ -289,19 +282,15 @@ class OpenResponsesNonStreamingResponse(BaseModel):
|
||||
"text",
|
||||
]
|
||||
nullable_fields = [
|
||||
"completed_at",
|
||||
"user",
|
||||
"prompt_cache_key",
|
||||
"safety_identifier",
|
||||
"error",
|
||||
"incomplete_details",
|
||||
"usage",
|
||||
"max_tool_calls",
|
||||
"max_output_tokens",
|
||||
"temperature",
|
||||
"top_p",
|
||||
"presence_penalty",
|
||||
"frequency_penalty",
|
||||
"instructions",
|
||||
"metadata",
|
||||
"prompt",
|
||||
|
||||
@@ -545,10 +545,6 @@ class OpenResponsesRequestTypedDict(TypedDict):
|
||||
max_output_tokens: NotRequired[Nullable[float]]
|
||||
temperature: 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]
|
||||
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."""
|
||||
@@ -607,14 +603,6 @@ class OpenResponsesRequest(BaseModel):
|
||||
|
||||
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
|
||||
|
||||
image_config: Optional[Dict[str, OpenResponsesRequestImageConfig]] = None
|
||||
@@ -688,10 +676,6 @@ class OpenResponsesRequest(BaseModel):
|
||||
"max_output_tokens",
|
||||
"temperature",
|
||||
"top_p",
|
||||
"top_logprobs",
|
||||
"max_tool_calls",
|
||||
"presence_penalty",
|
||||
"frequency_penalty",
|
||||
"top_k",
|
||||
"image_config",
|
||||
"modalities",
|
||||
@@ -718,10 +702,6 @@ class OpenResponsesRequest(BaseModel):
|
||||
"max_output_tokens",
|
||||
"temperature",
|
||||
"top_p",
|
||||
"top_logprobs",
|
||||
"max_tool_calls",
|
||||
"presence_penalty",
|
||||
"frequency_penalty",
|
||||
"prompt_cache_key",
|
||||
"previous_response_id",
|
||||
"prompt",
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
"""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,50 +6,17 @@ from .openairesponsesannotation import (
|
||||
OpenAIResponsesAnnotationTypedDict,
|
||||
)
|
||||
from openrouter.types import BaseModel
|
||||
import pydantic
|
||||
from typing import List, Literal, Optional
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
from typing_extensions import NotRequired, TypedDict
|
||||
|
||||
|
||||
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):
|
||||
type: ResponseOutputTextType
|
||||
text: str
|
||||
annotations: NotRequired[List[OpenAIResponsesAnnotationTypedDict]]
|
||||
logprobs: NotRequired[List[LogprobTypedDict]]
|
||||
|
||||
|
||||
class ResponseOutputText(BaseModel):
|
||||
@@ -58,5 +25,3 @@ class ResponseOutputText(BaseModel):
|
||||
text: str
|
||||
|
||||
annotations: Optional[List[OpenAIResponsesAnnotation]] = None
|
||||
|
||||
logprobs: Optional[List[Logprob]] = None
|
||||
|
||||
@@ -96,8 +96,6 @@ class GetGenerationDataTypedDict(TypedDict):
|
||||
r"""External user identifier"""
|
||||
api_type: Nullable[APIType]
|
||||
r"""Type of API used for the generation"""
|
||||
router: Nullable[str]
|
||||
r"""Router used for the request (e.g., openrouter/auto)"""
|
||||
|
||||
|
||||
class GetGenerationData(BaseModel):
|
||||
@@ -199,9 +197,6 @@ class GetGenerationData(BaseModel):
|
||||
api_type: Annotated[Nullable[APIType], PlainValidator(validate_open_enum(False))]
|
||||
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")
|
||||
def serialize_model(self, handler):
|
||||
optional_fields = []
|
||||
@@ -231,7 +226,6 @@ class GetGenerationData(BaseModel):
|
||||
"native_finish_reason",
|
||||
"external_user",
|
||||
"api_type",
|
||||
"router",
|
||||
]
|
||||
null_default_fields = []
|
||||
|
||||
|
||||
@@ -57,10 +57,6 @@ class Responses(BaseSDK):
|
||||
max_output_tokens: OptionalNullable[float] = UNSET,
|
||||
temperature: 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,
|
||||
image_config: Optional[
|
||||
Union[
|
||||
@@ -119,10 +115,6 @@ class Responses(BaseSDK):
|
||||
:param max_output_tokens:
|
||||
:param temperature:
|
||||
:param top_p:
|
||||
:param top_logprobs:
|
||||
:param max_tool_calls:
|
||||
:param presence_penalty:
|
||||
:param frequency_penalty:
|
||||
: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 modalities: Output modalities for the response. Supported values are \"text\" and \"image\".
|
||||
@@ -185,10 +177,6 @@ class Responses(BaseSDK):
|
||||
max_output_tokens: OptionalNullable[float] = UNSET,
|
||||
temperature: 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,
|
||||
image_config: Optional[
|
||||
Union[
|
||||
@@ -247,10 +235,6 @@ class Responses(BaseSDK):
|
||||
:param max_output_tokens:
|
||||
:param temperature:
|
||||
:param top_p:
|
||||
:param top_logprobs:
|
||||
:param max_tool_calls:
|
||||
:param presence_penalty:
|
||||
:param frequency_penalty:
|
||||
: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 modalities: Output modalities for the response. Supported values are \"text\" and \"image\".
|
||||
@@ -312,10 +296,6 @@ class Responses(BaseSDK):
|
||||
max_output_tokens: OptionalNullable[float] = UNSET,
|
||||
temperature: 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,
|
||||
image_config: Optional[
|
||||
Union[
|
||||
@@ -374,10 +354,6 @@ class Responses(BaseSDK):
|
||||
:param max_output_tokens:
|
||||
:param temperature:
|
||||
:param top_p:
|
||||
:param top_logprobs:
|
||||
:param max_tool_calls:
|
||||
:param presence_penalty:
|
||||
:param frequency_penalty:
|
||||
: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 modalities: Output modalities for the response. Supported values are \"text\" and \"image\".
|
||||
@@ -434,10 +410,6 @@ class Responses(BaseSDK):
|
||||
max_output_tokens=max_output_tokens,
|
||||
temperature=temperature,
|
||||
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,
|
||||
image_config=image_config,
|
||||
modalities=modalities,
|
||||
@@ -690,10 +662,6 @@ class Responses(BaseSDK):
|
||||
max_output_tokens: OptionalNullable[float] = UNSET,
|
||||
temperature: 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,
|
||||
image_config: Optional[
|
||||
Union[
|
||||
@@ -752,10 +720,6 @@ class Responses(BaseSDK):
|
||||
:param max_output_tokens:
|
||||
:param temperature:
|
||||
:param top_p:
|
||||
:param top_logprobs:
|
||||
:param max_tool_calls:
|
||||
:param presence_penalty:
|
||||
:param frequency_penalty:
|
||||
: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 modalities: Output modalities for the response. Supported values are \"text\" and \"image\".
|
||||
@@ -818,10 +782,6 @@ class Responses(BaseSDK):
|
||||
max_output_tokens: OptionalNullable[float] = UNSET,
|
||||
temperature: 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,
|
||||
image_config: Optional[
|
||||
Union[
|
||||
@@ -880,10 +840,6 @@ class Responses(BaseSDK):
|
||||
:param max_output_tokens:
|
||||
:param temperature:
|
||||
:param top_p:
|
||||
:param top_logprobs:
|
||||
:param max_tool_calls:
|
||||
:param presence_penalty:
|
||||
:param frequency_penalty:
|
||||
: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 modalities: Output modalities for the response. Supported values are \"text\" and \"image\".
|
||||
@@ -945,10 +901,6 @@ class Responses(BaseSDK):
|
||||
max_output_tokens: OptionalNullable[float] = UNSET,
|
||||
temperature: 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,
|
||||
image_config: Optional[
|
||||
Union[
|
||||
@@ -1007,10 +959,6 @@ class Responses(BaseSDK):
|
||||
:param max_output_tokens:
|
||||
:param temperature:
|
||||
:param top_p:
|
||||
:param top_logprobs:
|
||||
:param max_tool_calls:
|
||||
:param presence_penalty:
|
||||
:param frequency_penalty:
|
||||
: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 modalities: Output modalities for the response. Supported values are \"text\" and \"image\".
|
||||
@@ -1067,10 +1015,6 @@ class Responses(BaseSDK):
|
||||
max_output_tokens=max_output_tokens,
|
||||
temperature=temperature,
|
||||
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,
|
||||
image_config=image_config,
|
||||
modalities=modalities,
|
||||
|
||||
Reference in New Issue
Block a user