mirror of
https://github.com/wassname/openrouter-python-sdk-retry-errors.git
synced 2026-07-31 12:30:30 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2ad2a4508e | ||
|
|
b2098ff28e | ||
|
|
1cad51abb6 | ||
|
|
0c791b04d1 | ||
|
|
5f2c0ee2ea | ||
|
|
5832c0495b | ||
|
|
f5dfc30997 | ||
|
|
a56ffbf5f3 | ||
|
|
cc2b002c5c | ||
|
|
9774c726fd | ||
|
|
3a40848aab | ||
|
|
f190e3f950 | ||
|
|
d433ce35e8 | ||
|
|
61e5216764 |
@@ -1,7 +1,9 @@
|
|||||||
{
|
{
|
||||||
"permissions": {
|
"permissions": {
|
||||||
"allow": [
|
"allow": [
|
||||||
"Bash(python3:*)"
|
"Bash(python3:*)",
|
||||||
|
"Bash(git push:*)",
|
||||||
|
"Bash(gh pr create:*)"
|
||||||
],
|
],
|
||||||
"deny": [],
|
"deny": [],
|
||||||
"ask": []
|
"ask": []
|
||||||
|
|||||||
+517
-104
File diff suppressed because it is too large
Load Diff
+3
-1
@@ -31,7 +31,7 @@ generation:
|
|||||||
skipResponseBodyAssertions: false
|
skipResponseBodyAssertions: false
|
||||||
preApplyUnionDiscriminators: true
|
preApplyUnionDiscriminators: true
|
||||||
python:
|
python:
|
||||||
version: 0.0.21
|
version: 0.7.8
|
||||||
additionalDependencies:
|
additionalDependencies:
|
||||||
dev: {}
|
dev: {}
|
||||||
main: {}
|
main: {}
|
||||||
@@ -39,6 +39,8 @@ python:
|
|||||||
- id
|
- id
|
||||||
- object
|
- object
|
||||||
- input
|
- input
|
||||||
|
- models
|
||||||
|
- hash
|
||||||
asyncMode: both
|
asyncMode: both
|
||||||
authors:
|
authors:
|
||||||
- OpenRouter
|
- OpenRouter
|
||||||
|
|||||||
+7439
-1557
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,10 @@
|
|||||||
|
lintVersion: 1.0.0
|
||||||
|
defaultRuleset: openrouter
|
||||||
|
rulesets:
|
||||||
|
openrouter:
|
||||||
|
rulesets:
|
||||||
|
- speakeasy-recommended
|
||||||
|
- speakeasy-generation
|
||||||
|
rules:
|
||||||
|
oas3-missing-example:
|
||||||
|
severity: "off"
|
||||||
+7495
-1554
File diff suppressed because it is too large
Load Diff
@@ -33,3 +33,11 @@ actions:
|
|||||||
type: string
|
type: string
|
||||||
description: |
|
description: |
|
||||||
The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||||
|
|
||||||
|
# Add header parameters to all paths so Speakeasy matches them with globals
|
||||||
|
- target: $.paths[*]
|
||||||
|
description: Reference app identification headers on all paths so Speakeasy injects them via globals
|
||||||
|
update:
|
||||||
|
parameters:
|
||||||
|
- $ref: "#/components/parameters/AppIdentifier"
|
||||||
|
- $ref: "#/components/parameters/AppDisplayName"
|
||||||
|
|||||||
@@ -2,23 +2,26 @@ speakeasyVersion: 1.666.0
|
|||||||
sources:
|
sources:
|
||||||
-OAS:
|
-OAS:
|
||||||
sourceNamespace: open-router-chat-completions-api
|
sourceNamespace: open-router-chat-completions-api
|
||||||
sourceRevisionDigest: sha256:f1b59b9b643de5e20d6e3299a8274783d8c0854615876f5d7f6f081814842695
|
sourceRevisionDigest: sha256:01256c8494de6bfc13c36d82ae316a6a13d402194f844618bcd4d59e34f325f3
|
||||||
sourceBlobDigest: sha256:ee1f2422281b3ed5b38951c74636ad192c9bb160f216069c1f7931ccc4e52553
|
sourceBlobDigest: sha256:4c80e48fd5e1cd030e68d664eb93984b4d5946867252ff1755a2bd2a05eccd4e
|
||||||
tags:
|
tags:
|
||||||
- latest
|
- latest
|
||||||
OpenRouter API:
|
OpenRouter API:
|
||||||
sourceNamespace: open-router-chat-completions-api
|
sourceNamespace: open-router-chat-completions-api
|
||||||
sourceRevisionDigest: sha256:9b410c8cfafe475dc6d9550f97a1e755b9a02b54513d3a85efe606e9bb05ca57
|
sourceRevisionDigest: sha256:a3034772624fc11a890e6f565c3b098739adb96956c73135e3657329c2849f94
|
||||||
sourceBlobDigest: sha256:61a2d897cc5ddd893a5131bfacad7fcc311fe5b2eaaa5641fbb0a5b3321bfde7
|
sourceBlobDigest: sha256:ab42c91f594ab94318c39aeb198f94752b11c18690aaf5e664f133c911d0f16e
|
||||||
tags:
|
tags:
|
||||||
- latest
|
- latest
|
||||||
|
- main
|
||||||
- 1.0.0
|
- 1.0.0
|
||||||
targets:
|
targets:
|
||||||
open-router:
|
open-router:
|
||||||
source: OpenRouter API
|
source: OpenRouter API
|
||||||
sourceNamespace: open-router-chat-completions-api
|
sourceNamespace: open-router-chat-completions-api
|
||||||
sourceRevisionDigest: sha256:9b410c8cfafe475dc6d9550f97a1e755b9a02b54513d3a85efe606e9bb05ca57
|
sourceRevisionDigest: sha256:a3034772624fc11a890e6f565c3b098739adb96956c73135e3657329c2849f94
|
||||||
sourceBlobDigest: sha256:61a2d897cc5ddd893a5131bfacad7fcc311fe5b2eaaa5641fbb0a5b3321bfde7
|
sourceBlobDigest: sha256:ab42c91f594ab94318c39aeb198f94752b11c18690aaf5e664f133c911d0f16e
|
||||||
|
codeSamplesNamespace: open-router-python-code-samples
|
||||||
|
codeSamplesRevisionDigest: sha256:c84394bb86c10b0ae9abc3a94035ba58aa1f3b52be5b84df50c15d2fe631e8f1
|
||||||
workflow:
|
workflow:
|
||||||
workflowVersion: 1.0.0
|
workflowVersion: 1.0.0
|
||||||
speakeasyVersion: 1.666.0
|
speakeasyVersion: 1.666.0
|
||||||
@@ -42,7 +45,7 @@ workflow:
|
|||||||
token: $pypi_token
|
token: $pypi_token
|
||||||
codeSamples:
|
codeSamples:
|
||||||
registry:
|
registry:
|
||||||
location: registry.speakeasyapi.dev/openrouter/sdk/-oas-python-code-samples
|
location: registry.speakeasyapi.dev/openrouter/sdk/open-router-python-code-samples
|
||||||
labelOverride:
|
labelOverride:
|
||||||
fixedValue: Python (SDK)
|
fixedValue: Python (SDK)
|
||||||
blocking: false
|
blocking: false
|
||||||
|
|||||||
@@ -182,6 +182,8 @@ import os
|
|||||||
def main():
|
def main():
|
||||||
|
|
||||||
with OpenRouter(
|
with OpenRouter(
|
||||||
|
http_referer="<value>",
|
||||||
|
x_title="<value>",
|
||||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||||
) as open_router:
|
) as open_router:
|
||||||
# Rest of application here...
|
# Rest of application here...
|
||||||
@@ -191,6 +193,8 @@ def main():
|
|||||||
async def amain():
|
async def amain():
|
||||||
|
|
||||||
async with OpenRouter(
|
async with OpenRouter(
|
||||||
|
http_referer="<value>",
|
||||||
|
x_title="<value>",
|
||||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||||
) as open_router:
|
) as open_router:
|
||||||
# Rest of application here...
|
# Rest of application here...
|
||||||
|
|||||||
@@ -182,6 +182,8 @@ import os
|
|||||||
def main():
|
def main():
|
||||||
|
|
||||||
with OpenRouter(
|
with OpenRouter(
|
||||||
|
http_referer="<value>",
|
||||||
|
x_title="<value>",
|
||||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||||
) as open_router:
|
) as open_router:
|
||||||
# Rest of application here...
|
# Rest of application here...
|
||||||
@@ -191,6 +193,8 @@ def main():
|
|||||||
async def amain():
|
async def amain():
|
||||||
|
|
||||||
async with OpenRouter(
|
async with OpenRouter(
|
||||||
|
http_referer="<value>",
|
||||||
|
x_title="<value>",
|
||||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||||
) as open_router:
|
) as open_router:
|
||||||
# Rest of application here...
|
# Rest of application here...
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ import os
|
|||||||
|
|
||||||
|
|
||||||
with OpenRouter(
|
with OpenRouter(
|
||||||
|
http_referer="<value>",
|
||||||
|
x_title="<value>",
|
||||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||||
) as open_router:
|
) as open_router:
|
||||||
|
|
||||||
@@ -30,6 +32,8 @@ import os
|
|||||||
async def main():
|
async def main():
|
||||||
|
|
||||||
async with OpenRouter(
|
async with OpenRouter(
|
||||||
|
http_referer="<value>",
|
||||||
|
x_title="<value>",
|
||||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||||
) as open_router:
|
) as open_router:
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,17 @@
|
|||||||
# AssistantMessage
|
# AssistantMessage
|
||||||
|
|
||||||
|
Assistant message for requests and responses
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
| Field | Type | Required | Description | Example |
|
||||||
| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
|
| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
|
||||||
| `role` | *Literal["assistant"]* | :heavy_check_mark: | N/A |
|
| `role` | [components.AssistantMessageRole](../components/assistantmessagerole.md) | :heavy_check_mark: | N/A | |
|
||||||
| `content` | [OptionalNullable[components.AssistantMessageContent]](../components/assistantmessagecontent.md) | :heavy_minus_sign: | N/A |
|
| `content` | [OptionalNullable[components.AssistantMessageContent]](../components/assistantmessagecontent.md) | :heavy_minus_sign: | Assistant message content | |
|
||||||
| `name` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
| `name` | *Optional[str]* | :heavy_minus_sign: | Optional name for the assistant | |
|
||||||
| `tool_calls` | List[[components.ChatMessageToolCall](../components/chatmessagetoolcall.md)] | :heavy_minus_sign: | N/A |
|
| `tool_calls` | List[[components.ChatMessageToolCall](../components/chatmessagetoolcall.md)] | :heavy_minus_sign: | Tool calls made by the assistant | |
|
||||||
| `refusal` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
|
| `refusal` | *OptionalNullable[str]* | :heavy_minus_sign: | Refusal message if content was refused | |
|
||||||
| `reasoning` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
|
| `reasoning` | *OptionalNullable[str]* | :heavy_minus_sign: | Reasoning output | |
|
||||||
|
| `reasoning_details` | List[[components.ReasoningDetailUnion](../components/reasoningdetailunion.md)] | :heavy_minus_sign: | Reasoning details for extended thinking models | |
|
||||||
|
| `images` | List[[components.AssistantMessageImages](../components/assistantmessageimages.md)] | :heavy_minus_sign: | Generated images from image generation models | [<br/>{<br/>"image_url": {<br/>"url": "data:image/png;base64,iVBORw0KGgo..."<br/>}<br/>}<br/>] |
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
# AssistantMessageContent
|
# AssistantMessageContent
|
||||||
|
|
||||||
|
Assistant message content
|
||||||
|
|
||||||
|
|
||||||
## Supported Types
|
## Supported Types
|
||||||
|
|
||||||
@@ -15,3 +17,9 @@ value: str = /* values here */
|
|||||||
value: List[components.ChatMessageContentItem] = /* values here */
|
value: List[components.ChatMessageContentItem] = /* values here */
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### `Any`
|
||||||
|
|
||||||
|
```python
|
||||||
|
value: Any = /* values here */
|
||||||
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# AssistantMessageImages
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
|
||||||
|
| `image_url` | [components.AssistantMessageImagesImageURL](../components/assistantmessageimagesimageurl.md) | :heavy_check_mark: | N/A |
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# AssistantMessageImagesImageURL
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- |
|
||||||
|
| `url` | *str* | :heavy_check_mark: | URL or base64-encoded data of the generated image |
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# AssistantMessageRole
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ----------- | ----------- |
|
||||||
|
| `ASSISTANT` | assistant |
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# By
|
||||||
|
|
||||||
|
The provider sorting strategy (price, throughput, latency)
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ------------ | ------------ |
|
||||||
|
| `PRICE` | price |
|
||||||
|
| `THROUGHPUT` | throughput |
|
||||||
|
| `LATENCY` | latency |
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
# ChatErrorError
|
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
|
||||||
| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- |
|
|
||||||
| `code` | [Nullable[components.Code]](../components/code.md) | :heavy_check_mark: | N/A |
|
|
||||||
| `message` | *str* | :heavy_check_mark: | N/A |
|
|
||||||
| `param` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
|
|
||||||
| `type` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
|
|
||||||
@@ -1,30 +1,39 @@
|
|||||||
# ChatGenerationParams
|
# ChatGenerationParams
|
||||||
|
|
||||||
|
Chat completion request parameters
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
| Field | Type | Required | Description | Example |
|
||||||
| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ |
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `messages` | List[[components.Message](../components/message.md)] | :heavy_check_mark: | N/A |
|
| `provider` | [OptionalNullable[components.ChatGenerationParamsProvider]](../components/chatgenerationparamsprovider.md) | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | |
|
||||||
| `model` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
| `plugins` | List[[components.ChatGenerationParamsPluginUnion](../components/chatgenerationparamspluginunion.md)] | :heavy_minus_sign: | Plugins you want to enable for this request, including their settings. | |
|
||||||
| `models` | List[*str*] | :heavy_minus_sign: | N/A |
|
| `user` | *Optional[str]* | :heavy_minus_sign: | Unique user identifier | user-123 |
|
||||||
| `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
| `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. | |
|
||||||
| `logit_bias` | Dict[str, *float*] | :heavy_minus_sign: | N/A |
|
| `trace` | [Optional[components.ChatGenerationParamsTrace]](../components/chatgenerationparamstrace.md) | :heavy_minus_sign: | Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. | |
|
||||||
| `logprobs` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A |
|
| `messages` | List[[components.Message](../components/message.md)] | :heavy_check_mark: | List of messages for the conversation | [<br/>{<br/>"role": "user",<br/>"content": "Hello!"<br/>}<br/>] |
|
||||||
| `top_logprobs` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
| `model` | *Optional[str]* | :heavy_minus_sign: | Model to use for completion | openai/gpt-4 |
|
||||||
| `max_completion_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
| `models` | List[*str*] | :heavy_minus_sign: | Models to use for completion | [<br/>"openai/gpt-4",<br/>"openai/gpt-4o"<br/>] |
|
||||||
| `max_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
| `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | Frequency penalty (-2.0 to 2.0) | 0 |
|
||||||
| `metadata` | Dict[str, *str*] | :heavy_minus_sign: | N/A |
|
| `logit_bias` | Dict[str, *float*] | :heavy_minus_sign: | Token logit bias adjustments | {<br/>"50256": -100<br/>} |
|
||||||
| `presence_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
| `logprobs` | *OptionalNullable[bool]* | :heavy_minus_sign: | Return log probabilities | false |
|
||||||
| `reasoning` | [Optional[components.Reasoning]](../components/reasoning.md) | :heavy_minus_sign: | N/A |
|
| `top_logprobs` | *OptionalNullable[float]* | :heavy_minus_sign: | Number of top log probabilities to return (0-20) | 5 |
|
||||||
| `response_format` | [Optional[components.ChatGenerationParamsResponseFormatUnion]](../components/chatgenerationparamsresponseformatunion.md) | :heavy_minus_sign: | N/A |
|
| `max_completion_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum tokens in completion | 100 |
|
||||||
| `seed` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A |
|
| `max_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum tokens (deprecated, use max_completion_tokens) | 100 |
|
||||||
| `stop` | [OptionalNullable[components.ChatGenerationParamsStop]](../components/chatgenerationparamsstop.md) | :heavy_minus_sign: | N/A |
|
| `metadata` | Dict[str, *str*] | :heavy_minus_sign: | Key-value pairs for additional object information (max 16 pairs, 64 char keys, 512 char values) | {<br/>"user_id": "user-123",<br/>"session_id": "session-456"<br/>} |
|
||||||
| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A |
|
| `presence_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | Presence penalty (-2.0 to 2.0) | 0 |
|
||||||
| `stream_options` | [OptionalNullable[components.ChatStreamOptions]](../components/chatstreamoptions.md) | :heavy_minus_sign: | N/A |
|
| `reasoning` | [Optional[components.Reasoning]](../components/reasoning.md) | :heavy_minus_sign: | Configuration options for reasoning models | {<br/>"effort": "medium",<br/>"summary": "concise"<br/>} |
|
||||||
| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
| `response_format` | [Optional[components.ResponseFormat]](../components/responseformat.md) | :heavy_minus_sign: | Response format configuration | {<br/>"type": "json_object"<br/>} |
|
||||||
| `tool_choice` | *Optional[Any]* | :heavy_minus_sign: | N/A |
|
| `seed` | *OptionalNullable[int]* | :heavy_minus_sign: | Random seed for deterministic outputs | 42 |
|
||||||
| `tools` | List[[components.ToolDefinitionJSON](../components/tooldefinitionjson.md)] | :heavy_minus_sign: | N/A |
|
| `stop` | [OptionalNullable[components.Stop]](../components/stop.md) | :heavy_minus_sign: | Stop sequences (up to 4) | [<br/>""<br/>] |
|
||||||
| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
| `stream` | *Optional[bool]* | :heavy_minus_sign: | Enable streaming response | false |
|
||||||
| `user` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
| `stream_options` | [OptionalNullable[components.ChatStreamOptions]](../components/chatstreamoptions.md) | :heavy_minus_sign: | Streaming configuration options | {<br/>"include_usage": true<br/>} |
|
||||||
| `debug` | [Optional[components.Debug]](../components/debug.md) | :heavy_minus_sign: | N/A |
|
| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | Sampling temperature (0-2) | 0.7 |
|
||||||
|
| `parallel_tool_calls` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | |
|
||||||
|
| `tool_choice` | [Optional[components.ToolChoiceOption]](../components/toolchoiceoption.md) | :heavy_minus_sign: | Tool choice configuration | auto |
|
||||||
|
| `tools` | List[[components.ToolDefinitionJSON](../components/tooldefinitionjson.md)] | :heavy_minus_sign: | Available tools for function calling | [<br/>{<br/>"type": "function",<br/>"function": {<br/>"name": "get_weather",<br/>"description": "Get weather"<br/>}<br/>}<br/>] |
|
||||||
|
| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | Nucleus sampling parameter (0-1) | 1 |
|
||||||
|
| `debug` | [Optional[components.DebugOptions]](../components/debugoptions.md) | :heavy_minus_sign: | Debug options for inspecting request transformations (streaming only) | {<br/>"echo_upstream_body": true<br/>} |
|
||||||
|
| `image_config` | Dict[str, [components.ChatGenerationParamsImageConfig](../components/chatgenerationparamsimageconfig.md)] | :heavy_minus_sign: | Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. | {<br/>"aspect_ratio": "16:9"<br/>} |
|
||||||
|
| `modalities` | List[[components.Modality](../components/modality.md)] | :heavy_minus_sign: | Output modalities for the response. Supported values are "text" and "image". | [<br/>"text",<br/>"image"<br/>] |
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# ChatGenerationParamsBy
|
||||||
|
|
||||||
|
The provider sorting strategy (price, throughput, latency)
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ------------ | ------------ |
|
||||||
|
| `PRICE` | price |
|
||||||
|
| `THROUGHPUT` | throughput |
|
||||||
|
| `LATENCY` | latency |
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
# Engine
|
# ChatGenerationParamsEngine
|
||||||
|
|
||||||
|
|
||||||
## Values
|
## Values
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# ChatGenerationParamsIDAutoRouter
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ------------- | ------------- |
|
||||||
|
| `AUTO_ROUTER` | auto-router |
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
# IDFileParser
|
# ChatGenerationParamsIDFileParser
|
||||||
|
|
||||||
|
|
||||||
## Values
|
## Values
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
# IDModeration
|
# ChatGenerationParamsIDModeration
|
||||||
|
|
||||||
|
|
||||||
## Values
|
## Values
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
# IDResponseHealing
|
# ChatGenerationParamsIDResponseHealing
|
||||||
|
|
||||||
|
|
||||||
## Values
|
## Values
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
# IDWeb
|
# ChatGenerationParamsIDWeb
|
||||||
|
|
||||||
|
|
||||||
## Values
|
## Values
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
# ChatGenerationParamsIgnore
|
||||||
|
|
||||||
|
|
||||||
|
## Supported Types
|
||||||
|
|
||||||
|
### `components.ProviderName`
|
||||||
|
|
||||||
|
```python
|
||||||
|
value: components.ProviderName = /* values here */
|
||||||
|
```
|
||||||
|
|
||||||
|
### `str`
|
||||||
|
|
||||||
|
```python
|
||||||
|
value: str = /* values here */
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
# ChatGenerationParamsImageConfig
|
||||||
|
|
||||||
|
|
||||||
|
## Supported Types
|
||||||
|
|
||||||
|
### `str`
|
||||||
|
|
||||||
|
```python
|
||||||
|
value: str = /* values here */
|
||||||
|
```
|
||||||
|
|
||||||
|
### `float`
|
||||||
|
|
||||||
|
```python
|
||||||
|
value: float = /* values here */
|
||||||
|
```
|
||||||
|
|
||||||
|
### `List[Nullable[Any]]`
|
||||||
|
|
||||||
|
```python
|
||||||
|
value: List[Nullable[Any]] = /* values here */
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
# ChatGenerationParamsMaxPrice
|
||||||
|
|
||||||
|
The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- |
|
||||||
|
| `prompt` | *Optional[str]* | :heavy_minus_sign: | Price per million prompt tokens | 1000 |
|
||||||
|
| `completion` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
|
||||||
|
| `image` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
|
||||||
|
| `audio` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
|
||||||
|
| `request` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
# ChatGenerationParamsOnly
|
||||||
|
|
||||||
|
|
||||||
|
## Supported Types
|
||||||
|
|
||||||
|
### `components.ProviderName`
|
||||||
|
|
||||||
|
```python
|
||||||
|
value: components.ProviderName = /* values here */
|
||||||
|
```
|
||||||
|
|
||||||
|
### `str`
|
||||||
|
|
||||||
|
```python
|
||||||
|
value: str = /* values here */
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
# ChatGenerationParamsOrder
|
||||||
|
|
||||||
|
|
||||||
|
## Supported Types
|
||||||
|
|
||||||
|
### `components.ProviderName`
|
||||||
|
|
||||||
|
```python
|
||||||
|
value: components.ProviderName = /* values here */
|
||||||
|
```
|
||||||
|
|
||||||
|
### `str`
|
||||||
|
|
||||||
|
```python
|
||||||
|
value: str = /* values here */
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
# ChatGenerationParamsPartition
|
||||||
|
|
||||||
|
Partitioning strategy for sorting: "model" (default) groups endpoints by model before sorting (fallback models remain fallbacks), "none" sorts all endpoints together regardless of model.
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ------- | ------- |
|
||||||
|
| `MODEL` | model |
|
||||||
|
| `NONE` | none |
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# ChatGenerationParamsPdf
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
|
||||||
|
| `engine` | [Optional[components.ChatGenerationParamsPdfEngine]](../components/chatgenerationparamspdfengine.md) | :heavy_minus_sign: | N/A |
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
# PdfEngine
|
# ChatGenerationParamsPdfEngine
|
||||||
|
|
||||||
|
|
||||||
## Values
|
## Values
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
# ChatGenerationParamsPluginAutoRouter
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `id` | [components.ChatGenerationParamsIDAutoRouter](../components/chatgenerationparamsidautorouter.md) | :heavy_check_mark: | N/A | |
|
||||||
|
| `enabled` | *Optional[bool]* | :heavy_minus_sign: | Set to false to disable the auto-router plugin for this request. Defaults to true. | |
|
||||||
|
| `allowed_models` | List[*str*] | :heavy_minus_sign: | List of model patterns to filter which models the auto-router can route between. Supports wildcards (e.g., "anthropic/*" matches all Anthropic models). When not specified, uses the default supported models list. | [<br/>"anthropic/*",<br/>"openai/gpt-4o",<br/>"google/*"<br/>] |
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
# ChatGenerationParamsPluginFileParser
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
|
||||||
|
| `id` | [components.ChatGenerationParamsIDFileParser](../components/chatgenerationparamsidfileparser.md) | :heavy_check_mark: | N/A |
|
||||||
|
| `enabled` | *Optional[bool]* | :heavy_minus_sign: | Set to false to disable the file-parser plugin for this request. Defaults to true. |
|
||||||
|
| `pdf` | [Optional[components.PDFParserOptions]](../components/pdfparseroptions.md) | :heavy_minus_sign: | Options for PDF parsing. |
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# ChatGenerationParamsPluginModeration
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
|
||||||
|
| `id` | [components.ChatGenerationParamsIDModeration](../components/chatgenerationparamsidmoderation.md) | :heavy_check_mark: | N/A |
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
# ChatGenerationParamsPluginResponseHealing
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `id` | [components.ChatGenerationParamsIDResponseHealing](../components/chatgenerationparamsidresponsehealing.md) | :heavy_check_mark: | N/A |
|
||||||
|
| `enabled` | *Optional[bool]* | :heavy_minus_sign: | Set to false to disable the response-healing plugin for this request. Defaults to true. |
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
# ChatGenerationParamsPluginUnion
|
||||||
|
|
||||||
|
|
||||||
|
## Supported Types
|
||||||
|
|
||||||
|
### `components.ChatGenerationParamsPluginAutoRouter`
|
||||||
|
|
||||||
|
```python
|
||||||
|
value: components.ChatGenerationParamsPluginAutoRouter = /* values here */
|
||||||
|
```
|
||||||
|
|
||||||
|
### `components.ChatGenerationParamsPluginModeration`
|
||||||
|
|
||||||
|
```python
|
||||||
|
value: components.ChatGenerationParamsPluginModeration = /* values here */
|
||||||
|
```
|
||||||
|
|
||||||
|
### `components.ChatGenerationParamsPluginWeb`
|
||||||
|
|
||||||
|
```python
|
||||||
|
value: components.ChatGenerationParamsPluginWeb = /* values here */
|
||||||
|
```
|
||||||
|
|
||||||
|
### `components.ChatGenerationParamsPluginFileParser`
|
||||||
|
|
||||||
|
```python
|
||||||
|
value: components.ChatGenerationParamsPluginFileParser = /* values here */
|
||||||
|
```
|
||||||
|
|
||||||
|
### `components.ChatGenerationParamsPluginResponseHealing`
|
||||||
|
|
||||||
|
```python
|
||||||
|
value: components.ChatGenerationParamsPluginResponseHealing = /* values here */
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# ChatGenerationParamsPluginWeb
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
|
||||||
|
| `id` | [components.ChatGenerationParamsIDWeb](../components/chatgenerationparamsidweb.md) | :heavy_check_mark: | N/A |
|
||||||
|
| `enabled` | *Optional[bool]* | :heavy_minus_sign: | Set to false to disable the web-search plugin for this request. Defaults to true. |
|
||||||
|
| `max_results` | *Optional[float]* | :heavy_minus_sign: | N/A |
|
||||||
|
| `search_prompt` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||||
|
| `engine` | [Optional[components.WebSearchEngine]](../components/websearchengine.md) | :heavy_minus_sign: | The search engine to use for web search. |
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
# ChatGenerationParamsProvider
|
||||||
|
|
||||||
|
When multiple model providers are available, optionally indicate your routing preference.
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `allow_fallbacks` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to allow backup providers to serve requests<br/>- true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider.<br/>- false: use only the primary/custom provider, and return the upstream error if it's unavailable.<br/> | |
|
||||||
|
| `require_parameters` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest. | |
|
||||||
|
| `data_collection` | [OptionalNullable[components.DataCollection]](../components/datacollection.md) | :heavy_minus_sign: | Data collection setting. If no available model provider meets the requirement, your request will return an error.<br/>- allow: (default) allow providers which store user data non-transiently and may train on it<br/><br/>- deny: use only providers which do not collect user data. | allow |
|
||||||
|
| `zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used. | true |
|
||||||
|
| `enforce_distillable_text` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to restrict routing to only models that allow text distillation. When true, only models where the author has allowed distillation will be used. | true |
|
||||||
|
| `order` | List[[components.ChatGenerationParamsOrder](../components/chatgenerationparamsorder.md)] | :heavy_minus_sign: | An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message. | |
|
||||||
|
| `only` | List[[components.ChatGenerationParamsOnly](../components/chatgenerationparamsonly.md)] | :heavy_minus_sign: | List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. | |
|
||||||
|
| `ignore` | List[[components.ChatGenerationParamsIgnore](../components/chatgenerationparamsignore.md)] | :heavy_minus_sign: | List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. | |
|
||||||
|
| `quantizations` | List[[components.Quantization](../components/quantization.md)] | :heavy_minus_sign: | A list of quantization levels to filter the provider by. | |
|
||||||
|
| `sort` | [OptionalNullable[components.ChatGenerationParamsSortUnion]](../components/chatgenerationparamssortunion.md) | :heavy_minus_sign: | N/A | price |
|
||||||
|
| `max_price` | [Optional[components.ChatGenerationParamsMaxPrice]](../components/chatgenerationparamsmaxprice.md) | :heavy_minus_sign: | The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. | |
|
||||||
|
| `preferred_min_throughput` | [OptionalNullable[components.PreferredMinThroughput]](../components/preferredminthroughput.md) | :heavy_minus_sign: | Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold. | 100 |
|
||||||
|
| `preferred_max_latency` | [OptionalNullable[components.PreferredMaxLatency]](../components/preferredmaxlatency.md) | :heavy_minus_sign: | Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold. | 5 |
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# ChatGenerationParamsProviderSort
|
||||||
|
|
||||||
|
The provider sorting strategy (price, throughput, latency)
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ------------ | ------------ |
|
||||||
|
| `PRICE` | price |
|
||||||
|
| `THROUGHPUT` | throughput |
|
||||||
|
| `LATENCY` | latency |
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
# ChatGenerationParamsProviderSortConfig
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description | Example |
|
||||||
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||||
|
| `by` | [OptionalNullable[components.ChatGenerationParamsBy]](../components/chatgenerationparamsby.md) | :heavy_minus_sign: | The provider sorting strategy (price, throughput, latency) | price |
|
||||||
|
| `partition` | [OptionalNullable[components.ChatGenerationParamsPartition]](../components/chatgenerationparamspartition.md) | :heavy_minus_sign: | Partitioning strategy for sorting: "model" (default) groups endpoints by model before sorting (fallback models remain fallbacks), "none" sorts all endpoints together regardless of model. | model |
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
# ChatGenerationParamsProviderSortConfigEnum
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ------------ | ------------ |
|
||||||
|
| `PRICE` | price |
|
||||||
|
| `THROUGHPUT` | throughput |
|
||||||
|
| `LATENCY` | latency |
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
# ChatGenerationParamsProviderSortConfigUnion
|
||||||
|
|
||||||
|
|
||||||
|
## Supported Types
|
||||||
|
|
||||||
|
### `components.ChatGenerationParamsProviderSortConfig`
|
||||||
|
|
||||||
|
```python
|
||||||
|
value: components.ChatGenerationParamsProviderSortConfig = /* values here */
|
||||||
|
```
|
||||||
|
|
||||||
|
### `components.ChatGenerationParamsProviderSortConfigEnum`
|
||||||
|
|
||||||
|
```python
|
||||||
|
value: components.ChatGenerationParamsProviderSortConfigEnum = /* values here */
|
||||||
|
```
|
||||||
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
# ChatGenerationParamsResponseFormatJSONObject
|
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
|
||||||
| ------------------------ | ------------------------ | ------------------------ | ------------------------ |
|
|
||||||
| `type` | *Literal["json_object"]* | :heavy_check_mark: | N/A |
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
# ChatGenerationParamsResponseFormatPython
|
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
|
||||||
| ------------------- | ------------------- | ------------------- | ------------------- |
|
|
||||||
| `type` | *Literal["python"]* | :heavy_check_mark: | N/A |
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
# ChatGenerationParamsResponseFormatText
|
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
|
||||||
| ------------------ | ------------------ | ------------------ | ------------------ |
|
|
||||||
| `type` | *Literal["text"]* | :heavy_check_mark: | N/A |
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
# ChatGenerationParamsResponseFormatUnion
|
|
||||||
|
|
||||||
|
|
||||||
## Supported Types
|
|
||||||
|
|
||||||
### `components.ChatGenerationParamsResponseFormatText`
|
|
||||||
|
|
||||||
```python
|
|
||||||
value: components.ChatGenerationParamsResponseFormatText = /* values here */
|
|
||||||
```
|
|
||||||
|
|
||||||
### `components.ChatGenerationParamsResponseFormatJSONObject`
|
|
||||||
|
|
||||||
```python
|
|
||||||
value: components.ChatGenerationParamsResponseFormatJSONObject = /* values here */
|
|
||||||
```
|
|
||||||
|
|
||||||
### `components.ResponseFormatJSONSchema`
|
|
||||||
|
|
||||||
```python
|
|
||||||
value: components.ResponseFormatJSONSchema = /* values here */
|
|
||||||
```
|
|
||||||
|
|
||||||
### `components.ResponseFormatTextGrammar`
|
|
||||||
|
|
||||||
```python
|
|
||||||
value: components.ResponseFormatTextGrammar = /* values here */
|
|
||||||
```
|
|
||||||
|
|
||||||
### `components.ChatGenerationParamsResponseFormatPython`
|
|
||||||
|
|
||||||
```python
|
|
||||||
value: components.ChatGenerationParamsResponseFormatPython = /* values here */
|
|
||||||
```
|
|
||||||
|
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
# ChatGenerationParamsRoute
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ---------- | ---------- |
|
||||||
|
| `FALLBACK` | fallback |
|
||||||
|
| `SORT` | sort |
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
# ChatGenerationParamsSortEnum
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ------------ | ------------ |
|
||||||
|
| `PRICE` | price |
|
||||||
|
| `THROUGHPUT` | throughput |
|
||||||
|
| `LATENCY` | latency |
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
# ChatGenerationParamsSortUnion
|
||||||
|
|
||||||
|
The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed.
|
||||||
|
|
||||||
|
|
||||||
|
## Supported Types
|
||||||
|
|
||||||
|
### `components.ChatGenerationParamsProviderSort`
|
||||||
|
|
||||||
|
```python
|
||||||
|
value: components.ChatGenerationParamsProviderSort = /* values here */
|
||||||
|
```
|
||||||
|
|
||||||
|
### `components.ChatGenerationParamsProviderSortConfigUnion`
|
||||||
|
|
||||||
|
```python
|
||||||
|
value: components.ChatGenerationParamsProviderSortConfigUnion = /* values here */
|
||||||
|
```
|
||||||
|
|
||||||
|
### `components.ChatGenerationParamsSortEnum`
|
||||||
|
|
||||||
|
```python
|
||||||
|
value: components.ChatGenerationParamsSortEnum = /* values here */
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
# ChatGenerationParamsTrace
|
||||||
|
|
||||||
|
Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations.
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| -------------------------- | -------------------------- | -------------------------- | -------------------------- |
|
||||||
|
| `trace_id` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||||
|
| `trace_name` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||||
|
| `span_name` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||||
|
| `generation_name` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||||
|
| `parent_span_id` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||||
|
| `__pydantic_extra__` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A |
|
||||||
@@ -1,12 +1,14 @@
|
|||||||
# ChatGenerationTokenUsage
|
# ChatGenerationTokenUsage
|
||||||
|
|
||||||
|
Token usage statistics
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
| Field | Type | Required | Description |
|
||||||
| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
|
| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
|
||||||
| `completion_tokens` | *float* | :heavy_check_mark: | N/A |
|
| `completion_tokens` | *float* | :heavy_check_mark: | Number of tokens in the completion |
|
||||||
| `prompt_tokens` | *float* | :heavy_check_mark: | N/A |
|
| `prompt_tokens` | *float* | :heavy_check_mark: | Number of tokens in the prompt |
|
||||||
| `total_tokens` | *float* | :heavy_check_mark: | N/A |
|
| `total_tokens` | *float* | :heavy_check_mark: | Total number of tokens |
|
||||||
| `completion_tokens_details` | [OptionalNullable[components.CompletionTokensDetails]](../components/completiontokensdetails.md) | :heavy_minus_sign: | N/A |
|
| `completion_tokens_details` | [OptionalNullable[components.CompletionTokensDetails]](../components/completiontokensdetails.md) | :heavy_minus_sign: | Detailed completion token usage |
|
||||||
| `prompt_tokens_details` | [OptionalNullable[components.PromptTokensDetails]](../components/prompttokensdetails.md) | :heavy_minus_sign: | N/A |
|
| `prompt_tokens_details` | [OptionalNullable[components.PromptTokensDetails]](../components/prompttokensdetails.md) | :heavy_minus_sign: | Detailed prompt token usage |
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
# ChatMessageContentItem
|
# ChatMessageContentItem
|
||||||
|
|
||||||
|
Content part for chat completion messages
|
||||||
|
|
||||||
|
|
||||||
## Supported Types
|
## Supported Types
|
||||||
|
|
||||||
@@ -21,15 +23,9 @@ value: components.ChatMessageContentItemImage = /* values here */
|
|||||||
value: components.ChatMessageContentItemAudio = /* values here */
|
value: components.ChatMessageContentItemAudio = /* values here */
|
||||||
```
|
```
|
||||||
|
|
||||||
### `components.ChatMessageContentItemVideo`
|
### `components.ChatMessageContentItem1`
|
||||||
|
|
||||||
```python
|
```python
|
||||||
value: components.ChatMessageContentItemVideo = /* values here */
|
value: components.ChatMessageContentItem1 = /* values here */
|
||||||
```
|
|
||||||
|
|
||||||
### `components.ChatMessageContentItemVideo`
|
|
||||||
|
|
||||||
```python
|
|
||||||
value: components.ChatMessageContentItemVideo = /* values here */
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
# ChatMessageContentItem1
|
||||||
|
|
||||||
|
|
||||||
|
## Supported Types
|
||||||
|
|
||||||
|
### `components.ChatMessageContentItemVideoLegacy`
|
||||||
|
|
||||||
|
```python
|
||||||
|
value: components.ChatMessageContentItemVideoLegacy = /* values here */
|
||||||
|
```
|
||||||
|
|
||||||
|
### `components.ChatMessageContentItemVideo`
|
||||||
|
|
||||||
|
```python
|
||||||
|
value: components.ChatMessageContentItemVideo = /* values here */
|
||||||
|
```
|
||||||
|
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
# ChatMessageContentItemAudio
|
# ChatMessageContentItemAudio
|
||||||
|
|
||||||
|
Audio input content part. Supported audio formats vary by provider.
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
| Field | Type | Required | Description |
|
||||||
| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
|
| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
|
||||||
| `type` | *Literal["input_audio"]* | :heavy_check_mark: | N/A |
|
| `type` | [components.ChatMessageContentItemAudioType](../components/chatmessagecontentitemaudiotype.md) | :heavy_check_mark: | N/A |
|
||||||
| `input_audio` | [components.ChatMessageContentItemAudioInputAudio](../components/chatmessagecontentitemaudioinputaudio.md) | :heavy_check_mark: | N/A |
|
| `input_audio` | [components.ChatMessageContentItemAudioInputAudio](../components/chatmessagecontentitemaudioinputaudio.md) | :heavy_check_mark: | N/A |
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
| Field | Type | Required | Description |
|
||||||
| ------------------ | ------------------ | ------------------ | ------------------ |
|
| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
|
||||||
| `data` | *str* | :heavy_check_mark: | N/A |
|
| `data` | *str* | :heavy_check_mark: | Base64 encoded audio data |
|
||||||
| `format_` | *str* | :heavy_check_mark: | N/A |
|
| `format_` | *str* | :heavy_check_mark: | Audio format (e.g., wav, mp3, flac, m4a, ogg, aiff, aac, pcm16, pcm24). Supported formats vary by provider. |
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# ChatMessageContentItemAudioType
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ------------- | ------------- |
|
||||||
|
| `INPUT_AUDIO` | input_audio |
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
# ChatMessageContentItemCacheControl
|
# ChatMessageContentItemCacheControl
|
||||||
|
|
||||||
|
Cache control for the content part
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
| Field | Type | Required | Description |
|
||||||
| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ |
|
| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |
|
||||||
| `type` | *Literal["ephemeral"]* | :heavy_check_mark: | N/A |
|
| `type` | [components.ChatMessageContentItemCacheControlType](../components/chatmessagecontentitemcachecontroltype.md) | :heavy_check_mark: | N/A |
|
||||||
| `ttl` | [Optional[components.TTL]](../components/ttl.md) | :heavy_minus_sign: | N/A |
|
| `ttl` | [Optional[components.TTL]](../components/ttl.md) | :heavy_minus_sign: | N/A |
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# ChatMessageContentItemCacheControlType
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ----------- | ----------- |
|
||||||
|
| `EPHEMERAL` | ephemeral |
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
# ChatMessageContentItemImage
|
# ChatMessageContentItemImage
|
||||||
|
|
||||||
|
Image content part for vision models
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
| Field | Type | Required | Description |
|
||||||
| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ |
|
| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ |
|
||||||
| `type` | *Literal["image_url"]* | :heavy_check_mark: | N/A |
|
| `type` | [components.ChatMessageContentItemImageType](../components/chatmessagecontentitemimagetype.md) | :heavy_check_mark: | N/A |
|
||||||
| `image_url` | [components.ImageURL](../components/imageurl.md) | :heavy_check_mark: | N/A |
|
| `image_url` | [components.ChatMessageContentItemImageImageURL](../components/chatmessagecontentitemimageimageurl.md) | :heavy_check_mark: | N/A |
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
# ChatMessageContentItemImageDetail
|
# ChatMessageContentItemImageDetail
|
||||||
|
|
||||||
|
Image detail level for vision models
|
||||||
|
|
||||||
|
|
||||||
## Values
|
## Values
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -1,9 +1,9 @@
|
|||||||
# ImageURL
|
# ChatMessageContentItemImageImageURL
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
| Field | Type | Required | Description |
|
||||||
| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |
|
| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |
|
||||||
| `url` | *str* | :heavy_check_mark: | N/A |
|
| `url` | *str* | :heavy_check_mark: | URL of the image (data: URLs supported) |
|
||||||
| `detail` | [Optional[components.ChatMessageContentItemImageDetail]](../components/chatmessagecontentitemimagedetail.md) | :heavy_minus_sign: | N/A |
|
| `detail` | [Optional[components.ChatMessageContentItemImageDetail]](../components/chatmessagecontentitemimagedetail.md) | :heavy_minus_sign: | Image detail level for vision models |
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# ChatMessageContentItemImageType
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ----------- | ----------- |
|
||||||
|
| `IMAGE_URL` | image_url |
|
||||||
@@ -1,10 +1,12 @@
|
|||||||
# ChatMessageContentItemText
|
# ChatMessageContentItemText
|
||||||
|
|
||||||
|
Text content part
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
| Field | Type | Required | Description | Example |
|
||||||
| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
|
| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
|
||||||
| `type` | *Literal["text"]* | :heavy_check_mark: | N/A |
|
| `type` | [components.ChatMessageContentItemTextType](../components/chatmessagecontentitemtexttype.md) | :heavy_check_mark: | N/A | |
|
||||||
| `text` | *str* | :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 |
|
| `cache_control` | [Optional[components.ChatMessageContentItemCacheControl]](../components/chatmessagecontentitemcachecontrol.md) | :heavy_minus_sign: | Cache control for the content part | {<br/>"type": "ephemeral",<br/>"ttl": "5m"<br/>} |
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# ChatMessageContentItemTextType
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ------ | ------ |
|
||||||
|
| `TEXT` | text |
|
||||||
@@ -1,17 +1,11 @@
|
|||||||
# ChatMessageContentItemVideo
|
# ChatMessageContentItemVideo
|
||||||
|
|
||||||
|
Video input content part
|
||||||
|
|
||||||
## Supported Types
|
|
||||||
|
|
||||||
### `components.ChatMessageContentItemVideoInputVideo`
|
## Fields
|
||||||
|
|
||||||
```python
|
|
||||||
value: components.ChatMessageContentItemVideoInputVideo = /* values here */
|
|
||||||
```
|
|
||||||
|
|
||||||
### `components.ChatMessageContentItemVideoVideoURL`
|
|
||||||
|
|
||||||
```python
|
|
||||||
value: components.ChatMessageContentItemVideoVideoURL = /* values here */
|
|
||||||
```
|
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
|
||||||
|
| `type` | [components.ChatMessageContentItemVideoType](../components/chatmessagecontentitemvideotype.md) | :heavy_check_mark: | N/A |
|
||||||
|
| `video_url` | [components.VideoInput](../components/videoinput.md) | :heavy_check_mark: | Video input object |
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
# ChatMessageContentItemVideoInputVideo
|
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
|
||||||
|
|
||||||
| 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 |
|
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
# ~~ChatMessageContentItemVideoLegacy~~
|
||||||
|
|
||||||
|
Video input content part (legacy format - deprecated)
|
||||||
|
|
||||||
|
> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible.
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `type` | [components.ChatMessageContentItemVideoLegacyType](../components/chatmessagecontentitemvideolegacytype.md) | :heavy_check_mark: | N/A |
|
||||||
|
| `video_url` | [components.VideoInput](../components/videoinput.md) | :heavy_check_mark: | Video input object |
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# ChatMessageContentItemVideoLegacyType
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ------------- | ------------- |
|
||||||
|
| `INPUT_VIDEO` | input_video |
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# ChatMessageContentItemVideoType
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ----------- | ----------- |
|
||||||
|
| `VIDEO_URL` | video_url |
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
# ChatMessageContentItemVideoVideoURL
|
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
|
||||||
|
|
||||||
| 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 |
|
|
||||||
@@ -1,11 +1,13 @@
|
|||||||
# ChatMessageTokenLogprob
|
# ChatMessageTokenLogprob
|
||||||
|
|
||||||
|
Token log probability information
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
| Field | Type | Required | Description |
|
||||||
| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- |
|
| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
|
||||||
| `token` | *str* | :heavy_check_mark: | N/A |
|
| `token` | *str* | :heavy_check_mark: | The token |
|
||||||
| `logprob` | *float* | :heavy_check_mark: | N/A |
|
| `logprob` | *float* | :heavy_check_mark: | Log probability of the token |
|
||||||
| `bytes_` | List[*float*] | :heavy_check_mark: | N/A |
|
| `bytes_` | List[*float*] | :heavy_check_mark: | UTF-8 bytes of the token |
|
||||||
| `top_logprobs` | List[[components.TopLogprob](../components/toplogprob.md)] | :heavy_check_mark: | N/A |
|
| `top_logprobs` | List[[components.ChatMessageTokenLogprobTopLogprob](../components/chatmessagetokenlogprobtoplogprob.md)] | :heavy_check_mark: | Top alternative tokens with probabilities |
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
# ChatMessageTokenLogprobs
|
# ChatMessageTokenLogprobs
|
||||||
|
|
||||||
|
Log probabilities for the completion
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
| Field | Type | Required | Description |
|
||||||
| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ |
|
| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ |
|
||||||
| `content` | List[[components.ChatMessageTokenLogprob](../components/chatmessagetokenlogprob.md)] | :heavy_check_mark: | N/A |
|
| `content` | List[[components.ChatMessageTokenLogprob](../components/chatmessagetokenlogprob.md)] | :heavy_check_mark: | Log probabilities for content tokens |
|
||||||
| `refusal` | List[[components.ChatMessageTokenLogprob](../components/chatmessagetokenlogprob.md)] | :heavy_check_mark: | N/A |
|
| `refusal` | List[[components.ChatMessageTokenLogprob](../components/chatmessagetokenlogprob.md)] | :heavy_check_mark: | Log probabilities for refusal tokens |
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
# ChatMessageTokenLogprobTopLogprob
|
||||||
|
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
| Field | Type | Required | Description |
|
||||||
|
| ------------------ | ------------------ | ------------------ | ------------------ |
|
||||||
|
| `token` | *str* | :heavy_check_mark: | N/A |
|
||||||
|
| `logprob` | *float* | :heavy_check_mark: | N/A |
|
||||||
|
| `bytes_` | List[*float*] | :heavy_check_mark: | N/A |
|
||||||
@@ -1,10 +1,12 @@
|
|||||||
# ChatMessageToolCall
|
# ChatMessageToolCall
|
||||||
|
|
||||||
|
Tool call made by the assistant
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
| Field | Type | Required | Description |
|
||||||
| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
|
| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
|
||||||
| `id` | *str* | :heavy_check_mark: | N/A |
|
| `id` | *str* | :heavy_check_mark: | Tool call identifier |
|
||||||
| `type` | *Literal["function"]* | :heavy_check_mark: | N/A |
|
| `type` | [components.ChatMessageToolCallType](../components/chatmessagetoolcalltype.md) | :heavy_check_mark: | N/A |
|
||||||
| `function` | [components.ChatMessageToolCallFunction](../components/chatmessagetoolcallfunction.md) | :heavy_check_mark: | N/A |
|
| `function` | [components.ChatMessageToolCallFunction](../components/chatmessagetoolcallfunction.md) | :heavy_check_mark: | N/A |
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
| Field | Type | Required | Description |
|
||||||
| ------------------ | ------------------ | ------------------ | ------------------ |
|
| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- |
|
||||||
| `name` | *str* | :heavy_check_mark: | N/A |
|
| `name` | *str* | :heavy_check_mark: | Function name to call |
|
||||||
| `arguments` | *str* | :heavy_check_mark: | N/A |
|
| `arguments` | *str* | :heavy_check_mark: | Function arguments as JSON string |
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# ChatMessageToolCallType
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ---------- | ---------- |
|
||||||
|
| `FUNCTION` | function |
|
||||||
@@ -1,14 +1,16 @@
|
|||||||
# ChatResponse
|
# ChatResponse
|
||||||
|
|
||||||
|
Chat completion response
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
| Field | Type | Required | Description | Example |
|
||||||
| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ |
|
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `id` | *str* | :heavy_check_mark: | N/A |
|
| `id` | *str* | :heavy_check_mark: | Unique completion identifier | chatcmpl-123 |
|
||||||
| `choices` | List[[components.ChatResponseChoice](../components/chatresponsechoice.md)] | :heavy_check_mark: | N/A |
|
| `choices` | List[[components.ChatResponseChoice](../components/chatresponsechoice.md)] | :heavy_check_mark: | List of completion choices | |
|
||||||
| `created` | *float* | :heavy_check_mark: | N/A |
|
| `created` | *float* | :heavy_check_mark: | Unix timestamp of creation | 1677652288 |
|
||||||
| `model` | *str* | :heavy_check_mark: | N/A |
|
| `model` | *str* | :heavy_check_mark: | Model used for completion | openai/gpt-4 |
|
||||||
| `object` | *Literal["chat.completion"]* | :heavy_check_mark: | N/A |
|
| `object` | [components.ChatResponseObject](../components/chatresponseobject.md) | :heavy_check_mark: | N/A | |
|
||||||
| `system_fingerprint` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
|
| `system_fingerprint` | *OptionalNullable[str]* | :heavy_minus_sign: | System fingerprint | fp_44709d6fcb |
|
||||||
| `usage` | [Optional[components.ChatGenerationTokenUsage]](../components/chatgenerationtokenusage.md) | :heavy_minus_sign: | N/A |
|
| `usage` | [Optional[components.ChatGenerationTokenUsage]](../components/chatgenerationtokenusage.md) | :heavy_minus_sign: | Token usage statistics | {<br/>"completion_tokens": 15,<br/>"prompt_tokens": 10,<br/>"total_tokens": 25,<br/>"completion_tokens_details": {<br/>"reasoning_tokens": 5<br/>},<br/>"prompt_tokens_details": {<br/>"cached_tokens": 2<br/>}<br/>} |
|
||||||
@@ -1,11 +1,13 @@
|
|||||||
# ChatResponseChoice
|
# ChatResponseChoice
|
||||||
|
|
||||||
|
Chat completion choice
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
| Field | Type | Required | Description | Example |
|
||||||
| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
|
| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
|
||||||
| `finish_reason` | [Nullable[components.ChatCompletionFinishReason]](../components/chatcompletionfinishreason.md) | :heavy_check_mark: | N/A |
|
| `finish_reason` | *Nullable[Any]* | :heavy_check_mark: | N/A | |
|
||||||
| `index` | *float* | :heavy_check_mark: | N/A |
|
| `index` | *float* | :heavy_check_mark: | Choice index | 0 |
|
||||||
| `message` | [components.AssistantMessage](../components/assistantmessage.md) | :heavy_check_mark: | N/A |
|
| `message` | [components.AssistantMessage](../components/assistantmessage.md) | :heavy_check_mark: | Assistant message for requests and responses | {<br/>"role": "user",<br/>"content": "What is the capital of France?"<br/>} |
|
||||||
| `logprobs` | [OptionalNullable[components.ChatMessageTokenLogprobs]](../components/chatmessagetokenlogprobs.md) | :heavy_minus_sign: | N/A |
|
| `logprobs` | [OptionalNullable[components.ChatMessageTokenLogprobs]](../components/chatmessagetokenlogprobs.md) | :heavy_minus_sign: | Log probabilities for the completion | {<br/>"content": [<br/>{<br/>"token": " Hello",<br/>"logprob": -0.612345,<br/>"bytes": null,<br/>"top_logprobs": []<br/>}<br/>],<br/>"refusal": null<br/>} |
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# ChatResponseObject
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ----------------- | ----------------- |
|
||||||
|
| `CHAT_COMPLETION` | chat.completion |
|
||||||
@@ -1,11 +1,13 @@
|
|||||||
# ChatStreamingChoice
|
# ChatStreamingChoice
|
||||||
|
|
||||||
|
Streaming completion choice chunk
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
| Field | Type | Required | Description | Example |
|
||||||
| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
|
| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
|
||||||
| `delta` | [components.ChatStreamingMessageChunk](../components/chatstreamingmessagechunk.md) | :heavy_check_mark: | N/A |
|
| `delta` | [components.ChatStreamingMessageChunk](../components/chatstreamingmessagechunk.md) | :heavy_check_mark: | Delta changes in streaming response | {<br/>"role": "assistant",<br/>"content": "Hello"<br/>} |
|
||||||
| `finish_reason` | [Nullable[components.ChatCompletionFinishReason]](../components/chatcompletionfinishreason.md) | :heavy_check_mark: | N/A |
|
| `finish_reason` | *Nullable[Any]* | :heavy_check_mark: | N/A | |
|
||||||
| `index` | *float* | :heavy_check_mark: | N/A |
|
| `index` | *float* | :heavy_check_mark: | Choice index | 0 |
|
||||||
| `logprobs` | [OptionalNullable[components.ChatMessageTokenLogprobs]](../components/chatmessagetokenlogprobs.md) | :heavy_minus_sign: | N/A |
|
| `logprobs` | [OptionalNullable[components.ChatMessageTokenLogprobs]](../components/chatmessagetokenlogprobs.md) | :heavy_minus_sign: | Log probabilities for the completion | {<br/>"content": [<br/>{<br/>"token": " Hello",<br/>"logprob": -0.612345,<br/>"bytes": null,<br/>"top_logprobs": []<br/>}<br/>],<br/>"refusal": null<br/>} |
|
||||||
@@ -1,12 +1,15 @@
|
|||||||
# ChatStreamingMessageChunk
|
# ChatStreamingMessageChunk
|
||||||
|
|
||||||
|
Delta changes in streaming response
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
| Field | Type | Required | Description | Example |
|
||||||
| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
|
| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
|
||||||
| `role` | [Optional[components.ChatStreamingMessageChunkRole]](../components/chatstreamingmessagechunkrole.md) | :heavy_minus_sign: | N/A |
|
| `role` | [Optional[components.ChatStreamingMessageChunkRole]](../components/chatstreamingmessagechunkrole.md) | :heavy_minus_sign: | The role of the message author | assistant |
|
||||||
| `content` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
|
| `content` | *OptionalNullable[str]* | :heavy_minus_sign: | Message content delta | Hello |
|
||||||
| `reasoning` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
|
| `reasoning` | *OptionalNullable[str]* | :heavy_minus_sign: | Reasoning content delta | I need to |
|
||||||
| `refusal` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
|
| `refusal` | *OptionalNullable[str]* | :heavy_minus_sign: | Refusal message delta | <nil> |
|
||||||
| `tool_calls` | List[[components.ChatStreamingMessageToolCall](../components/chatstreamingmessagetoolcall.md)] | :heavy_minus_sign: | N/A |
|
| `tool_calls` | List[[components.ChatStreamingMessageToolCall](../components/chatstreamingmessagetoolcall.md)] | :heavy_minus_sign: | Tool calls delta | |
|
||||||
|
| `reasoning_details` | List[[components.ReasoningDetailUnion](../components/reasoningdetailunion.md)] | :heavy_minus_sign: | Reasoning details for extended thinking models | |
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
# ChatStreamingMessageChunkRole
|
# ChatStreamingMessageChunkRole
|
||||||
|
|
||||||
|
The role of the message author
|
||||||
|
|
||||||
|
|
||||||
## Values
|
## Values
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
# ChatStreamingMessageToolCall
|
# ChatStreamingMessageToolCall
|
||||||
|
|
||||||
|
Tool call delta for streaming responses
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
| Field | Type | Required | Description | Example |
|
||||||
| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
|
| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
|
||||||
| `index` | *float* | :heavy_check_mark: | N/A |
|
| `index` | *float* | :heavy_check_mark: | Tool call index in the array | 0 |
|
||||||
| `id` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
| `id` | *Optional[str]* | :heavy_minus_sign: | Tool call identifier | call_abc123 |
|
||||||
| `type` | *Optional[Literal["function"]]* | :heavy_minus_sign: | N/A |
|
| `type` | [Optional[components.ChatStreamingMessageToolCallType]](../components/chatstreamingmessagetoolcalltype.md) | :heavy_minus_sign: | Tool call type | function |
|
||||||
| `function` | [Optional[components.ChatStreamingMessageToolCallFunction]](../components/chatstreamingmessagetoolcallfunction.md) | :heavy_minus_sign: | N/A |
|
| `function` | [Optional[components.ChatStreamingMessageToolCallFunction]](../components/chatstreamingmessagetoolcallfunction.md) | :heavy_minus_sign: | Function call details | |
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
# ChatStreamingMessageToolCallFunction
|
# ChatStreamingMessageToolCallFunction
|
||||||
|
|
||||||
|
Function call details
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
| Field | Type | Required | Description | Example |
|
||||||
| ------------------ | ------------------ | ------------------ | ------------------ |
|
| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- |
|
||||||
| `name` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
| `name` | *Optional[str]* | :heavy_minus_sign: | Function name | get_weather |
|
||||||
| `arguments` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
| `arguments` | *Optional[str]* | :heavy_minus_sign: | Function arguments as JSON string | {"location": |
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
# ChatStreamingMessageToolCallType
|
||||||
|
|
||||||
|
Tool call type
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ---------- | ---------- |
|
||||||
|
| `FUNCTION` | function |
|
||||||
@@ -1,8 +1,17 @@
|
|||||||
# ChatStreamingResponseChunk
|
# ChatStreamingResponseChunk
|
||||||
|
|
||||||
|
Streaming chat completion chunk
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
| Field | Type | Required | Description | Example |
|
||||||
| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
|
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `data` | [components.ChatStreamingResponseChunkData](../components/chatstreamingresponsechunkdata.md) | :heavy_check_mark: | N/A |
|
| `id` | *str* | :heavy_check_mark: | Unique chunk identifier | chatcmpl-123 |
|
||||||
|
| `choices` | List[[components.ChatStreamingChoice](../components/chatstreamingchoice.md)] | :heavy_check_mark: | List of streaming chunk choices | |
|
||||||
|
| `created` | *float* | :heavy_check_mark: | Unix timestamp of creation | 1677652288 |
|
||||||
|
| `model` | *str* | :heavy_check_mark: | Model used for completion | openai/gpt-4 |
|
||||||
|
| `object` | [components.ChatStreamingResponseChunkObject](../components/chatstreamingresponsechunkobject.md) | :heavy_check_mark: | N/A | |
|
||||||
|
| `system_fingerprint` | *OptionalNullable[str]* | :heavy_minus_sign: | System fingerprint | fp_44709d6fcb |
|
||||||
|
| `error` | [Optional[components.Error]](../components/error.md) | :heavy_minus_sign: | Error information | {<br/>"message": "Rate limit exceeded",<br/>"code": 429<br/>} |
|
||||||
|
| `usage` | [Optional[components.ChatGenerationTokenUsage]](../components/chatgenerationtokenusage.md) | :heavy_minus_sign: | Token usage statistics | {<br/>"completion_tokens": 15,<br/>"prompt_tokens": 10,<br/>"total_tokens": 25,<br/>"completion_tokens_details": {<br/>"reasoning_tokens": 5<br/>},<br/>"prompt_tokens_details": {<br/>"cached_tokens": 2<br/>}<br/>} |
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
# ChatStreamingResponseChunkData
|
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
|
||||||
| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
|
|
||||||
| `id` | *str* | :heavy_check_mark: | N/A |
|
|
||||||
| `choices` | List[[components.ChatStreamingChoice](../components/chatstreamingchoice.md)] | :heavy_check_mark: | N/A |
|
|
||||||
| `created` | *float* | :heavy_check_mark: | N/A |
|
|
||||||
| `model` | *str* | :heavy_check_mark: | N/A |
|
|
||||||
| `object` | *Literal["chat.completion.chunk"]* | :heavy_check_mark: | N/A |
|
|
||||||
| `system_fingerprint` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
|
|
||||||
| `error` | [Optional[components.ChatStreamingResponseChunkError]](../components/chatstreamingresponsechunkerror.md) | :heavy_minus_sign: | N/A |
|
|
||||||
| `usage` | [Optional[components.ChatGenerationTokenUsage]](../components/chatgenerationtokenusage.md) | :heavy_minus_sign: | N/A |
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
# ChatStreamingResponseChunkError
|
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
|
||||||
| ------------------ | ------------------ | ------------------ | ------------------ |
|
|
||||||
| `message` | *str* | :heavy_check_mark: | N/A |
|
|
||||||
| `code` | *float* | :heavy_check_mark: | N/A |
|
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# ChatStreamingResponseChunkObject
|
||||||
|
|
||||||
|
|
||||||
|
## Values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| ----------------------- | ----------------------- |
|
||||||
|
| `CHAT_COMPLETION_CHUNK` | chat.completion.chunk |
|
||||||
@@ -1,8 +1,10 @@
|
|||||||
# ChatStreamOptions
|
# ChatStreamOptions
|
||||||
|
|
||||||
|
Streaming configuration options
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
## Fields
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
| Field | Type | Required | Description | Example |
|
||||||
| ------------------ | ------------------ | ------------------ | ------------------ |
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||||
| `include_usage` | *Optional[bool]* | :heavy_minus_sign: | N/A |
|
| ~~`include_usage`~~ | *Optional[bool]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.<br/><br/>Deprecated: This field has no effect. Full usage details are always included. | true |
|
||||||
+21
-13
@@ -1,17 +1,25 @@
|
|||||||
# Code
|
# Code
|
||||||
|
|
||||||
|
|
||||||
## Supported Types
|
## Values
|
||||||
|
|
||||||
### `str`
|
|
||||||
|
|
||||||
```python
|
|
||||||
value: str = /* values here */
|
|
||||||
```
|
|
||||||
|
|
||||||
### `float`
|
|
||||||
|
|
||||||
```python
|
|
||||||
value: float = /* values here */
|
|
||||||
```
|
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| -------------------------------- | -------------------------------- |
|
||||||
|
| `SERVER_ERROR` | server_error |
|
||||||
|
| `RATE_LIMIT_EXCEEDED` | rate_limit_exceeded |
|
||||||
|
| `INVALID_PROMPT` | invalid_prompt |
|
||||||
|
| `VECTOR_STORE_TIMEOUT` | vector_store_timeout |
|
||||||
|
| `INVALID_IMAGE` | invalid_image |
|
||||||
|
| `INVALID_IMAGE_FORMAT` | invalid_image_format |
|
||||||
|
| `INVALID_BASE64_IMAGE` | invalid_base64_image |
|
||||||
|
| `INVALID_IMAGE_URL` | invalid_image_url |
|
||||||
|
| `IMAGE_TOO_LARGE` | image_too_large |
|
||||||
|
| `IMAGE_TOO_SMALL` | image_too_small |
|
||||||
|
| `IMAGE_PARSE_ERROR` | image_parse_error |
|
||||||
|
| `IMAGE_CONTENT_POLICY_VIOLATION` | image_content_policy_violation |
|
||||||
|
| `INVALID_IMAGE_MODE` | invalid_image_mode |
|
||||||
|
| `IMAGE_FILE_TOO_LARGE` | image_file_too_large |
|
||||||
|
| `UNSUPPORTED_IMAGE_MEDIA_TYPE` | unsupported_image_media_type |
|
||||||
|
| `EMPTY_IMAGE_FILE` | empty_image_file |
|
||||||
|
| `FAILED_TO_DOWNLOAD_IMAGE` | failed_to_download_image |
|
||||||
|
| `IMAGE_FILE_NOT_FOUND` | image_file_not_found |
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
# CodeEnum
|
|
||||||
|
|
||||||
|
|
||||||
## Values
|
|
||||||
|
|
||||||
| Name | Value |
|
|
||||||
| -------------------------------- | -------------------------------- |
|
|
||||||
| `SERVER_ERROR` | server_error |
|
|
||||||
| `RATE_LIMIT_EXCEEDED` | rate_limit_exceeded |
|
|
||||||
| `INVALID_PROMPT` | invalid_prompt |
|
|
||||||
| `VECTOR_STORE_TIMEOUT` | vector_store_timeout |
|
|
||||||
| `INVALID_IMAGE` | invalid_image |
|
|
||||||
| `INVALID_IMAGE_FORMAT` | invalid_image_format |
|
|
||||||
| `INVALID_BASE64_IMAGE` | invalid_base64_image |
|
|
||||||
| `INVALID_IMAGE_URL` | invalid_image_url |
|
|
||||||
| `IMAGE_TOO_LARGE` | image_too_large |
|
|
||||||
| `IMAGE_TOO_SMALL` | image_too_small |
|
|
||||||
| `IMAGE_PARSE_ERROR` | image_parse_error |
|
|
||||||
| `IMAGE_CONTENT_POLICY_VIOLATION` | image_content_policy_violation |
|
|
||||||
| `INVALID_IMAGE_MODE` | invalid_image_mode |
|
|
||||||
| `IMAGE_FILE_TOO_LARGE` | image_file_too_large |
|
|
||||||
| `UNSUPPORTED_IMAGE_MEDIA_TYPE` | unsupported_image_media_type |
|
|
||||||
| `EMPTY_IMAGE_FILE` | empty_image_file |
|
|
||||||
| `FAILED_TO_DOWNLOAD_IMAGE` | failed_to_download_image |
|
|
||||||
| `IMAGE_FILE_NOT_FOUND` | image_file_not_found |
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
# CompletionChoice
|
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
|
||||||
| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
|
|
||||||
| `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 |
|
|
||||||
| `native_finish_reason` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
|
||||||
| `reasoning` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
# CompletionCreateParams
|
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
|
||||||
| ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ |
|
|
||||||
| `model` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
|
||||||
| `models` | List[*str*] | :heavy_minus_sign: | N/A |
|
|
||||||
| `prompt` | [components.Prompt](../components/prompt.md) | :heavy_check_mark: | N/A |
|
|
||||||
| `best_of` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A |
|
|
||||||
| `echo` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A |
|
|
||||||
| `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
|
||||||
| `logit_bias` | Dict[str, *float*] | :heavy_minus_sign: | N/A |
|
|
||||||
| `logprobs` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A |
|
|
||||||
| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A |
|
|
||||||
| `n` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A |
|
|
||||||
| `presence_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
|
||||||
| `seed` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A |
|
|
||||||
| `stop` | [OptionalNullable[components.CompletionCreateParamsStop]](../components/completioncreateparamsstop.md) | :heavy_minus_sign: | N/A |
|
|
||||||
| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A |
|
|
||||||
| `stream_options` | [OptionalNullable[components.StreamOptions]](../components/streamoptions.md) | :heavy_minus_sign: | N/A |
|
|
||||||
| `suffix` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
|
|
||||||
| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
|
||||||
| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
|
||||||
| `user` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
|
||||||
| `metadata` | Dict[str, *str*] | :heavy_minus_sign: | N/A |
|
|
||||||
| `response_format` | [OptionalNullable[components.CompletionCreateParamsResponseFormatUnion]](../components/completioncreateparamsresponseformatunion.md) | :heavy_minus_sign: | N/A |
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
# CompletionCreateParamsResponseFormatJSONObject
|
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
|
||||||
| ------------------------ | ------------------------ | ------------------------ | ------------------------ |
|
|
||||||
| `type` | *Literal["json_object"]* | :heavy_check_mark: | N/A |
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
# CompletionCreateParamsResponseFormatPython
|
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
|
||||||
| ------------------- | ------------------- | ------------------- | ------------------- |
|
|
||||||
| `type` | *Literal["python"]* | :heavy_check_mark: | N/A |
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
# CompletionCreateParamsResponseFormatText
|
|
||||||
|
|
||||||
|
|
||||||
## Fields
|
|
||||||
|
|
||||||
| Field | Type | Required | Description |
|
|
||||||
| ------------------ | ------------------ | ------------------ | ------------------ |
|
|
||||||
| `type` | *Literal["text"]* | :heavy_check_mark: | N/A |
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user