-
-
Notifications
You must be signed in to change notification settings - Fork 1
feat:Add PATCH for model metadata; add total_time; update GET descriptions #132
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
WalkthroughAdded a PATCH operation to update model metadata at /models/{model_owner}/{model_name}. Extended prediction and training metrics schemas to include total_time. Streamlined descriptions for predictions and trainings GET endpoints. All changes are within src/libs/Replicate/openapi.yaml. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Client
participant API as Replicate API
participant Store as Model Store
rect rgba(230,245,255,0.6)
note over Client,API: Update model metadata
Client->>API: PATCH /models/{owner}/{name}<br/>JSON: {description, readme, github_url, paper_url, weights_url, license_url}
API->>Store: Validate and persist metadata update
Store-->>API: Updated model record
API-->>Client: 200 OK (schemas_model_response)
end
sequenceDiagram
autonumber
actor Client
participant API as Replicate API
participant Runner as Prediction/Training Runner
rect rgba(240,255,240,0.6)
note over Client,API: Retrieve state with total_time
Client->>API: GET /predictions/{id}
API->>Runner: Fetch status and metrics
Runner-->>API: {metrics: {predict_time, total_time, ...}}
API-->>Client: 200 OK (schemas_prediction_response)
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
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 (12)
src/libs/Replicate/Generated/Replicate.IReplicateApi.ModelsUpdate.g.csis excluded by!**/generated/**src/libs/Replicate/Generated/Replicate.IReplicateApi.PredictionsGet.g.csis excluded by!**/generated/**src/libs/Replicate/Generated/Replicate.IReplicateApi.TrainingsGet.g.csis excluded by!**/generated/**src/libs/Replicate/Generated/Replicate.JsonSerializerContextTypes.g.csis excluded by!**/generated/**src/libs/Replicate/Generated/Replicate.Models.ModelsUpdateRequest.Json.g.csis excluded by!**/generated/**src/libs/Replicate/Generated/Replicate.Models.ModelsUpdateRequest.g.csis excluded by!**/generated/**src/libs/Replicate/Generated/Replicate.Models.SchemasPredictionResponse.g.csis excluded by!**/generated/**src/libs/Replicate/Generated/Replicate.Models.SchemasPredictionResponseMetrics.g.csis excluded by!**/generated/**src/libs/Replicate/Generated/Replicate.Models.SchemasTrainingResponseMetrics.g.csis excluded by!**/generated/**src/libs/Replicate/Generated/Replicate.ReplicateApi.ModelsUpdate.g.csis excluded by!**/generated/**src/libs/Replicate/Generated/Replicate.ReplicateApi.PredictionsGet.g.csis excluded by!**/generated/**src/libs/Replicate/Generated/Replicate.ReplicateApi.TrainingsGet.g.csis excluded by!**/generated/**
📒 Files selected for processing (1)
src/libs/Replicate/openapi.yaml(5 hunks)
| type: object | ||
| properties: | ||
| total_time: | ||
| type: number | ||
| description: 'The total time, in seconds, that the prediction took to complete' | ||
| description: Additional metrics associated with the prediction |
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.
Restore predict_time in prediction metrics.
While adding total_time, the schema dropped the existing predict_time property, so client SDKs generated from this spec will lose the field definition. Add total_time alongside predict_time instead of replacing it.
metrics:
type: object
- properties:
- total_time:
- type: number
- description: 'The total time, in seconds, that the prediction took to complete'
+ properties:
+ predict_time:
+ type: number
+ description: 'The amount of CPU or GPU time, in seconds, that the prediction used while running'
+ total_time:
+ type: number
+ description: 'The total time, in seconds, that the prediction took to complete'
description: Additional metrics associated with the prediction📝 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.
| type: object | |
| properties: | |
| total_time: | |
| type: number | |
| description: 'The total time, in seconds, that the prediction took to complete' | |
| description: Additional metrics associated with the prediction | |
| type: object | |
| properties: | |
| predict_time: | |
| type: number | |
| description: 'The amount of CPU or GPU time, in seconds, that the prediction used while running' | |
| total_time: | |
| type: number | |
| description: 'The total time, in seconds, that the prediction took to complete' | |
| description: Additional metrics associated with the prediction |
🤖 Prompt for AI Agents
In src/libs/Replicate/openapi.yaml around lines 1493 to 1498 the schema for
prediction metrics replaced the existing predict_time field with total_time;
restore predict_time as a sibling property to total_time by adding a
predict_time entry of type: number with an appropriate description (e.g., 'The
time, in seconds, spent on the model prediction step') so both predict_time and
total_time are present under properties while keeping the description for the
object.
Summary by CodeRabbit
New Features
Improvements
Documentation