-
-
Notifications
You must be signed in to change notification settings - Fork 1
feat:Add source field to prediction response schema #138
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 Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
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 (8)
src/libs/Replicate/Generated/Replicate..JsonSerializerContext.g.csis excluded by!**/generated/**src/libs/Replicate/Generated/Replicate.IReplicateApi.PredictionsGet.g.csis excluded by!**/generated/**src/libs/Replicate/Generated/Replicate.JsonConverters.SchemasPredictionResponseSource.g.csis excluded by!**/generated/**src/libs/Replicate/Generated/Replicate.JsonConverters.SchemasPredictionResponseSourceNullable.g.csis excluded by!**/generated/**src/libs/Replicate/Generated/Replicate.JsonSerializerContextTypes.g.csis excluded by!**/generated/**src/libs/Replicate/Generated/Replicate.Models.SchemasPredictionResponse.g.csis excluded by!**/generated/**src/libs/Replicate/Generated/Replicate.Models.SchemasPredictionResponseSource.g.csis excluded by!**/generated/**src/libs/Replicate/Generated/Replicate.ReplicateApi.PredictionsGet.g.csis excluded by!**/generated/**
📒 Files selected for processing (1)
src/libs/Replicate/openapi.yaml(2 hunks)
🔇 Additional comments (1)
src/libs/Replicate/openapi.yaml (1)
950-950: Verify documentation describes the source field correctly.The prediction details endpoint description (line 950) should explicitly document the
sourcefield behavior. The documentation already mentions it (e.g., in the response example showing"source": "api"), which is good. Ensure all endpoint descriptions that return predictions are consistent in explaining thatsourceindicates whether the prediction was created viaweborapi.
| source: | ||
| enum: | ||
| - web | ||
| - api | ||
| type: string | ||
| description: Indicates how the prediction was created |
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.
Add source to the required fields list for consistency with API behavior.
The source field is correctly added to the response schema with appropriate enum values and description. However, examining the API documentation examples (e.g., lines 883-930 in predictions.list), the source field is shown as always present in responses. This field should be added to the required list at lines 1479-1489 to accurately reflect that it's always included in prediction responses.
Apply this diff to add source to the required fields:
required:
- id
- model
- version
- input
- output
- data_removed
- error
- status
- created_at
+ - source
- urlsCommittable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In src/libs/Replicate/openapi.yaml around lines 1479-1489 and 1534-1539, the
prediction response schema defines a source field (enum: web, api) but that
field is not listed as required; update the required list at lines ~1479-1489 to
include "source" so the schema accurately reflects that source is always present
in responses, ensuring the required array contains the string source alongside
the existing required properties.
Summary by CodeRabbit
sourceindicator to prediction responses, showing whether a prediction was created via web interface or API.