-
-
Notifications
You must be signed in to change notification settings - Fork 1
feat:Add example predictions and Markdown README endpoints #80
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
WalkthroughThis change adds two new endpoints to the Replicate API specification. One endpoint provides a list of example predictions for a specified model, including pagination details, while the other endpoint serves the README documentation in Markdown format for the requested model. Both endpoints use dynamic parameters for the model owner and name and include provisions for successful responses and error handling. Changes
Sequence Diagram(s)sequenceDiagram
participant C as Client
participant API as Replicate API
participant DB as Database/Model Repository
C->>API: GET /models/{model_owner}/{model_name}/examples
API->>DB: Retrieve example predictions (with pagination)
DB-->>API: Example predictions data
API-->>C: 200 OK with list of examples
sequenceDiagram
participant C as Client
participant API as Replicate API
participant FS as File System/Documentation Storage
C->>API: GET /models/{model_owner}/{model_name}/readme
API->>FS: Retrieve README in Markdown format
alt README Found
FS-->>API: README content
API-->>C: 200 OK with Markdown content
else README Not Found
API-->>C: 404 Not Found
end
Poem
Tip ⚡🧪 Multi-step agentic review comment chat (experimental)
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:
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: 0
🧹 Nitpick comments (2)
src/libs/Replicate/openapi.yaml (2)
635-653: Review of the "examples" Endpoint DefinitionThe new endpoint for listing model examples is well defined with a clear summary, detailed description, and the required path parameters (
model_ownerandmodel_name). One small improvement to consider is explicitly defining the response content schema (e.g. a pagination object) rather than just returning a description with status 200. This would improve consistency with other endpoints in your API documentation.
699-727: Review of the "readme" Endpoint DefinitionThe endpoint for fetching a model’s README is clearly documented. The summary, description, and required path parameters are provided, and the response correctly specifies a content type of
text/plainwith a schema indicating a Markdown string. One minor suggestion is to consider whethertext/markdownmight be a more semantically appropriate media type for Markdown content. If the API consumer expects Markdown explicitly, this might help improve clarity.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (4)
src/libs/Replicate/Generated/Replicate.IReplicateApi.ModelsExamplesList.g.csis excluded by!**/generated/**src/libs/Replicate/Generated/Replicate.IReplicateApi.ModelsReadmeGet.g.csis excluded by!**/generated/**src/libs/Replicate/Generated/Replicate.ReplicateApi.ModelsExamplesList.g.csis excluded by!**/generated/**src/libs/Replicate/Generated/Replicate.ReplicateApi.ModelsReadmeGet.g.csis excluded by!**/generated/**
📒 Files selected for processing (1)
src/libs/Replicate/openapi.yaml(2 hunks)
Summary by CodeRabbit