Accept universal format#253
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 47198f94eb
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "Codex (@codex) address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a0e218f442
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "Codex (@codex) address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 04ef0db0bf
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "Codex (@codex) address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f172aad5ab
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "Codex (@codex) address that feedback".
|
Codex (@codex) review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9ec087a54f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "Codex (@codex) address that feedback".
|
Codex (@codex) review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bd7b8cfa28
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "Codex (@codex) address that feedback".
|
Codex (@codex) review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 219af67967
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "Codex (@codex) address that feedback".
|
|
||
| struct UniversalAdapter; | ||
|
|
||
| impl ProviderAdapter for UniversalAdapter { |
There was a problem hiding this comment.
Handle Universal as a stream target
When callers request transform_stream_chunk(..., ProviderFormat::Universal), the new adapter is now selected as the target adapter, but it does not override stream_from_universal, so every provider stream chunk that successfully normalizes to a UniversalStreamChunk fails with StreamingNotImplemented("Universal") instead of returning the universal chunk. This affects any streaming route/API that exposes the newly accepted universal format as a peer output format; implement the stream methods (or special-case Universal in transform_stream_chunk_step) so streaming parity matches requests/responses.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
I'm going to deal with streaming later.
| let source_format = source_adapter.format(); | ||
| let target_adapter = adapter_for_format(target_format) | ||
| .ok_or(TransformError::UnsupportedTargetFormat(target_format))?; | ||
|
|
There was a problem hiding this comment.
why did we remove this?
There was a problem hiding this comment.
It got moved below
| * Response format type (portable across providers). | ||
| */ | ||
| export type ResponseFormatType = "Text" | "JsonObject" | "JsonSchema"; | ||
| export type ResponseFormatType = "text" | "json_object" | "json_schema"; |
There was a problem hiding this comment.
why did these all lower case?
There was a problem hiding this comment.
Had to do with this comment I think which is why i changed it: "Now that the universal adapter detects requests by deserializing UniversalRequest, payloads that use the documented/canonical params.tool_choice.mode strings such as "auto", "none", or "required" are rejected because this enum has no serde rename/alias and serde expects "Auto", "None", etc. In that scenario detect_request returns false and universal input fails with UnableToDetectRequestFormat instead of transforming."
Universal format should be something lingua can accept as a peer to the other ones.