We ship one-line drop-ins for OpenAI (@lookspan/openai) and Anthropic (@lookspan/anthropic) but not for Google Gemini — even though the pricing table already prices Gemini models. A @lookspan/google package would let Gemini users instrument with the same one-liner.
Task
Create packages/sdk-google exporting observeGoogle(client) that wraps the @google/generative-ai client and emits a span per generateContent call (model, provider=google, token usage, captured prompt/response gated by captureContent).
Where
- Use
packages/sdk-openai as the template (same exporter, ids, and captureContent handling).
- Map Gemini's
usageMetadata (promptTokenCount / candidatesTokenCount) to Lookspan TokenUsage.\n- Add a unit test mirroring the OpenAI SDK test.\n\n### Acceptance\n- observeGoogle(new GoogleGenerativeAI(...).getGenerativeModel(...)) traces a call end-to-end.\n- Cost is computed automatically (Gemini models are already in the pricing table).\n- npm run ci green; add a short section to the README + a docs page under docs-site/src/content/docs/sdks/.
We ship one-line drop-ins for OpenAI (
@lookspan/openai) and Anthropic (@lookspan/anthropic) but not for Google Gemini — even though the pricing table already prices Gemini models. A@lookspan/googlepackage would let Gemini users instrument with the same one-liner.Task
Create
packages/sdk-googleexportingobserveGoogle(client)that wraps the@google/generative-aiclient and emits a span pergenerateContentcall (model, provider=google, token usage, captured prompt/response gated bycaptureContent).Where
packages/sdk-openaias the template (same exporter, ids, andcaptureContenthandling).usageMetadata(promptTokenCount/candidatesTokenCount) to LookspanTokenUsage.\n- Add a unit test mirroring the OpenAI SDK test.\n\n### Acceptance\n-observeGoogle(new GoogleGenerativeAI(...).getGenerativeModel(...))traces a call end-to-end.\n- Cost is computed automatically (Gemini models are already in the pricing table).\n-npm run cigreen; add a short section to the README + a docs page underdocs-site/src/content/docs/sdks/.