feat: fix types and add reasoning_details to chat responses (#27)

This commit is contained in:
Matt Apperson
2025-12-16 16:16:22 -05:00
committed by GitHub
parent d433ce35e8
commit f190e3f950
81 changed files with 2249 additions and 1133 deletions
+306 -225
View File
@@ -3529,19 +3529,47 @@ components:
example: fp16
ProviderSort:
type: string
nullable: true
enum:
- price
- throughput
- latency
description: >-
The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is
performed.
example: price
ProviderSortConfig:
type: object
properties:
by:
anyOf:
- $ref: '#/components/schemas/ProviderSort'
- type: 'null'
partition:
anyOf:
- type: string
enum:
- model
- none
- type: 'null'
BigNumberUnion:
type: string
description: A value in string format that is a large number
example: 1000
WebSearchEngine:
type: string
enum:
- native
- exa
description: The search engine to use for web search.
PDFParserEngine:
type: string
enum:
- mistral-ocr
- pdf-text
- native
description: The engine to use for parsing PDF files.
PDFParserOptions:
type: object
properties:
engine:
$ref: '#/components/schemas/PDFParserEngine'
description: Options for PDF parsing.
OpenResponsesRequest:
type: object
properties:
@@ -3721,7 +3749,14 @@ components:
$ref: '#/components/schemas/Quantization'
description: A list of quantization levels to filter the provider by.
sort:
$ref: '#/components/schemas/ProviderSort'
anyOf:
- $ref: '#/components/schemas/ProviderSort'
- $ref: '#/components/schemas/ProviderSortConfig'
- nullable: true
description: >-
The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing
is performed.
example: price
max_price:
type: object
properties:
@@ -3738,20 +3773,38 @@ components:
description: >-
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:
type: number
nullable: true
description: >-
Preferred minimum throughput (in tokens per second). Endpoints below this threshold 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.
example: 100
preferred_max_latency:
type: number
nullable: true
description: >-
Preferred maximum latency (in seconds). Endpoints above this threshold 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.
example: 5
min_throughput:
type: number
nullable: true
example: 100
deprecated: true
description: >-
The minimum throughput (in tokens per second) required for this request. Only providers serving the
model with at least this throughput will be used.
**DEPRECATED** Use preferred_min_throughput instead. Backwards-compatible alias for
preferred_min_throughput.
example: 100
x-speakeasy-deprecation-message: Use preferred_min_throughput instead.
max_latency:
type: number
nullable: true
deprecated: true
description: '**DEPRECATED** Use preferred_max_latency instead. Backwards-compatible alias for preferred_max_latency.'
example: 5
description: >-
The maximum latency (in seconds) allowed for this request. Only providers serving the model with better
than this latency will be used.
x-speakeasy-deprecation-message: Use preferred_max_latency instead.
additionalProperties: false
description: When multiple model providers are available, optionally indicate your routing preference.
plugins:
@@ -3780,10 +3833,7 @@ components:
search_prompt:
type: string
engine:
type: string
enum:
- native
- exa
$ref: '#/components/schemas/WebSearchEngine'
required:
- id
- type: object
@@ -3795,17 +3845,8 @@ components:
enabled:
type: boolean
description: Set to false to disable the file-parser plugin for this request. Defaults to true.
max_files:
type: number
pdf:
type: object
properties:
engine:
type: string
enum:
- mistral-ocr
- pdf-text
- native
$ref: '#/components/schemas/PDFParserOptions'
required:
- id
- type: object
@@ -3826,9 +3867,13 @@ components:
enum:
- fallback
- sort
deprecated: true
description: >-
Routing strategy for multiple models: "fallback" (default) uses secondary models as backups, "sort" sorts
all endpoints together by routing criteria.
**DEPRECATED** Use providers.sort.partition instead. Backwards-compatible alias for
providers.sort.partition. Accepts legacy values: "fallback" (maps to "model"), "sort" (maps to "none").
x-speakeasy-deprecation-message: Use providers.sort.partition instead.
x-speakeasy-ignore: true
x-fern-ignore: true
user:
type: string
maxLength: 128
@@ -3988,6 +4033,137 @@ components:
amount: 100
sender: '0x1234567890123456789012345678901234567890'
chain_id: 1
ProviderPreferences:
type: object
properties:
allow_fallbacks:
type: boolean
nullable: true
description: >
Whether to allow backup providers to serve requests
- true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the
next best provider.
- false: use only the primary/custom provider, and return the upstream error if it's unavailable.
require_parameters:
type: boolean
nullable: true
description: >-
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:
$ref: '#/components/schemas/DataCollection'
zdr:
type: boolean
nullable: true
description: >-
Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do
not retain prompts will be used.
example: true
enforce_distillable_text:
type: boolean
nullable: true
description: >-
Whether to restrict routing to only models that allow text distillation. When true, only models where the
author has allowed distillation will be used.
example: true
order:
type: array
nullable: true
items:
anyOf:
- $ref: '#/components/schemas/ProviderName'
- type: string
description: >-
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:
type: array
nullable: true
items:
anyOf:
- $ref: '#/components/schemas/ProviderName'
- type: string
description: >-
List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider
settings for this request.
ignore:
type: array
nullable: true
items:
anyOf:
- $ref: '#/components/schemas/ProviderName'
- type: string
description: >-
List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider
settings for this request.
quantizations:
type: array
nullable: true
items:
$ref: '#/components/schemas/Quantization'
description: A list of quantization levels to filter the provider by.
sort:
allOf:
- $ref: '#/components/schemas/ProviderSort'
- anyOf:
- $ref: '#/components/schemas/ProviderSort'
- $ref: '#/components/schemas/ProviderSortConfig'
- nullable: true
description: >-
The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing
is performed.
max_price:
type: object
properties:
prompt:
$ref: '#/components/schemas/BigNumberUnion'
completion:
$ref: '#/components/schemas/BigNumberUnion'
image:
$ref: '#/components/schemas/BigNumberUnion'
audio:
$ref: '#/components/schemas/BigNumberUnion'
request:
$ref: '#/components/schemas/BigNumberUnion'
description: >-
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:
type: number
nullable: true
description: >-
Preferred minimum throughput (in tokens per second). Endpoints below this threshold 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.
example: 100
preferred_max_latency:
type: number
nullable: true
description: >-
Preferred maximum latency (in seconds). Endpoints above this threshold 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.
example: 5
min_throughput:
type: number
nullable: true
deprecated: true
description: >-
**DEPRECATED** Use preferred_min_throughput instead. Backwards-compatible alias for
preferred_min_throughput.
example: 100
x-speakeasy-deprecation-message: Use preferred_min_throughput instead.
max_latency:
type: number
nullable: true
deprecated: true
description: '**DEPRECATED** Use preferred_max_latency instead. Backwards-compatible alias for preferred_max_latency.'
example: 5
x-speakeasy-deprecation-message: Use preferred_max_latency instead.
description: Provider routing preferences for the request.
PublicPricing:
type: object
properties:
@@ -4195,6 +4371,7 @@ components:
- parallel_tool_calls
- include_reasoning
- reasoning
- reasoning_effort
- web_search_options
- verbosity
example: temperature
@@ -4708,6 +4885,78 @@ components:
anyOf:
- $ref: '#/components/schemas/ChatCompletionFinishReason'
- type: 'null'
__schema3:
oneOf:
- type: object
properties:
type:
type: string
const: reasoning.summary
summary:
type: string
id:
$ref: '#/components/schemas/__schema4'
format:
$ref: '#/components/schemas/__schema5'
index:
$ref: '#/components/schemas/__schema6'
required:
- type
- summary
- type: object
properties:
type:
type: string
const: reasoning.encrypted
data:
type: string
id:
$ref: '#/components/schemas/__schema4'
format:
$ref: '#/components/schemas/__schema5'
index:
$ref: '#/components/schemas/__schema6'
required:
- type
- data
- type: object
properties:
type:
type: string
const: reasoning.text
text:
anyOf:
- type: string
- type: 'null'
signature:
anyOf:
- type: string
- type: 'null'
id:
$ref: '#/components/schemas/__schema4'
format:
$ref: '#/components/schemas/__schema5'
index:
$ref: '#/components/schemas/__schema6'
required:
- type
type: object
__schema4:
anyOf:
- type: string
- type: 'null'
__schema5:
anyOf:
- type: string
enum:
- unknown
- openai-responses-v1
- xai-responses-v1
- anthropic-claude-v1
- google-gemini-v1
- type: 'null'
__schema6:
type: number
ModelName:
type: string
ChatMessageContentItemText:
@@ -5253,11 +5502,7 @@ components:
The sorting strategy to use for this request, if "order" is not specified. When set, no load
balancing is performed.
anyOf:
- type: string
enum:
- price
- throughput
- latency
- $ref: '#/components/schemas/ProviderSortUnion'
- type: 'null'
max_price:
description: >-
@@ -5275,17 +5520,19 @@ components:
$ref: '#/components/schemas/__schema1'
request:
$ref: '#/components/schemas/__schema1'
preferred_min_throughput:
anyOf:
- type: number
- type: 'null'
preferred_max_latency:
anyOf:
- type: number
- type: 'null'
min_throughput:
description: >-
The minimum throughput (in tokens per second) required for this request. Only providers serving the
model with at least this throughput will be used.
anyOf:
- type: number
- type: 'null'
max_latency:
description: >-
The maximum latency (in seconds) allowed for this request. Only providers serving the model with
better than this latency will be used.
anyOf:
- type: number
- type: 'null'
@@ -5328,8 +5575,6 @@ components:
const: file-parser
enabled:
type: boolean
max_files:
type: number
pdf:
type: object
properties:
@@ -5352,9 +5597,6 @@ components:
- id
type: object
route:
description: >-
Routing strategy for multiple models: "fallback" (default) uses secondary models as backups, "sort" sorts
all endpoints together by routing criteria.
anyOf:
- type: string
enum:
@@ -5434,12 +5676,12 @@ components:
anyOf:
- type: string
enum:
- none
- minimal
- low
- medium
- high
- xhigh
- high
- medium
- low
- minimal
- none
- type: 'null'
summary:
anyOf:
@@ -5520,6 +5762,10 @@ components:
type: boolean
required:
- messages
ProviderSortUnion:
anyOf:
- $ref: '#/components/schemas/ProviderSort'
- $ref: '#/components/schemas/ProviderSortConfig'
ChatResponseChoice:
type: object
properties:
@@ -5529,6 +5775,10 @@ components:
type: number
message:
$ref: '#/components/schemas/AssistantMessage'
reasoning_details:
type: array
items:
$ref: '#/components/schemas/__schema3'
logprobs:
anyOf:
- $ref: '#/components/schemas/ChatMessageTokenLogprobs'
@@ -5579,6 +5829,10 @@ components:
type: array
items:
$ref: '#/components/schemas/ChatStreamingMessageToolCall'
reasoning_details:
type: array
items:
$ref: '#/components/schemas/__schema3'
ChatStreamingChoice:
type: object
properties:
@@ -6403,111 +6657,7 @@ paths:
user:
type: string
provider:
type: object
properties:
allow_fallbacks:
type: boolean
nullable: true
description: >
Whether to allow backup providers to serve requests
- true: (default) when the primary provider (or your custom providers in "order") is
unavailable, use the next best provider.
- false: use only the primary/custom provider, and return the upstream error if it's
unavailable.
require_parameters:
type: boolean
nullable: true
description: >-
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:
$ref: '#/components/schemas/DataCollection'
zdr:
type: boolean
nullable: true
description: >-
Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only
endpoints that do not retain prompts will be used.
example: true
enforce_distillable_text:
type: boolean
nullable: true
description: >-
Whether to restrict routing to only models that allow text distillation. When true, only models
where the author has allowed distillation will be used.
example: true
order:
type: array
nullable: true
items:
anyOf:
- $ref: '#/components/schemas/ProviderName'
- type: string
description: >-
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:
type: array
nullable: true
items:
anyOf:
- $ref: '#/components/schemas/ProviderName'
- type: string
description: >-
List of provider slugs to allow. If provided, this list is merged with your account-wide allowed
provider settings for this request.
ignore:
type: array
nullable: true
items:
anyOf:
- $ref: '#/components/schemas/ProviderName'
- type: string
description: >-
List of provider slugs to ignore. If provided, this list is merged with your account-wide
ignored provider settings for this request.
quantizations:
type: array
nullable: true
items:
$ref: '#/components/schemas/Quantization'
description: A list of quantization levels to filter the provider by.
sort:
$ref: '#/components/schemas/ProviderSort'
max_price:
type: object
properties:
prompt:
$ref: '#/components/schemas/BigNumberUnion'
completion:
$ref: '#/components/schemas/BigNumberUnion'
image:
$ref: '#/components/schemas/BigNumberUnion'
audio:
$ref: '#/components/schemas/BigNumberUnion'
request:
$ref: '#/components/schemas/BigNumberUnion'
description: >-
The object specifying the maximum price you want to pay for this request. USD price per million
tokens, for prompt and completion.
min_throughput:
type: number
nullable: true
example: 100
description: >-
The minimum throughput (in tokens per second) required for this request. Only providers serving
the model with at least this throughput will be used.
max_latency:
type: number
nullable: true
example: 5
description: >-
The maximum latency (in seconds) allowed for this request. Only providers serving the model with
better than this latency will be used.
$ref: '#/components/schemas/ProviderPreferences'
input_type:
type: string
required:
@@ -7109,77 +7259,7 @@ paths:
name: slug
in: path
- schema:
type: string
enum:
- AI21
- AionLabs
- Alibaba
- Amazon Bedrock
- Amazon Nova
- Anthropic
- Arcee AI
- AtlasCloud
- Avian
- Azure
- BaseTen
- BytePlus
- Black Forest Labs
- Cerebras
- Chutes
- Cirrascale
- Clarifai
- Cloudflare
- Cohere
- Crusoe
- DeepInfra
- DeepSeek
- Featherless
- Fireworks
- Friendli
- GMICloud
- GoPomelo
- Google
- Google AI Studio
- Groq
- Hyperbolic
- Inception
- InferenceNet
- Infermatic
- Inflection
- Liquid
- Mara
- Mancer 2
- Minimax
- ModelRun
- Mistral
- Modular
- Moonshot AI
- Morph
- NCompass
- Nebius
- NextBit
- Novita
- Nvidia
- OpenAI
- OpenInference
- Parasail
- Perplexity
- Phala
- Relace
- SambaNova
- SiliconFlow
- Sourceful
- Stealth
- StreamLake
- Switchpoint
- Targon
- Together
- Venice
- WandB
- Xiaomi
- xAI
- Z.AI
- FakeProvider
$ref: '#/components/schemas/ProviderName'
required: false
name: provider
in: query
@@ -7224,6 +7304,7 @@ paths:
- parallel_tool_calls
- include_reasoning
- reasoning
- reasoning_effort
- web_search_options
- verbosity
description: List of parameters supported by this model