docs: add auto-generated code documentation#327
Open
enesgules wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds an auto-generated “codedocs” documentation set for the Deepgram Go SDK, covering architecture, core concepts, guides, and API reference pages.
Changes:
- Introduces new “Getting Started”, architecture, and core concept pages for the SDK’s layered design and option/auth model.
- Adds practical guides for transcription, microphone streaming, TTS generation, project/key management, and Voice Agent sessions.
- Adds API reference pages for major product surfaces (Listen/Speak/Analyze/Manage/Auth/Agent) and shared client interfaces.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/codedocs/index.md | New landing page + install/quickstart flow and navigation cards. |
| docs/codedocs/architecture.md | High-level layering/flow explanation with diagrams. |
| docs/codedocs/authentication-and-client-options.md | Credential resolution + shared transport option behavior overview. |
| docs/codedocs/realtime-streaming.md | WebSocket lifecycle + callback/channel routing explanation. |
| docs/codedocs/typed-api-layer.md | Explains transport vs typed wrapper split and how to choose imports. |
| docs/codedocs/voice-agent-settings.md | Explains Voice Agent settings boot payload and provider cleanup behavior. |
| docs/codedocs/guides/transcribe-audio.md | Prerecorded transcription “how to” guide. |
| docs/codedocs/guides/stream-microphone-audio.md | Microphone capture + realtime listen WebSocket guide. |
| docs/codedocs/guides/generate-speech.md | REST + WebSocket TTS guide with runnable examples. |
| docs/codedocs/guides/manage-projects-and-keys.md | Manage API usage guide for projects/keys. |
| docs/codedocs/guides/build-a-voice-agent.md | Voice Agent end-to-end session guide with channel handler example. |
| docs/codedocs/api-reference/client-interfaces.md | Reference for shared options/types/helpers across SDK. |
| docs/codedocs/api-reference/listen.md | Listen REST + WebSocket constructors/methods/event interface reference. |
| docs/codedocs/api-reference/speak.md | Speak REST + WebSocket constructors/methods/event interface reference. |
| docs/codedocs/api-reference/analyze.md | Analyze constructors + typed wrapper + transport method reference. |
| docs/codedocs/api-reference/manage.md | Manage constructors + major method surface reference. |
| docs/codedocs/api-reference/auth.md | Auth constructors + token grant workflow reference. |
| docs/codedocs/api-reference/agent.md | Agent constructors/settings types/event interface reference. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+153
to
+154
| fmt.Printf("%s: %s | ||
| ", msg.Role, msg.Content) |
| }) | ||
|
|
||
| dg := api.New(c) | ||
| _, _ = dg.FromURL(ctx, "https://dpgr.am/spacewalk.wav", nil) |
| | `file` | `string` | — | Path to an audio file on disk. | | ||
| | `src` | `io.Reader` | — | Stream of audio bytes. | | ||
| | `url` | `string` | — | Remote audio URL. | | ||
| | `options` | `*interfaces.PreRecordedTranscriptionOptions` | `nil` or explicit struct | Query-string transcription options. | |
| | `file` | `string` | — | Text file path. | | ||
| | `src` | `io.Reader` | — | Reader for text input. | | ||
| | `url` | `string` | — | URL pointing to text content. | | ||
| | `options` | `*interfaces.AnalyzeOptions` | `nil` or explicit struct | Analysis toggles such as `Sentiment`, `Topics`, `Intents`, and `Summarize`. | |
| | `SelfHosted` | `bool` | `false` | Allows missing auth when talking to self-hosted deployments. | | ||
| | `Proxy` | `func(*http.Request) (*url.URL, error)` | `nil` | Custom HTTP or WS proxy function. | | ||
| | `WSHeaderProcessor` | `func(http.Header)` | `nil` | Final mutation hook for WebSocket headers. | | ||
| | `SkipServerAuth` | `bool` | `false` | Disables server-side TLS verification for WebSockets. | |
| ```go | ||
| func NewWithDefaults() *Client | ||
| func New(apiKey string, options *interfaces.ClientOptions) *Client | ||
| func New(client interface{}) *api.Client |
| } | ||
| ``` | ||
|
|
||
| Related pages: [Client Interfaces](/workspace/home/codedocs-template/content/docs/api-reference/client-interfaces.mdx), [Realtime Streaming](/workspace/home/codedocs-template/content/docs/realtime-streaming.mdx) |
| } | ||
| ``` | ||
|
|
||
| Related page: [Voice Agent Settings](/workspace/home/codedocs-template/content/docs/voice-agent-settings.mdx) |
Comment on lines
+112
to
+120
| func (Callback) Binary(by []byte) error { | ||
| f, err := os.OpenFile("streamed.raw", os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0o666) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| defer f.Close() | ||
| _, err = f.Write(by) | ||
| return err | ||
| } |
Comment on lines
+19
to
+22
| func NewWSUsingChanForDemo(ctx context.Context, options *interfaces.SettingsOptions) (*listenv1ws.WSChannel, error) | ||
| func NewWSUsingChanWithDefaults(ctx context.Context, options *interfaces.SettingsOptions, chans msginterfaces.AgentMessageChan) (*listenv1ws.WSChannel, error) | ||
| func NewWSUsingChan(ctx context.Context, apiKey string, cOptions *interfaces.ClientOptions, tOptions *interfaces.SettingsOptions, chans msginterfaces.AgentMessageChan) (*listenv1ws.WSChannel, error) | ||
| func NewWSUsingChanWithCancel(ctx context.Context, ctxCancel context.CancelFunc, apiKey string, cOptions *interfaces.ClientOptions, tOptions *interfaces.SettingsOptions, chans msginterfaces.AgentMessageChan) (*listenv1ws.WSChannel, error) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Auto-generated Code Documentation
AI-analyzed source code to produce structured documentation including:
Browse the documentation →
Generated by Context7 · View docs