mirror of
https://github.com/EvolutionAPI/adk-python.git
synced 2026-02-03 21:36:24 -06:00
chore: Add agent engine telemetry
PiperOrigin-RevId: 765346182
This commit is contained in:
committed by
Copybara-Service
parent
45ef668435
commit
3930a4b989
@@ -18,6 +18,7 @@ from __future__ import annotations
|
||||
import contextlib
|
||||
from functools import cached_property
|
||||
import logging
|
||||
import os
|
||||
import sys
|
||||
from typing import AsyncGenerator
|
||||
from typing import cast
|
||||
@@ -40,6 +41,8 @@ logger = logging.getLogger('google_adk.' + __name__)
|
||||
|
||||
_NEW_LINE = '\n'
|
||||
_EXCLUDED_PART_FIELD = {'inline_data': {'data'}}
|
||||
_AGENT_ENGINE_TELEMETRY_TAG = 'remote_reasoning_engine'
|
||||
_AGENT_ENGINE_TELEMETRY_ENV_VARIABLE_NAME = 'GOOGLE_CLOUD_AGENT_ENGINE_ID'
|
||||
|
||||
|
||||
class Gemini(BaseLlm):
|
||||
@@ -181,6 +184,8 @@ class Gemini(BaseLlm):
|
||||
@cached_property
|
||||
def _tracking_headers(self) -> dict[str, str]:
|
||||
framework_label = f'google-adk/{version.__version__}'
|
||||
if os.environ.get(_AGENT_ENGINE_TELEMETRY_ENV_VARIABLE_NAME):
|
||||
framework_label = f'{framework_label}+{_AGENT_ENGINE_TELEMETRY_TAG}'
|
||||
language_label = 'gl-python/' + sys.version.split()[0]
|
||||
version_header_value = f'{framework_label} {language_label}'
|
||||
tracking_headers = {
|
||||
|
||||
Reference in New Issue
Block a user