You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Phase 4 of the spec-coverage rollout — analyze plain text or a
remote URL via POST /v1/read for sentiment, summary, topics, and
intents.
Public surface:
```
let response = dg.read()
.analyze(
&ReadRequest::text("Hello, world."),
&Options::builder()
.language("en")
.summarize(true)
.sentiment(true)
.build(),
)
.await?;
if let Some(text) = response.summary_text() {
println!("Summary: {text}");
}
```
Notable wire-shape quirks (matching the spec, the Python SDK, and the
JS SDK — all auto-generated from the same OpenAPI definition):
- metadata is double-wrapped: `metadata.metadata.{request_id, ...}`.
Use ReadResponse::metadata_inner() to skip the wrapper.
- summary text is four levels deep: `results.summary.results.
summary.text`. Use ReadResponse::summary_text() to climb it.
Topics / Intents / Sentiments reuse the existing types from
common::batch_response since the spec's schemas.shared.yml
definitions are shared between Listen and Read. The `common` mod
gate is widened from cfg(feature = "listen") to
cfg(any(feature = "listen", feature = "read")).
The new `read` Cargo feature is REST-only (no tungstenite deps).
auth/base_url/client cfg_attrs updated to allow read, with a
comment explaining why auth specifically is left listen+agent+speak
only (auth is baked into reqwest default headers at construction
and never re-read by REST code paths).
Three examples under examples/read/: sentiment_url, summarize_text,
intents_topics.
12 new tests pass; 140 total. All feature combinations build clean.
0 commit comments