Skip to content

Conversation

@HavenDV
Copy link
Contributor

@HavenDV HavenDV commented Oct 22, 2025

Summary by CodeRabbit

  • New Features
    • Added a source indicator to prediction responses, showing whether a prediction was created via web interface or API.

@HavenDV HavenDV enabled auto-merge (squash) October 22, 2025 18:23
@coderabbitai
Copy link

coderabbitai bot commented Oct 22, 2025

Walkthrough

Adds a new source field to the prediction response schema in the OpenAPI specification. The field is a string enum with two possible values—web and api—that indicates how the prediction was created.

Changes

Cohort / File(s) Summary
OpenAPI Schema Enhancement
src/libs/Replicate/openapi.yaml
Added new source field (enum: web, api) to the schemas_prediction_response object to indicate the origin of prediction creation

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Poem

🐰 A source field hops into the schema,
Web or API, now the prediction knows its way,
Enum values dancing, small but sincere,
The schema evolves, and clarity's here! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title Check ⚠️ Warning The pull request title is "feat:@coderabbitai", which appears to be a conventional commit prefix followed by a mention of a bot/user. However, this title does not describe the actual changes in the changeset. The PR adds a new source field to the prediction response schema in the OpenAPI specification, with values of "web" or "api" to indicate how a prediction was created. The title provides no indication of this change and would mislead a teammate reviewing the commit history, as it conveys no meaningful information about the code modifications. Revise the pull request title to clearly describe the primary change, such as "feat: Add source field to prediction response schema" or "feat: Add source enum field to indicate prediction origin (web/api)". This will help team members quickly understand the purpose of the change when scanning commit history.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bot/update-openapi_202510221822

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@HavenDV HavenDV merged commit b7aaf05 into main Oct 22, 2025
3 of 4 checks passed
@HavenDV HavenDV deleted the bot/update-openapi_202510221822 branch October 22, 2025 18:24
@coderabbitai coderabbitai bot changed the title feat:@coderabbitai feat:Add source field to prediction response schema Oct 22, 2025
Copy link

@coderabbitai coderabbitai bot left a 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

📥 Commits

Reviewing files that changed from the base of the PR and between a017971 and c7ff693.

⛔ Files ignored due to path filters (8)
  • src/libs/Replicate/Generated/Replicate..JsonSerializerContext.g.cs is excluded by !**/generated/**
  • src/libs/Replicate/Generated/Replicate.IReplicateApi.PredictionsGet.g.cs is excluded by !**/generated/**
  • src/libs/Replicate/Generated/Replicate.JsonConverters.SchemasPredictionResponseSource.g.cs is excluded by !**/generated/**
  • src/libs/Replicate/Generated/Replicate.JsonConverters.SchemasPredictionResponseSourceNullable.g.cs is excluded by !**/generated/**
  • src/libs/Replicate/Generated/Replicate.JsonSerializerContextTypes.g.cs is excluded by !**/generated/**
  • src/libs/Replicate/Generated/Replicate.Models.SchemasPredictionResponse.g.cs is excluded by !**/generated/**
  • src/libs/Replicate/Generated/Replicate.Models.SchemasPredictionResponseSource.g.cs is excluded by !**/generated/**
  • src/libs/Replicate/Generated/Replicate.ReplicateApi.PredictionsGet.g.cs is 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 source field 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 that source indicates whether the prediction was created via web or api.

Comment on lines +1534 to +1539
source:
enum:
- web
- api
type: string
description: Indicates how the prediction was created
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

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
        - urls

Committable 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants