-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat:Update OpenAPI schema to allow string or array input for OpenAIEmbeddingsIn #161
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 OpenAPI schema for the Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant API
Client->>API: Send embeddings request with input (string or array of strings)
API-->>Client: Validate input (string or array, max 1024 length)
API-->>Client: Process and respond with embeddings
Poem
Note ⚡️ AI Code Reviews for VS Code, Cursor, WindsurfCodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback. Note ⚡️ Faster reviews with cachingCodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure ✨ Finishing Touches🧪 Generate Unit Tests
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:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (5)
src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiEmbeddings.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiEmbeddings.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIEmbeddingsIn.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/JsonSerializerContext.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/JsonSerializerContextTypes.g.csis excluded by!**/generated/**
📒 Files selected for processing (1)
src/libs/DeepInfra/openapi.yaml(1 hunks)
| maxLength: 1024 | ||
| anyOf: | ||
| - type: array | ||
| items: | ||
| type: string | ||
| - type: string |
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.
🛠️ Refactor suggestion
Ensure correct application of length constraints for both variants
The current placement of maxLength: 1024 at the same level as anyOf may apply indiscriminately to arrays and strings, and the array variant no longer enforces a maximum of 1024 items. To preserve the original intent—limit string inputs to 1024 characters and array inputs to 1024 items—consider:
input:
title: Input
- maxLength: 1024
- anyOf:
- - type: array
- items:
- type: string
- - type: string
+ anyOf:
+ - type: array
+ items:
+ type: string
+ maxItems: 1024
+ - type: string
+ maxLength: 1024
description: sequences to embed📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| maxLength: 1024 | |
| anyOf: | |
| - type: array | |
| items: | |
| type: string | |
| - type: string | |
| input: | |
| title: Input | |
| anyOf: | |
| - type: array | |
| items: | |
| type: string | |
| maxItems: 1024 | |
| - type: string | |
| maxLength: 1024 | |
| description: sequences to embed |
🤖 Prompt for AI Agents
In src/libs/DeepInfra/openapi.yaml around lines 5574 to 5579, the maxLength
constraint is incorrectly applied at the same level as anyOf, causing it to
apply to both arrays and strings indiscriminately and removing the limit on
array items. To fix this, move the maxLength: 1024 constraint inside the string
type definition to limit string length, and add a maxItems: 1024 constraint
inside the array type definition to limit the number of items in the array.
Summary by CodeRabbit
New Features
Chores