feat:Update Cohere OpenAPI: shorten stream, remove texts, add embed schemas#168
feat:Update Cohere OpenAPI: shorten stream, remove texts, add embed schemas#168
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.
Actionable comments posted: 0
🧹 Nitpick comments (3)
src/libs/Cohere/openapi.yaml (3)
7451-7457: Stream Property Description Truncation Review
The updated description for thestreamproperty 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, andEmbedInputTypeSchemas
The schemas forEmbedImageand its nested properties are defined in detail. A couple of points for consideration:
- The properties such as
bit_depth,height, andwidthare specified as typenumberwith a format ofint64. If these values are strictly integers, it might be clearer to use typeinteger.- The
EmbedInputschema now requires acontentproperty 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 ofEmbedTextandEmbeddingTypeSchemas
TheEmbedTextschema is now defined with both atextstring and atypeproperty (referencingEmbedContentType), which is consistent with the discriminated union approach. TheEmbeddingTypeenum 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.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.CohereClient.Embedv2.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.ICohereClient.Chatv2.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.ICohereClient.Embedv2.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.Models.Chatv2Request.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.Models.EmbedByTypeResponse.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.Models.EmbedContent.Json.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.Models.EmbedContent.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.Models.EmbedContentDiscriminator.Json.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.Models.EmbedContentDiscriminator.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.Models.EmbedContentDiscriminatorType.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.Models.EmbedContentType.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.Models.EmbedImage.Json.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.Models.EmbedImage.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.Models.EmbedImageProperties.Json.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.Models.EmbedImageProperties.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.Models.EmbedInput.Json.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.Models.EmbedInput.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.Models.EmbedText.Json.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.Models.EmbedText.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.Models.Embedv2Request.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/JsonConverters.EmbedContent.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/JsonConverters.EmbedContentDiscriminatorType.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/JsonConverters.EmbedContentDiscriminatorTypeNullable.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/JsonConverters.EmbedContentType.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/JsonConverters.EmbedContentTypeNullable.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/JsonSerializerContext.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/JsonSerializerContextTypes.g.csis 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:inputsandoutput_dimension
The newinputsproperty (an array referencingEmbedInput) and theoutput_dimensionproperty (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 existingtextsproperty is still present; ensure it’s now optional if it has been removed from the required fields.
14132-14154: Introduction ofEmbedContent&EmbedContentTypeSchemas
The newEmbedContentschema uses aoneOfconstruct with a discriminator based on thetypefield, and theEmbedContentTypeschema correctly enumerates the allowed values (textandimage_url). Confirm that the downstream consumers of this API are updated to correctly handle the discriminator mapping and that both referenced schemas (EmbedImageandEmbedText) provide a compatibletypefield.
Summary by CodeRabbit