Skip to content

trulens.providers.google.endpoint

trulens.providers.google.endpoint

Classes

GoogleCallback

Bases: EndpointCallback

Attributes
endpoint class-attribute instance-attribute
endpoint: Endpoint = Field(exclude=True)

The endpoint owning this callback.

cost class-attribute instance-attribute
cost: Cost = Field(default_factory=Cost)

Costs tracked by this callback.

Functions
handle_generation
handle_generation(response: Any)

Get the usage information from GoogleGenAI LLM function response's usage_metadata field.

__rich_repr__
__rich_repr__() -> Result

Requirement for pretty printing using the rich package.

handle
handle(response: Any) -> None

Called after each request.

handle_chunk
handle_chunk(response: Any) -> None

Called after receiving a chunk from a request.

handle_generation_chunk
handle_generation_chunk(response: Any) -> None

Called after receiving a chunk from a completion request.

handle_classification
handle_classification(response: Any) -> None

Called after each classification response.

handle_embedding
handle_embedding(response: Any) -> None

Called after each embedding response.