-
Notifications
You must be signed in to change notification settings - Fork 1
Accept universal format #253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
e804687
47198f9
a0e218f
04ef0db
f172aad
36cc60c
a3da14e
85fd793
0d8b4ef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -87,6 +87,7 @@ fn format_identifier(format: ProviderFormat) -> String { | |
| ProviderFormat::Mistral => "mistral", | ||
| ProviderFormat::Converse => "bedrock", | ||
| ProviderFormat::Responses => "openai", // Responses API uses OpenAI provider | ||
| ProviderFormat::Universal => "universal", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i wonder what this looks like in practice. i'd like to see more testing with
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. SG I won't merge until I get it running end to end with a UI form. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Mapping Useful? React with 👍 / 👎. |
||
| ProviderFormat::Unknown => "unknown", | ||
| } | ||
| .to_string() | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,6 +31,8 @@ pub enum ProviderFormat { | |
| Converse, | ||
| /// OpenAI Responses API format (for reasoning models like o1-pro, o3) | ||
| Responses, | ||
| /// Lingua universal request format | ||
| Universal, | ||
| /// Internal-only format for Bedrock Anthropic invoke envelope handling. | ||
| #[serde(skip_serializing, skip_deserializing)] | ||
| #[ts(skip)] | ||
|
|
@@ -61,6 +63,7 @@ impl std::fmt::Display for ProviderFormat { | |
| ProviderFormat::Mistral => "mistral", | ||
| ProviderFormat::Converse => "converse", | ||
| ProviderFormat::Responses => "responses", | ||
| ProviderFormat::Universal => "universal", | ||
| ProviderFormat::BedrockAnthropic => "bedrock_anthropic", | ||
| ProviderFormat::VertexAnthropic => "vertex_anthropic", | ||
| ProviderFormat::Unknown => "unknown", | ||
|
|
@@ -80,6 +83,7 @@ impl std::str::FromStr for ProviderFormat { | |
| "mistral" => Ok(ProviderFormat::Mistral), | ||
| "converse" | "bedrock" => Ok(ProviderFormat::Converse), | ||
| "responses" => Ok(ProviderFormat::Responses), | ||
| "universal" => Ok(ProviderFormat::Universal), | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Useful? React with 👍 / 👎. |
||
| _ => Err(()), | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new TypeScript
transformRequestAPI returns onlysourceFormat, so callers cannot tell when the Rust transform upgraded the request to a different wire format (for example Chat Completions → Responses for reasoning+tools requests). In that case, SDK consumers will typically keep using the originally requested endpoint and can send a Responses-shaped payload to/v1/chat/completions, causing request failures despite a “successful” transform result.Useful? React with 👍 / 👎.