A TypeScript example that builds a content analysis pipeline using the Opper SDK v3. Given a URL or text, it runs parallel analyses (sentiment, entities, topics), computes embeddings, stores results in a knowledge base, and streams a comprehensive report.
- Web fetch —
opper.beta.web.fetch() - Parallel structured analysis — sentiment, entities, and topic extraction via
Promise.all() - Structured output — Zod v4 schemas as
output_schema - Embeddings — computing and comparing embeddings with cosine similarity
- Knowledge base — create, add documents, semantic query, delete
- Streaming — report generation with
for await...ofandopper.stream() - Text-to-speech —
opper.textToSpeech() - Tracing — nested spans with
opper.traced()async wrapper - Function management — listing functions and revisions
- Node.js 18+
- An Opper API key (set
OPPER_API_KEYenv var)
npm install
npx tsx main.ts "https://example.com/some-article"Or with plain text:
npx tsx main.ts "The quick brown fox jumps over the lazy dog"