Skip to content

Add a runnable Vercel AI SDK example to examples/ #38

Description

@JoniMartin27

examples/ has 01-http-curl.sh, 02-otel.mjs and 03-mcp.mjs, but nothing for the Vercel AI SDK (ai package), which is one of the most common ways people build TS/JS agents.

Task

Add examples/04-vercel-ai-sdk.mjs that:

  1. Makes a generateText / streamText call with the Vercel AI SDK.
  2. Emits a Lookspan span for it — either via the OpenAI drop-in (@lookspan/openai) under the hood, or by POSTing a span to http://127.0.0.1:3100/api/ingest (see the curl example for the payload shape).
  3. Prints the trace URL so the user can open it.

Where

  • New file under examples/, mirroring the style of examples/02-otel.mjs.
  • Add a line to examples/README.md.

Acceptance

  • node examples/04-vercel-ai-sdk.mjs produces a visible trace in a running npx lookspan dashboard.
  • No secrets committed; read the key from process.env.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationgood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions