Skip to content

Native Wrapper for Google Gemini (@google/genai) in LangSmith JS SDK #1722

Description

@reedchan7

Feature request

Hi LangSmith Team,

I'm currently using the @google/genai client for interacting with Google's Gemini models and would like to integrate these calls with LangSmith for tracing.

I've noticed that the langsmith TypeScript SDK provides a convenient wrapOpenAI function for OpenAI clients, which makes integration straightforward by automatically handling much of the tracing setup. This is a fantastic feature!

However, I couldn't find a similar dedicated wrapper for the @google/genai client. While I understand the generic traceable function can be used to wrap any asynchronous function, a dedicated wrapper (e.g., wrapGemini or wrapGoogleGenAI) would offer a more streamlined and consistent developer experience, similar to what's available for OpenAI.

Motivation

With the increasing adoption and capabilities of Google's Gemini models, providing first-class, easy-to-use tracing support within LangSmith is crucial for developers who choose Gemini as their LLM provider. A dedicated wrapper would significantly lower the barrier to entry for integrating Gemini with LangSmith, encouraging broader adoption of LangSmith within the Gemini ecosystem and ensuring developers can easily monitor, debug, and evaluate their Gemini-powered applications. This parity with the OpenAI integration would make LangSmith a more versatile and appealing observability tool for a wider range of LLM users.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions