-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat:Add ModelMetadata; require in OpenAIModelOut; use in ModelFieldInfo #215
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
WalkthroughAdds a new ModelMetadata schema to OpenAPI, makes metadata a required reference in OpenAIModelOut, and replaces ModelFieldInfo.parent with ModelFieldInfo.metadata referencing ModelMetadata. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant C as Client
participant API as DeepInfra API
participant S as Schemas
Note over S: New Schema: ModelMetadata
C->>API: GET /models/{id}
API->>S: Construct OpenAIModelOut
S-->>API: Include metadata: ModelMetadata
API-->>C: 200 OK (model with metadata)
Note over S: ModelFieldInfo.parent removed
C->>API: GET /model-fields/{id}
API->>S: Build ModelFieldInfo
S-->>API: Provide metadata: ModelMetadata
API-->>C: 200 OK (field info with metadata)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
✨ 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. CodeRabbit Commands (Invoked using PR/Issue comments)Type 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 (2)
src/libs/DeepInfra/openapi.yaml (2)
5940-5968: ModelMetadata schema added — consider tightening constraints and documenting pricing keysThe structure looks reasonable. To improve interoperability and validation, consider:
- Non-negative constraints on numeric fields.
- Clarifying units and allowed keys in pricing (e.g., prompt/completion per token, image_units, etc.) to avoid ambiguity versus other pricing schemas already present.
Apply this diff within the added block to add minimum constraints and descriptions:
ModelMetadata: title: ModelMetadata required: - description - context_length - max_tokens - pricing - tags type: object properties: description: title: Description type: string + description: Short human-readable summary of the model context_length: title: Context Length type: integer + minimum: 0 + description: Maximum input context length supported by the model (tokens) max_tokens: title: Max Tokens type: integer + minimum: 0 + description: Maximum output tokens per request supported by the model pricing: title: Pricing type: object additionalProperties: type: number + minimum: 0 + description: Map of pricing metrics to unit prices (e.g. cents_per_input_token, cents_per_output_token, cents_per_sec) tags: title: Tags type: array items: type: string + description: Arbitrary model tags (capabilities, modalities, vendor, etc.)
6779-6781: OpenAIModelOut:metadatais defined but not marked required;parentstill presentThe current schema in
src/libs/DeepInfra/openapi.yamldefines ametadataproperty underOpenAIModelOutwithout listing it in therequiredarray (so it’s optional), yet the PR summary states it’s required. Meanwhile the oldparentfield remains.• In
OpenAIModelOut(around lines 6751–6781):
– If metadata must be mandatory, add it to therequiredlist.
– If parent is deprecated, either remove it or mark it in the description.Suggested diff:
OpenAIModelOut: title: OpenAIModelOut required: - id - created - owned_by - root + - metadata type: object properties: parent: title: Parent type: 'null' - + description: Deprecated. Use `metadata` instead.If you intend for
metadatato remain optional, skip updatingrequiredand retainparentunchanged—but please confirm client expectations and versioning strategy.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (6)
src/libs/DeepInfra/Generated/DeepInfra.JsonSerializerContextTypes.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadata.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadata.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataPricing.Json.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.ModelMetadataPricing.g.csis excluded by!**/generated/**src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIModelOut.g.csis excluded by!**/generated/**
📒 Files selected for processing (1)
src/libs/DeepInfra/openapi.yaml(2 hunks)
Summary by CodeRabbit
New Features
Refactor