-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat:Update Cohere OpenAPI: shorten stream, remove texts, add embed schemas #168
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
Conversation
WalkthroughThe pull request updates the OpenAPI specification in Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant API
Client->>API: Send request with inputs (array of EmbedInput)
Note right of API: Validate against new schemas<br/>(EmbedContent, EmbedImage, EmbedText, etc.)
API-->>Client: Respond with output_dimension and embedded content details
Possibly related PRs
Poem
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (3)
src/libs/Cohere/openapi.yaml (3)
7451-7457
: Stream Property Description Truncation Review
The updated description for thestream
property is now more concise. Please verify that the removal of references (e.g. to “Compatible Deployments”) does not confuse users who might rely on that detail. Review your external documentation and error messages to ensure consistency.
15237-15291
: Definition ofEmbedImage
,EmbedImageProperties
,EmbedInput
, andEmbedInputType
Schemas
The schemas forEmbedImage
and its nested properties are defined in detail. A couple of points for consideration:
- The properties such as
bit_depth
,height
, andwidth
are specified as typenumber
with a format ofint64
. If these values are strictly integers, it might be clearer to use typeinteger
.- The
EmbedInput
schema now requires acontent
property that is an array referencingEmbedContent
, which aligns with the new structured input design.Ensure that the type choices align with the expected data (especially regarding integer vs. number distinction).
15358-15374
: Addition ofEmbedText
andEmbeddingType
Schemas
TheEmbedText
schema is now defined with both atext
string and atype
property (referencingEmbedContentType
), which is consistent with the discriminated union approach. TheEmbeddingType
enum currently only includesfloat
—please confirm that this is intentional and that additional embedding types won’t be required soon.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (28)
src/libs/Cohere/Generated/Cohere.CohereClient.Chatv2.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/Cohere.CohereClient.Embedv2.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/Cohere.ICohereClient.Chatv2.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/Cohere.ICohereClient.Embedv2.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/Cohere.Models.Chatv2Request.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/Cohere.Models.EmbedByTypeResponse.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/Cohere.Models.EmbedContent.Json.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/Cohere.Models.EmbedContent.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/Cohere.Models.EmbedContentDiscriminator.Json.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/Cohere.Models.EmbedContentDiscriminator.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/Cohere.Models.EmbedContentDiscriminatorType.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/Cohere.Models.EmbedContentType.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/Cohere.Models.EmbedImage.Json.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/Cohere.Models.EmbedImage.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/Cohere.Models.EmbedImageProperties.Json.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/Cohere.Models.EmbedImageProperties.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/Cohere.Models.EmbedInput.Json.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/Cohere.Models.EmbedInput.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/Cohere.Models.EmbedText.Json.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/Cohere.Models.EmbedText.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/Cohere.Models.Embedv2Request.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/JsonConverters.EmbedContent.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/JsonConverters.EmbedContentDiscriminatorType.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/JsonConverters.EmbedContentDiscriminatorTypeNullable.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/JsonConverters.EmbedContentType.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/JsonConverters.EmbedContentTypeNullable.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/JsonSerializerContext.g.cs
is excluded by!**/generated/**
src/libs/Cohere/Generated/JsonSerializerContextTypes.g.cs
is excluded by!**/generated/**
📒 Files selected for processing (1)
src/libs/Cohere/openapi.yaml
(5 hunks)
🔇 Additional comments (2)
src/libs/Cohere/openapi.yaml (2)
7994-8015
: Addition of New Properties:inputs
andoutput_dimension
The newinputs
property (an array referencingEmbedInput
) and theoutput_dimension
property (type integer) appear correctly added to the schema. Verify that these additions reflect the intended data model and that related validations (if any) are updated accordingly. Also, note that the existingtexts
property is still present; ensure it’s now optional if it has been removed from the required fields.
14132-14154
: Introduction ofEmbedContent
&EmbedContentType
Schemas
The newEmbedContent
schema uses aoneOf
construct with a discriminator based on thetype
field, and theEmbedContentType
schema correctly enumerates the allowed values (text
andimage_url
). Confirm that the downstream consumers of this API are updated to correctly handle the discriminator mapping and that both referenced schemas (EmbedImage
andEmbedText
) provide a compatibletype
field.
Summary by CodeRabbit