Skip to content

Add a Google Gemini drop-in SDK adapter (@lookspan/google) #39

Description

@JoniMartin27

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/.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions