-
Notifications
You must be signed in to change notification settings - Fork 7
Update Go SDK API Reference #35
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
base: main
Are you sure you want to change the base?
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds a new comprehensive Go SDK API reference MDX at Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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
🧹 Nitpick comments (3)
api-reference/sdk/go/api-reference.mdx (3)
1-5: Frontmatter title is generic; consider more descriptive wording.The title "API Reference" is broad. Consider using "Go SDK API Reference" or "Fish Audio Go SDK API Reference" for clarity and SEO.
116-217: Verify that all code examples have been tested before publishing.Per documentation guidelines, all code examples must be tested before publishing to ensure accuracy and prevent misleading users. While the examples appear syntactically reasonable, there is no evidence in the PR context that they have been validated against a live SDK or test environment.
Examples that should be verified:
- Transcribe example (lines 118–124)
- GetCredits example (lines 148–151)
- GetPackage example (lines 162–167)
- AudioStream iteration examples (lines 199–216)
Do you have test results or CI validation that confirms these examples run successfully against the SDK? If not, I can help create a verification script to test them.
896-906: Ensure comprehensive examples for key services.While the document provides examples for some methods (Transcribe, GetCredits, GetPackage, AudioStream), other commonly-used methods lack detailed usage examples:
TTSService.Convert()(line 760): Signature documented but no exampleTTSService.Stream()(line 769): Signature documented but no exampleVoicesService.List()(line 939): Signature documented but no exampleConsider adding concise examples for these high-value methods to improve developer experience, especially for TTS operations which are likely primary use cases.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
api-reference/sdk/go/api-reference.mdx
🧰 Additional context used
📓 Path-based instructions (1)
**/*.mdx
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.mdx: Document just enough for user success - not too much, not too little
Prioritize accuracy and usability of information
Make content evergreen when possible
Search for existing information before adding new content. Avoid duplication unless it is done for a strategic reason
Check existing patterns for consistency
Include title in YAML frontmatter: Clear, descriptive page title
Include description in YAML frontmatter: Concise summary for SEO/navigation
Use second-person voice ("you") in documentation content
Include prerequisites at the start of procedural content
Test all code examples before publishing
Match style and formatting of existing pages
Include both basic and advanced use cases in documentation
Include language tags on all code blocks
Include alt text on all images
Use relative paths for internal links
Never use emojis in professional content
Do not skip frontmatter on any MDX file
Do not use absolute URLs for internal links
Do not include untested code examples
Files:
api-reference/sdk/go/api-reference.mdx
🪛 GitHub Check: Mintlify Validation (hanabiaiinc) - vale-spellcheck
api-reference/sdk/go/api-reference.mdx
[warning] 9-9: api-reference/sdk/go/api-reference.mdx#L9
Did you really mean 'fishaudio'?
[warning] 34-34: api-reference/sdk/go/api-reference.mdx#L34
Did you really mean 'APIError'?
[warning] 36-36: api-reference/sdk/go/api-reference.mdx#L36
Did you really mean 'APIError'?
[warning] 65-65: api-reference/sdk/go/api-reference.mdx#L65
Did you really mean 'ASRResponse'?
[warning] 67-67: api-reference/sdk/go/api-reference.mdx#L67
Did you really mean 'ASRResponse'?
[warning] 81-81: api-reference/sdk/go/api-reference.mdx#L81
Did you really mean 'ASRSegment'?
[warning] 83-83: api-reference/sdk/go/api-reference.mdx#L83
Did you really mean 'ASRSegment'?
[warning] 97-97: api-reference/sdk/go/api-reference.mdx#L97
Did you really mean 'ASRService'?
[warning] 99-99: api-reference/sdk/go/api-reference.mdx#L99
Did you really mean 'ASRService'?
[warning] 328-328: api-reference/sdk/go/api-reference.mdx#L328
Did you really mean 'apiKey'?
[warning] 712-712: api-reference/sdk/go/api-reference.mdx#L712
Did you really mean 'TTSConfig'?
[warning] 714-714: api-reference/sdk/go/api-reference.mdx#L714
Did you really mean 'TTSConfig'?
[warning] 746-746: api-reference/sdk/go/api-reference.mdx#L746
Did you really mean 'TTSService'?
[warning] 748-748: api-reference/sdk/go/api-reference.mdx#L748
Did you really mean 'TTSService'?
[warning] 783-783: api-reference/sdk/go/api-reference.mdx#L783
Did you really mean 'textChan'?
🪛 LanguageTool
api-reference/sdk/go/api-reference.mdx
[grammar] ~781-~781: Use a hyphen to join words.
Context: ...error) ``` StreamWebSocket streams text to speech over WebSocket for real-time ...
(QB_NEW_EN_HYPHEN)
[grammar] ~781-~781: Use a hyphen to join words.
Context: ...or) ``` StreamWebSocket streams text to speech over WebSocket for real-time gen...
(QB_NEW_EN_HYPHEN)
[grammar] ~899-~899: Ensure spelling is correct
Context: ...cesService"> ## type VoicesService VoicesService provides voice management operations. ...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
c727a02 to
93a5608
Compare
93a5608 to
8929563
Compare
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
🤖 Fix all issues with AI agents
In `@api-reference/sdk/go/api-reference.mdx`:
- Around line 118-124: The examples currently drop and ignore errors
(os.ReadFile and the returned err from client.ASR.Transcribe and similar
examples like GetCredits and GetPackage); update the Go SDK doc comments that
generate these snippets so each example checks and handles errors instead of
discarding them — e.g., capture the error from os.ReadFile (not `_`), check and
handle err after client.ASR.Transcribe (and likewise in GetCredits/GetPackage),
and mirror the AudioStream example’s pattern (log or return the error) so
generated docs show correct error handling for functions such as os.ReadFile,
client.ASR.Transcribe, GetCredits, GetPackage and AudioStream.
🧹 Nitpick comments (1)
api-reference/sdk/go/api-reference.mdx (1)
7-13: Consider adding a brief introduction with prerequisites.The reference jumps straight into the import statement without context. A short intro paragraph noting the prerequisites (Go version requirement, installation command like
go get github.com/fishaudio/fish-audio-go, and API key setup viaFISH_API_KEY) would help users who land on this page directly. As per coding guidelines, "Include prerequisites at the start of procedural content."
8929563 to
902918f
Compare
902918f to
685c27d
Compare
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
🤖 Fix all issues with AI agents
In `@api-reference/sdk/go/api-reference.mdx`:
- Around line 118-124: The fenced code blocks for the Go examples (e.g., the
block containing "audio, _ := os.ReadFile(...)", "client.ASR.Transcribe",
"fishaudio.TranscribeParams", and other SDK examples) are missing the "go"
language tag; update each affected fenced block to start with ```go instead of
``` to restore proper Go syntax highlighting. Because these examples are
generated by gomarkdoc, fix the upstream Go doc comments (the example code in
the Go SDK source that includes these snippets) so gomarkdoc emits ```go fences,
or if a local quick fix is required, add the ```go tag directly to the generated
api-reference/sdk/go/api-reference.mdx code fences for each example block.
🧹 Nitpick comments (1)
api-reference/sdk/go/api-reference.mdx (1)
7-9: Consider adding a brief introductory sentence.The page jumps directly into
# fishaudiowith no introductory context. A one-line intro such as "Complete API reference for the Fish Audio Go SDK (fish-audio-go)" before the import block would help orient users, and aligns with the guideline to use second-person voice (e.g., "You can use this reference to…").Since the file is auto-generated, this would need to be added to the upstream doc comment or as a post-processing step.
| ``` | ||
| audio, _ := os.ReadFile("audio.mp3") | ||
| result, err := client.ASR.Transcribe(ctx, audio, &fishaudio.TranscribeParams{ | ||
| Language: "en", | ||
| }) | ||
| fmt.Println(result.Text) | ||
| ``` |
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.
Missing go language tag on example code blocks.
The example code blocks at lines 118, 148, 164, and 201 use bare ``` fences without a language identifier. All other code blocks in the file correctly use ```go. This affects syntax highlighting and violates the coding guideline requiring language tags on all code blocks.
Since this is auto-generated by gomarkdoc, the fix would need to happen upstream in the Go SDK doc comments (the tool should emit fenced blocks with the go tag).
Example fix for this block
-```
+```go
audio, _ := os.ReadFile("audio.mp3")Also applies to: 148-151, 164-167, 201-216
As per coding guidelines, "Include language tags on all code blocks".
🤖 Prompt for AI Agents
In `@api-reference/sdk/go/api-reference.mdx` around lines 118 - 124, The fenced
code blocks for the Go examples (e.g., the block containing "audio, _ :=
os.ReadFile(...)", "client.ASR.Transcribe", "fishaudio.TranscribeParams", and
other SDK examples) are missing the "go" language tag; update each affected
fenced block to start with ```go instead of ``` to restore proper Go syntax
highlighting. Because these examples are generated by gomarkdoc, fix the
upstream Go doc comments (the example code in the Go SDK source that includes
these snippets) so gomarkdoc emits ```go fences, or if a local quick fix is
required, add the ```go tag directly to the generated
api-reference/sdk/go/api-reference.mdx code fences for each example block.
Auto-generated from fishaudio/fish-audio-go@9c003ae
685c27d to
32fffbc
Compare
Auto-generated API documentation update from fish-audio-go@9c003ae3706282cf4525a19422ce23079b920b44
Changes