Current collected state Current
Observed since 20 Oct, 22:46 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
agento11y-gemini
Gemini helper wrappers for the Grafana Agent Observability Python SDK
agento11y-gemini provides strict Gemini Models wrappers and mappers for agento11y.
pip install agento11y agento11y-gemini google-genai
models.generate_content(...)models.generate_content_async(...)models.generate_content_stream(...)models.generate_content_stream_async(...)models.embed_content(...)models.embed_content_async(...)models.from_request_response(...)models.from_stream(...)models.embedding_from_response(...)from google.genai import types as genai_types
from agento11y import Client, ClientConfig
from agento11y_gemini import GeminiOptions, models
client = Client(ClientConfig())
model = "gemini-2.5-pro"
contents = [genai_types.Content(role="user", parts=[genai_types.Part(text="Hello")])]
config = genai_types.GenerateContentConfig(max_output_tokens=256)
response = models.generate_content(
client,
model,
contents,
config,
lambda req_model, req_contents, req_config: gemini_client.models.generate_content(
model=req_model,
contents=req_contents,
config=req_config,
),
GeminiOptions(conversation_id="conv-1", agent_name="assistant", agent_version="1.0.0"),
)
from agento11y_gemini import GeminiStreamSummary, models
summary = models.generate_content_stream(
client,
model,
contents,
config,
lambda req_model, req_contents, req_config: GeminiStreamSummary(
responses=list(gemini_client.models.generate_content_stream(
model=req_model,
contents=req_contents,
config=req_config,
))
),
)
generation = models.from_request_response(model, contents, config, response)
stream_generation = models.from_stream(model, contents, config, summary)
embedding_response = models.embed_content(
client,
"gemini-embedding-001",
contents,
None,
lambda req_model, req_contents, req_config: gemini_client.models.embed_content(
model=req_model,
contents=req_contents,
config=req_config,
),
)
options = GeminiOptions(raw_artifacts=True)
Raw artifacts are default OFF and should only be enabled for diagnostics.
Gemini-specific fields are mapped as follows:
usage.thoughts_token_count -> normalized usage.reasoning_tokensusage.tool_use_prompt_token_count -> metadata agento11y.gen_ai.usage.tool_use_prompt_tokensconfig.thinking_config.thinking_budget -> metadata agento11y.gen_ai.request.thinking.budget_tokensconfig.thinking_config.thinking_level -> metadata agento11y.gen_ai.request.thinking.levelDownload counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
agento11yEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.10",
"evaluation": "NOT_EVALUATED"
} | agento11y>=0.21.0 | runtime |
google-genaiEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.10",
"evaluation": "NOT_EVALUATED"
} | google-genai<2,>=1.63.0 | runtime |
pytestEnvironment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.10",
"evaluation": "NOT_EVALUATED"
} | pytest>=9.0.3; extra == "dev" | runtime |
bdist_wheel · 8.35 KB · Python py3
sdist · 10.97 KB · Python source
Observed since 20 Oct, 22:46 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:71dbaf4ee72eb7a7bccba16bee8d4ce6855633f3a87016b443cdf6ad554e86bc