Summary
Add fully typed, documented response models for Audio Intelligence features (topics, intents, sentiment, summaries) that provide IDE autocompletion and type safety when accessing intelligence results from transcription responses.
Problem it solves
When developers use Audio Intelligence features (topics, intents, sentiment) in the Python SDK, the response data is returned as loosely-typed dictionaries or generic objects. This means no IDE autocompletion, no type checking, and developers must constantly reference the API docs to know what fields are available. For example, accessing topic results requires knowing the exact nested structure (response.results.topics.segments[0].topics[0].topic) without any IDE guidance. Typed models would make Audio Intelligence features significantly easier to discover and use correctly.
Proposed API
from deepgram import DeepgramClient, PrerecordedOptions
client = DeepgramClient()
response = await client.listen.rest.v("1").transcribe_url(
{"url": audio_url},
PrerecordedOptions(topics=True, intents=True, sentiment=True)
)
# Fully typed access with IDE autocompletion
for segment in response.results.topics.segments:
for topic in segment.topics:
print(f"Topic: {topic.topic} (confidence: {topic.confidence_score})")
for segment in response.results.intents.segments:
for intent in segment.intents:
print(f"Intent: {intent.intent} (confidence: {intent.confidence_score})")
for segment in response.results.sentiments.segments:
print(f"Sentiment: {segment.sentiment} ({segment.sentiment_score})")
# Type hints work for all nested fields
topic: TopicResult # has .topic: str, .confidence_score: float
intent: IntentResult # has .intent: str, .confidence_score: float
sentiment: SentimentSegment # has .sentiment: str, .sentiment_score: float, .text: str
Acceptance criteria
Raised by the DX intelligence system.
Summary
Add fully typed, documented response models for Audio Intelligence features (topics, intents, sentiment, summaries) that provide IDE autocompletion and type safety when accessing intelligence results from transcription responses.
Problem it solves
When developers use Audio Intelligence features (topics, intents, sentiment) in the Python SDK, the response data is returned as loosely-typed dictionaries or generic objects. This means no IDE autocompletion, no type checking, and developers must constantly reference the API docs to know what fields are available. For example, accessing topic results requires knowing the exact nested structure (
response.results.topics.segments[0].topics[0].topic) without any IDE guidance. Typed models would make Audio Intelligence features significantly easier to discover and use correctly.Proposed API
Acceptance criteria
Raised by the DX intelligence system.