Skip to content

Support labels for ChatGoogleGenerativeAI #9795

@hntrl

Description

@hntrl

Privileged issue

  • I am a LangChain maintainer, or was asked directly by a LangChain maintainer to create an issue here.

Issue Content

ChatGoogleGenerativeAI should support labels parameter for cost tracking and traceability

Example Code

import { ChatGoogleGenerativeAI } from "@langchain/google-genai";

const model = new ChatGoogleGenerativeAI({
  model: "gemini-2.0-flash",
  labels: { env: "development" },
});

Expected Behavior

The labels parameter should be accepted and passed through to sdk to tag LLM calls with metadata for cost aggregation and traceability purposes.

ChatVertexAI in @langchain/google-vertexai already supports a labels parameter for this purpose (added for cost aggregation and billing traceability).

For parity and to support users who need to track costs across different environments or applications, ChatGoogleGenerativeAI should also accept and forward the labels parameter to the underlying SDK.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions