You've already forked adk-python
mirror of
https://github.com/encounter/adk-python.git
synced 2026-03-30 10:57:20 -07:00
chore: logger = logging.getLogger(__name__) --> logger = logging.getLogger('google_adk.' + __name__)
PiperOrigin-RevId: 759894901
This commit is contained in:
committed by
Copybara-Service
parent
482099c925
commit
0d7d7918b6
@@ -53,7 +53,7 @@ from .callback_context import CallbackContext
|
||||
from .invocation_context import InvocationContext
|
||||
from .readonly_context import ReadonlyContext
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
logger = logging.getLogger('google_adk.' + __name__)
|
||||
|
||||
_SingleBeforeModelCallback: TypeAlias = Callable[
|
||||
[CallbackContext, LlmRequest],
|
||||
|
||||
@@ -22,7 +22,7 @@ from pydantic import BaseModel
|
||||
from pydantic import ConfigDict
|
||||
from pydantic import field_validator
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
logger = logging.getLogger('google_adk.' + __name__)
|
||||
|
||||
|
||||
class StreamingMode(Enum):
|
||||
|
||||
@@ -23,7 +23,7 @@ from typing_extensions import override
|
||||
|
||||
from .base_artifact_service import BaseArtifactService
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
logger = logging.getLogger("google_adk." + __name__)
|
||||
|
||||
|
||||
class GcsArtifactService(BaseArtifactService):
|
||||
|
||||
@@ -24,7 +24,7 @@ from typing_extensions import override
|
||||
|
||||
from .base_artifact_service import BaseArtifactService
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
logger = logging.getLogger("google_adk." + __name__)
|
||||
|
||||
|
||||
class InMemoryArtifactService(BaseArtifactService, BaseModel):
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
logger = logging.getLogger('google_adk.' + __name__)
|
||||
|
||||
__all__ = []
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ from .local_eval_sets_manager import convert_eval_set_to_pydanctic_schema
|
||||
from .response_evaluator import ResponseEvaluator
|
||||
from .trajectory_evaluator import TrajectoryEvaluator
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
logger = logging.getLogger("google_adk." + __name__)
|
||||
|
||||
|
||||
# Constants for default runs and evaluation criteria
|
||||
|
||||
@@ -19,9 +19,11 @@ import re
|
||||
import time
|
||||
from typing import Any
|
||||
import uuid
|
||||
|
||||
from google.genai import types as genai_types
|
||||
from pydantic import ValidationError
|
||||
from typing_extensions import override
|
||||
|
||||
from .eval_case import EvalCase
|
||||
from .eval_case import IntermediateData
|
||||
from .eval_case import Invocation
|
||||
@@ -29,7 +31,7 @@ from .eval_case import SessionInput
|
||||
from .eval_set import EvalSet
|
||||
from .eval_sets_manager import EvalSetsManager
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
logger = logging.getLogger("google_adk." + __name__)
|
||||
|
||||
_EVAL_SET_FILE_EXTENSION = ".evalset.json"
|
||||
|
||||
|
||||
@@ -15,8 +15,9 @@
|
||||
"""Utility functions for converting examples to a string that can be used in system instructions in the prompt."""
|
||||
|
||||
import logging
|
||||
from typing import Optional, Union
|
||||
from typing import Optional
|
||||
from typing import TYPE_CHECKING
|
||||
from typing import Union
|
||||
|
||||
from .base_example_provider import BaseExampleProvider
|
||||
from .example import Example
|
||||
@@ -24,7 +25,7 @@ from .example import Example
|
||||
if TYPE_CHECKING:
|
||||
from ..sessions.session import Session
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
logger = logging.getLogger("google_adk." + __name__)
|
||||
|
||||
# Constant parts of the example string
|
||||
_EXAMPLES_INTRO = (
|
||||
|
||||
@@ -48,7 +48,7 @@ if TYPE_CHECKING:
|
||||
from ._base_llm_processor import BaseLlmRequestProcessor
|
||||
from ._base_llm_processor import BaseLlmResponseProcessor
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
logger = logging.getLogger('google_adk.' + __name__)
|
||||
|
||||
|
||||
class BaseLlmFlow(ABC):
|
||||
|
||||
@@ -41,7 +41,7 @@ from ...tools.tool_context import ToolContext
|
||||
AF_FUNCTION_CALL_ID_PREFIX = 'adk-'
|
||||
REQUEST_EUC_FUNCTION_CALL_NAME = 'adk_request_credential'
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
logger = logging.getLogger('google_adk.' + __name__)
|
||||
|
||||
|
||||
def generate_client_function_call_id() -> str:
|
||||
|
||||
@@ -25,7 +25,7 @@ from . import identity
|
||||
from . import instructions
|
||||
from .base_llm_flow import BaseLlmFlow
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
logger = logging.getLogger('google_adk.' + __name__)
|
||||
|
||||
|
||||
class SingleFlow(BaseLlmFlow):
|
||||
|
||||
@@ -16,7 +16,7 @@ import logging
|
||||
from .base_memory_service import BaseMemoryService
|
||||
from .in_memory_memory_service import InMemoryMemoryService
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
logger = logging.getLogger('google_adk.' + __name__)
|
||||
|
||||
__all__ = [
|
||||
'BaseMemoryService',
|
||||
|
||||
@@ -24,8 +24,9 @@ from typing import AsyncGenerator
|
||||
from typing import Generator
|
||||
from typing import Iterable
|
||||
from typing import Literal
|
||||
from typing import Optional, Union
|
||||
from typing import Optional
|
||||
from typing import TYPE_CHECKING
|
||||
from typing import Union
|
||||
|
||||
from anthropic import AnthropicVertex
|
||||
from anthropic import NOT_GIVEN
|
||||
@@ -42,7 +43,7 @@ if TYPE_CHECKING:
|
||||
|
||||
__all__ = ["Claude"]
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
logger = logging.getLogger("google_adk." + __name__)
|
||||
|
||||
MAX_TOKEN = 1024
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ from google.genai import types
|
||||
from .base_llm_connection import BaseLlmConnection
|
||||
from .llm_response import LlmResponse
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
logger = logging.getLogger('google_adk.' + __name__)
|
||||
|
||||
|
||||
class GeminiLlmConnection(BaseLlmConnection):
|
||||
@@ -149,16 +149,16 @@ class GeminiLlmConnection(BaseLlmConnection):
|
||||
message.server_content.input_transcription
|
||||
and message.server_content.input_transcription.text
|
||||
):
|
||||
user_text = message.server_content.input_transcription.text
|
||||
parts = [
|
||||
types.Part.from_text(
|
||||
text=user_text,
|
||||
)
|
||||
]
|
||||
llm_response = LlmResponse(
|
||||
content=types.Content(role='user', parts=parts)
|
||||
)
|
||||
yield llm_response
|
||||
user_text = message.server_content.input_transcription.text
|
||||
parts = [
|
||||
types.Part.from_text(
|
||||
text=user_text,
|
||||
)
|
||||
]
|
||||
llm_response = LlmResponse(
|
||||
content=types.Content(role='user', parts=parts)
|
||||
)
|
||||
yield llm_response
|
||||
if (
|
||||
message.server_content.output_transcription
|
||||
and message.server_content.output_transcription.text
|
||||
|
||||
@@ -51,7 +51,7 @@ from .base_llm import BaseLlm
|
||||
from .llm_request import LlmRequest
|
||||
from .llm_response import LlmResponse
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
logger = logging.getLogger("google_adk." + __name__)
|
||||
|
||||
_NEW_LINE = "\n"
|
||||
_EXCLUDED_PART_FIELD = {"inline_data": {"data"}}
|
||||
|
||||
@@ -24,7 +24,7 @@ from typing import TYPE_CHECKING
|
||||
if TYPE_CHECKING:
|
||||
from .base_llm import BaseLlm
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
logger = logging.getLogger('google_adk.' + __name__)
|
||||
|
||||
|
||||
_llm_registry_dict: dict[str, type[BaseLlm]] = {}
|
||||
|
||||
@@ -43,7 +43,7 @@ from .sessions.session import Session
|
||||
from .telemetry import tracer
|
||||
from .tools.built_in_code_execution_tool import built_in_code_execution
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
logger = logging.getLogger('google_adk.' + __name__)
|
||||
|
||||
|
||||
class Runner:
|
||||
|
||||
@@ -19,7 +19,7 @@ from .session import Session
|
||||
from .state import State
|
||||
from .vertex_ai_session_service import VertexAiSessionService
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
logger = logging.getLogger('google_adk.' + __name__)
|
||||
|
||||
|
||||
__all__ = [
|
||||
|
||||
@@ -12,10 +12,12 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
import copy
|
||||
from datetime import datetime, timezone
|
||||
from datetime import datetime
|
||||
from datetime import timezone
|
||||
import json
|
||||
import logging
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
from typing import Optional
|
||||
import uuid
|
||||
|
||||
from sqlalchemy import Boolean
|
||||
@@ -53,8 +55,7 @@ from .base_session_service import ListSessionsResponse
|
||||
from .session import Session
|
||||
from .state import State
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
logger = logging.getLogger("google_adk." + __name__)
|
||||
|
||||
DEFAULT_MAX_KEY_LENGTH = 128
|
||||
DEFAULT_MAX_VARCHAR_LENGTH = 256
|
||||
|
||||
@@ -28,7 +28,7 @@ from .base_session_service import ListSessionsResponse
|
||||
from .session import Session
|
||||
from .state import State
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
logger = logging.getLogger('google_adk.' + __name__)
|
||||
|
||||
|
||||
class InMemorySessionService(BaseSessionService):
|
||||
@@ -167,7 +167,7 @@ class InMemorySessionService(BaseSessionService):
|
||||
break
|
||||
i -= 1
|
||||
if i >= 0:
|
||||
copied_session.events = copied_session.events[i + 1:]
|
||||
copied_session.events = copied_session.events[i + 1 :]
|
||||
|
||||
return self._merge_state(app_name, user_id, copied_session)
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user