Skip to content

feat: Phase 2 — Text Intelligence (/read), models endpoints, Stream ergonomics - #165

Open
dg-coreylweathers wants to merge 1 commit into
feat/phase-1-quick-winsfrom
feat/phase-2-read-stream-models
Open

feat: Phase 2 — Text Intelligence (/read), models endpoints, Stream ergonomics#165
dg-coreylweathers wants to merge 1 commit into
feat/phase-1-quick-winsfrom
feat/phase-2-read-stream-models

Conversation

@dg-coreylweathers

Copy link
Copy Markdown
Contributor

Phase 2 — Text Intelligence & stream ergonomics

Stacked on top of #164 (Phase 1). Base is feat/phase-1-quick-wins, so this diff shows only Phase 2; GitHub will retarget it to main once #164 merges.

What's included

  • Text Intelligence - Analyze (Text to Text) #94 — Text Intelligence (/v1/read). Deepgram::text_intelligence()Read with analyze_text / analyze_url, an Options builder (sentiment, summarize [boolean, not v2], topics, intents, custom topics/intents + modes, language, tag), and a response module reusing the shared sentiment/topic/intent types with a Read-specific Summary { text }. Example analyze_text.
  • Models-listing endpoints. Deepgram::models()Models with get_models, get_model, get_project_models, get_project_model; typed ModelsResponse / Model / ModelMetadata. Example models.
  • [Enhancement] Add async Stream trait implementation for streaming transcription result consumption #163futures::Stream. TranscriptionStream already implements Stream<Item = Result<StreamResponse>>; re-exported at the crate root and documented, with a new stream_futures example showing StreamExt combinators. Verified against the current code (src/listen/websocket.rs:793).

Verification (Rust 1.97 container)

  • build / clippy -D warnings / fmt / cargo test --all --all-features (139 tests, incl. new /read + models deserialization tests) ✅
  • per-feature cargo check (no-default / listen / speak / manage) ✅
  • cargo semver-checks: no new breaking changes — the only 2 breaks are the Phase 1 Extra metadata support #130 streaming ones inherited from the base branch.

Closes #94, #163

…rgonomics

- #94: Text Intelligence (/v1/read). Deepgram::text_intelligence() -> Read
  with analyze_text / analyze_url, an Options builder (sentiment, summarize,
  topics, intents, custom topics/intents, language, tag), and a response
  module reusing the shared sentiment/topic/intent types with a Read-specific
  Summary { text }. New example analyze_text.
- Models endpoints: Deepgram::models() -> Models with get_models, get_model,
  get_project_models, get_project_model, plus typed ModelsResponse/Model/
  ModelMetadata. New example models.
- #163: futures::Stream. listen::websocket::TranscriptionStream already
  implements Stream<Item = Result<StreamResponse>>; re-exported and
  documented, with a new stream_futures example demonstrating StreamExt
  combinator usage.

All additive (verified with cargo semver-checks: no new breaking changes
beyond the Phase 1 #130 streaming change).

Closes #94, #163

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dg-coreylweathers

Copy link
Copy Markdown
Contributor Author

Live-verified against the production API (Rust 1.97 container):

  • analyze_text/v1/read: sentiment/summary/topics/intents deserialized correctly.
  • models/v1/models: full STT/TTS list parsed, including TTS metadata.accent.
  • stream_futures → STT WebSocket: StreamExt::filter_map extracted final transcripts.

Also addressed the review NIT: Read's inner field is now private (matching Models/Scopes), dropping the misleading #[allow(unused)].

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.

1 participant