mirror of
https://github.com/wassname/openrouter-python-sdk-retry-errors.git
synced 2026-07-30 12:20:57 +08:00
more updates
This commit is contained in:
@@ -26,4 +26,5 @@
|
||||
| `tool_choice` | *Optional[Any]* | :heavy_minus_sign: | N/A |
|
||||
| `tools` | List[[components.ToolDefinitionJSON](../components/tooldefinitionjson.md)] | :heavy_minus_sign: | N/A |
|
||||
| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
||||
| `user` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||
| `user` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||
| `debug` | [Optional[components.Debug]](../components/debug.md) | :heavy_minus_sign: | N/A |
|
||||
@@ -33,9 +33,3 @@ value: components.ChatMessageContentItemVideo = /* values here */
|
||||
value: components.ChatMessageContentItemVideo = /* values here */
|
||||
```
|
||||
|
||||
### `components.ChatMessageContentItemFile`
|
||||
|
||||
```python
|
||||
value: components.ChatMessageContentItemFile = /* values here */
|
||||
```
|
||||
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
# ChatMessageContentItemAudioFormat
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ------- | ------- |
|
||||
| `WAV` | wav |
|
||||
| `MP3` | mp3 |
|
||||
| `FLAC` | flac |
|
||||
| `M4A` | m4a |
|
||||
| `OGG` | ogg |
|
||||
| `PCM16` | pcm16 |
|
||||
| `PCM24` | pcm24 |
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
|
||||
| `data` | *str* | :heavy_check_mark: | N/A |
|
||||
| `format_` | [components.ChatMessageContentItemAudioFormat](../components/chatmessagecontentitemaudioformat.md) | :heavy_check_mark: | N/A |
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------ | ------------------ | ------------------ | ------------------ |
|
||||
| `data` | *str* | :heavy_check_mark: | N/A |
|
||||
| `format_` | *str* | :heavy_check_mark: | N/A |
|
||||
@@ -0,0 +1,9 @@
|
||||
# ChatMessageContentItemCacheControl
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ |
|
||||
| `type` | *Literal["ephemeral"]* | :heavy_check_mark: | N/A |
|
||||
| `ttl` | [Optional[components.TTL]](../components/ttl.md) | :heavy_minus_sign: | N/A |
|
||||
@@ -1,9 +0,0 @@
|
||||
# ChatMessageContentItemFile
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- |
|
||||
| `type` | *Literal["file"]* | :heavy_check_mark: | N/A |
|
||||
| `file` | [components.File](../components/file.md) | :heavy_check_mark: | N/A |
|
||||
@@ -3,7 +3,8 @@
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------ | ------------------ | ------------------ | ------------------ |
|
||||
| `type` | *Literal["text"]* | :heavy_check_mark: | N/A |
|
||||
| `text` | *str* | :heavy_check_mark: | N/A |
|
||||
| Field | Type | Required | Description |
|
||||
| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
|
||||
| `type` | *Literal["text"]* | :heavy_check_mark: | N/A |
|
||||
| `text` | *str* | :heavy_check_mark: | N/A |
|
||||
| `cache_control` | [Optional[components.ChatMessageContentItemCacheControl]](../components/chatmessagecontentitemcachecontrol.md) | :heavy_minus_sign: | N/A |
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ |
|
||||
| `type` | *Literal["input_video"]* | :heavy_check_mark: | N/A |
|
||||
| `video_url` | [components.VideoURL](../components/videourl.md) | :heavy_check_mark: | N/A |
|
||||
| Field | Type | Required | Description |
|
||||
| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- |
|
||||
| `type` | *Literal["input_video"]* | :heavy_check_mark: | N/A |
|
||||
| `video_url` | [components.VideoURL1](../components/videourl1.md) | :heavy_check_mark: | N/A |
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
|
||||
| `type` | *Literal["video_url"]* | :heavy_check_mark: | N/A |
|
||||
| `video_url` | [components.ChatMessageContentItemVideoVideoURLVideoURL](../components/chatmessagecontentitemvideovideourlvideourl.md) | :heavy_check_mark: | N/A |
|
||||
| Field | Type | Required | Description |
|
||||
| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- |
|
||||
| `type` | *Literal["video_url"]* | :heavy_check_mark: | N/A |
|
||||
| `video_url` | [components.VideoURL2](../components/videourl2.md) | :heavy_check_mark: | N/A |
|
||||
@@ -8,4 +8,6 @@
|
||||
| `text` | *str* | :heavy_check_mark: | N/A |
|
||||
| `index` | *float* | :heavy_check_mark: | N/A |
|
||||
| `logprobs` | [Nullable[components.CompletionLogprobs]](../components/completionlogprobs.md) | :heavy_check_mark: | N/A |
|
||||
| `finish_reason` | [Nullable[components.CompletionFinishReason]](../components/completionfinishreason.md) | :heavy_check_mark: | N/A |
|
||||
| `finish_reason` | [Nullable[components.CompletionFinishReason]](../components/completionfinishreason.md) | :heavy_check_mark: | N/A |
|
||||
| `native_finish_reason` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||
| `reasoning` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
|
||||
@@ -9,6 +9,7 @@
|
||||
| `object` | *Literal["text_completion"]* | :heavy_check_mark: | N/A |
|
||||
| `created` | *float* | :heavy_check_mark: | N/A |
|
||||
| `model` | *str* | :heavy_check_mark: | N/A |
|
||||
| `provider` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||
| `system_fingerprint` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||
| `choices` | List[[components.CompletionChoice](../components/completionchoice.md)] | :heavy_check_mark: | N/A |
|
||||
| `usage` | [Optional[components.CompletionUsage]](../components/completionusage.md) | :heavy_minus_sign: | N/A |
|
||||
@@ -0,0 +1,8 @@
|
||||
# Debug
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| -------------------- | -------------------- | -------------------- | -------------------- |
|
||||
| `echo_upstream_body` | *Optional[bool]* | :heavy_minus_sign: | N/A |
|
||||
@@ -1,10 +0,0 @@
|
||||
# File
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------ | ------------------ | ------------------ | ------------------ |
|
||||
| `file_data` | *str* | :heavy_check_mark: | N/A |
|
||||
| `file_id` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||
| `filename` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||
@@ -0,0 +1,8 @@
|
||||
# IDResponseHealing
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ------------------ | ------------------ |
|
||||
| `RESPONSE_HEALING` | response-healing |
|
||||
@@ -27,10 +27,11 @@ Request schema for Responses endpoint
|
||||
| `include` | List[[components.OpenAIResponsesIncludable](../components/openairesponsesincludable.md)] | :heavy_minus_sign: | N/A | |
|
||||
| `background` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | |
|
||||
| `safety_identifier` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
|
||||
| `store` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | |
|
||||
| `service_tier` | [OptionalNullable[components.ServiceTier]](../components/servicetier.md) | :heavy_minus_sign: | N/A | auto |
|
||||
| `store` | *Optional[Literal[False]]* | :heavy_minus_sign: | N/A | |
|
||||
| `service_tier` | [Optional[components.ServiceTier]](../components/servicetier.md) | :heavy_minus_sign: | N/A | |
|
||||
| `truncation` | [OptionalNullable[components.Truncation]](../components/truncation.md) | :heavy_minus_sign: | N/A | auto |
|
||||
| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | |
|
||||
| `provider` | [OptionalNullable[components.Provider]](../components/provider.md) | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | |
|
||||
| `plugins` | List[[components.Plugin](../components/plugin.md)] | :heavy_minus_sign: | Plugins you want to enable for this request, including their settings. | |
|
||||
| `user` | *Optional[str]* | :heavy_minus_sign: | A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters. | |
|
||||
| `user` | *Optional[str]* | :heavy_minus_sign: | A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters. | |
|
||||
| `session_id` | *Optional[str]* | :heavy_minus_sign: | A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters. | |
|
||||
@@ -21,3 +21,9 @@ value: components.PluginWeb = /* values here */
|
||||
value: components.PluginFileParser = /* values here */
|
||||
```
|
||||
|
||||
### `components.PluginResponseHealing`
|
||||
|
||||
```python
|
||||
value: components.PluginResponseHealing = /* values here */
|
||||
```
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
# PluginResponseHealing
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ |
|
||||
| `id` | [components.IDResponseHealing](../components/idresponsehealing.md) | :heavy_check_mark: | N/A |
|
||||
@@ -9,12 +9,14 @@
|
||||
| `AION_LABS` | AionLabs |
|
||||
| `ALIBABA` | Alibaba |
|
||||
| `AMAZON_BEDROCK` | Amazon Bedrock |
|
||||
| `AMAZON_NOVA` | Amazon Nova |
|
||||
| `ANTHROPIC` | Anthropic |
|
||||
| `ARCEE` | Arcee |
|
||||
| `ARCEE_AI` | Arcee AI |
|
||||
| `ATLAS_CLOUD` | AtlasCloud |
|
||||
| `AVIAN` | Avian |
|
||||
| `AZURE` | Azure |
|
||||
| `BASE_TEN` | BaseTen |
|
||||
| `BYTE_PLUS` | BytePlus |
|
||||
| `BLACK_FOREST_LABS` | Black Forest Labs |
|
||||
| `CEREBRAS` | Cerebras |
|
||||
| `CHUTES` | Chutes |
|
||||
@@ -29,6 +31,7 @@
|
||||
| `FIREWORKS` | Fireworks |
|
||||
| `FRIENDLI` | Friendli |
|
||||
| `GMI_CLOUD` | GMICloud |
|
||||
| `GO_POMELO` | GoPomelo |
|
||||
| `GOOGLE` | Google |
|
||||
| `GOOGLE_AI_STUDIO` | Google AI Studio |
|
||||
| `GROQ` | Groq |
|
||||
@@ -58,7 +61,9 @@
|
||||
| `RELACE` | Relace |
|
||||
| `SAMBA_NOVA` | SambaNova |
|
||||
| `SILICON_FLOW` | SiliconFlow |
|
||||
| `SOURCEFUL` | Sourceful |
|
||||
| `STEALTH` | Stealth |
|
||||
| `STREAM_LAKE` | StreamLake |
|
||||
| `SWITCHPOINT` | Switchpoint |
|
||||
| `TARGON` | Targon |
|
||||
| `TOGETHER` | Together |
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ---------- | ---------- |
|
||||
| `AUTO` | auto |
|
||||
| `DEFAULT` | default |
|
||||
| `FLEX` | flex |
|
||||
| `PRIORITY` | priority |
|
||||
| `SCALE` | scale |
|
||||
| Name | Value |
|
||||
| ------ | ------ |
|
||||
| `AUTO` | auto |
|
||||
@@ -0,0 +1,9 @@
|
||||
# TTL
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ------- | ------- |
|
||||
| `FIVEM` | 5m |
|
||||
| `ONEH` | 1h |
|
||||
@@ -1,4 +1,4 @@
|
||||
# VideoURL
|
||||
# VideoURL1
|
||||
|
||||
|
||||
## Fields
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# ChatMessageContentItemVideoVideoURLVideoURL
|
||||
# VideoURL2
|
||||
|
||||
|
||||
## Fields
|
||||
@@ -0,0 +1,9 @@
|
||||
# GetCreditsData
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ----------------------- | ----------------------- | ----------------------- | ----------------------- | ----------------------- |
|
||||
| `total_credits` | *float* | :heavy_check_mark: | Total credits purchased | 100.5 |
|
||||
| `total_usage` | *float* | :heavy_check_mark: | Total credits used | 25.75 |
|
||||
@@ -5,5 +5,6 @@ Total credits purchased and used
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ----------- | ----------- | ----------- | ----------- |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
|
||||
| `data` | [operations.GetCreditsData](../operations/getcreditsdata.md) | :heavy_check_mark: | N/A | {<br/>"total_credits": 100.5,<br/>"total_usage": 25.75<br/>} |
|
||||
@@ -9,12 +9,14 @@
|
||||
| `AION_LABS` | AionLabs |
|
||||
| `ALIBABA` | Alibaba |
|
||||
| `AMAZON_BEDROCK` | Amazon Bedrock |
|
||||
| `AMAZON_NOVA` | Amazon Nova |
|
||||
| `ANTHROPIC` | Anthropic |
|
||||
| `ARCEE` | Arcee |
|
||||
| `ARCEE_AI` | Arcee AI |
|
||||
| `ATLAS_CLOUD` | AtlasCloud |
|
||||
| `AVIAN` | Avian |
|
||||
| `AZURE` | Azure |
|
||||
| `BASE_TEN` | BaseTen |
|
||||
| `BYTE_PLUS` | BytePlus |
|
||||
| `BLACK_FOREST_LABS` | Black Forest Labs |
|
||||
| `CEREBRAS` | Cerebras |
|
||||
| `CHUTES` | Chutes |
|
||||
@@ -29,6 +31,7 @@
|
||||
| `FIREWORKS` | Fireworks |
|
||||
| `FRIENDLI` | Friendli |
|
||||
| `GMI_CLOUD` | GMICloud |
|
||||
| `GO_POMELO` | GoPomelo |
|
||||
| `GOOGLE` | Google |
|
||||
| `GOOGLE_AI_STUDIO` | Google AI Studio |
|
||||
| `GROQ` | Groq |
|
||||
@@ -58,7 +61,9 @@
|
||||
| `RELACE` | Relace |
|
||||
| `SAMBA_NOVA` | SambaNova |
|
||||
| `SILICON_FLOW` | SiliconFlow |
|
||||
| `SOURCEFUL` | Sourceful |
|
||||
| `STEALTH` | Stealth |
|
||||
| `STREAM_LAKE` | StreamLake |
|
||||
| `SWITCHPOINT` | Switchpoint |
|
||||
| `TARGON` | Targon |
|
||||
| `TOGETHER` | Together |
|
||||
|
||||
@@ -58,6 +58,7 @@ with OpenRouter(
|
||||
| `tools` | List[[components.ToolDefinitionJSON](../../components/tooldefinitionjson.md)] | :heavy_minus_sign: | N/A |
|
||||
| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
||||
| `user` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||
| `debug` | [Optional[components.Debug]](../../components/debug.md) | :heavy_minus_sign: | N/A |
|
||||
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
||||
|
||||
### Response
|
||||
|
||||
@@ -25,7 +25,7 @@ with OpenRouter(
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
|
||||
res = open_router.beta.responses.send(stream=False)
|
||||
res = open_router.beta.responses.send(service_tier="auto", stream=False)
|
||||
|
||||
with res as event_stream:
|
||||
for event in event_stream:
|
||||
@@ -58,13 +58,13 @@ with OpenRouter(
|
||||
| `include` | List[[components.OpenAIResponsesIncludable](../../components/openairesponsesincludable.md)] | :heavy_minus_sign: | N/A | |
|
||||
| `background` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | |
|
||||
| `safety_identifier` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
|
||||
| `store` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | |
|
||||
| `service_tier` | [OptionalNullable[components.ServiceTier]](../../components/servicetier.md) | :heavy_minus_sign: | N/A | auto |
|
||||
| `service_tier` | [Optional[components.ServiceTier]](../../components/servicetier.md) | :heavy_minus_sign: | N/A | |
|
||||
| `truncation` | [OptionalNullable[components.Truncation]](../../components/truncation.md) | :heavy_minus_sign: | N/A | auto |
|
||||
| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | |
|
||||
| `provider` | [OptionalNullable[components.Provider]](../../components/provider.md) | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | |
|
||||
| `plugins` | List[[components.Plugin](../../components/plugin.md)] | :heavy_minus_sign: | Plugins you want to enable for this request, including their settings. | |
|
||||
| `user` | *Optional[str]* | :heavy_minus_sign: | A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters. | |
|
||||
| `session_id` | *Optional[str]* | :heavy_minus_sign: | A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters. | |
|
||||
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
|
||||
|
||||
### Response
|
||||
|
||||
Reference in New Issue
Block a user