Document voice upload fields on Create Model - #109
Conversation
Two users asked how to pass samples to this endpoint. It is not a request field: the request takes type, title, train_mode and voices, and samples appears only on the returned model, defaulting to an empty list. Adds the required fields, a multipart example matching the schema, and a note on texts. Closes fishaudio#40 Closes fishaudio#41
📝 WalkthroughWalkthroughThe create-model endpoint reference adds instructions for multipart voice uploads, repeated audio and transcript fields, automatic ASR behavior, and the response-only ChangesModel upload documentation
Estimated code review effort: 1 (Trivial) | ~2 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@api-reference/endpoint/model/create-model.mdx`:
- Line 20: Update the code fence preceding the curl example in the create-model
documentation from the invalid “bash curl” info string to the valid “bash”
language tag, preserving the example content and project formatting conventions.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: f00ad9aa-ab1d-4027-8559-65d938473326
📒 Files selected for processing (1)
api-reference/endpoint/model/create-model.mdx
| `type`, `title`, `train_mode`, and `voices` are required. Send each audio file | ||
| as a `voices` form field, repeating the field to upload several clips. | ||
|
|
||
| ```bash curl |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Use a valid language tag for the code fence.
Change ```bash curl to ```bash; the current info string may prevent MDX renderers from recognizing the block as Bash. As per coding guidelines, all code blocks must include language tags and examples must follow the project’s formatting conventions.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@api-reference/endpoint/model/create-model.mdx` at line 20, Update the code
fence preceding the curl example in the create-model documentation from the
invalid “bash curl” info string to the valid “bash” language tag, preserving the
example content and project formatting conventions.
Source: Coding guidelines
Two separate reports asked how to pass
sampleswhen creating a model: #40 ("samples": [], how do I pass it?) and #41 (no correct sample parameter was returned. The sample cannot be edited).The answer is that
samplesis not a request field at all, and nothing in the page said so. Checked againsthttps://api.fish.audio/openapi.jsonforPOST /model:samplesproperty, in any of the four content types it acceptsrequiredis["type", "title", "train_mode", "voices"]samplesappears only on the 201 response model, as{"default": [], "items": {"$ref": "#/components/schemas/SampleEntity"}}That empty-list default is what both reporters were looking at in the playground.
The page was only the multipart warning, so this adds the smallest thing that answers the question:
multipart/form-dataexample that repeatsvoicesfor several clips, matching the style already used infeatures/voice-cloning.mdxtextsmaps to the clips, and that ASR runs when it is omittedsamplesis response-onlyNo generated files touched.
api-reference/openapi.jsonis deliberately left alone.Heads up on CI:
check-openapifails here because the committedapi-reference/openapi.jsonis behind the live schema, which is what #107 updates. It is unrelated to this change.Closes #40
Closes #41
Summary by CodeRabbit
samplesis returned as preview data rather than submitted in the request.