diff --git a/src/google/adk/agents/base_agent.py b/src/google/adk/agents/base_agent.py index 09eef908e0..1d6fb66403 100644 --- a/src/google/adk/agents/base_agent.py +++ b/src/google/adk/agents/base_agent.py @@ -171,7 +171,7 @@ def _load_agent_state( state_type: The type of the agent state. Returns: - The current state if resuming, otherwise None. + The current state if resuming; otherwise, None. """ if not ctx.is_resumable: return None diff --git a/src/google/adk/agents/config_schemas/AgentConfig.json b/src/google/adk/agents/config_schemas/AgentConfig.json index 6fa079cea1..e2f353de0d 100644 --- a/src/google/adk/agents/config_schemas/AgentConfig.json +++ b/src/google/adk/agents/config_schemas/AgentConfig.json @@ -1214,7 +1214,7 @@ } ], "default": null, - "description": "The unique id of the function call. If populated, the client to execute the\n `function_call` and return the response with the matching `id`.", + "description": "The unique ID of the function call. If populated, the client to execute the\n `function_call` and return the response with the matching `id`.", "title": "Id" }, "args": { @@ -1426,7 +1426,7 @@ } ], "default": null, - "description": "Optional. The id of the function call this response is for. Populated by the client to match the corresponding function call `id`.", + "description": "Optional. The ID of the function call this response is for. Populated by the client to match the corresponding function call `id`.", "title": "Id" }, "name": { diff --git a/src/google/adk/agents/llm_agent.py b/src/google/adk/agents/llm_agent.py index 91a256d96b..2f8a969fad 100644 --- a/src/google/adk/agents/llm_agent.py +++ b/src/google/adk/agents/llm_agent.py @@ -442,7 +442,7 @@ async def _run_async_impl( ) -> AsyncGenerator[Event, None]: agent_state = self._load_agent_state(ctx, BaseAgentState) - # If there is an sub-agent to resume, run it and then end the current + # If there is a sub-agent to resume, run it and then end the current # agent. if agent_state is not None and ( agent_to_transfer := self._get_subagent_to_resume(ctx) diff --git a/src/google/adk/agents/remote_a2a_agent.py b/src/google/adk/agents/remote_a2a_agent.py index ec6d819f2a..839c37ea42 100644 --- a/src/google/adk/agents/remote_a2a_agent.py +++ b/src/google/adk/agents/remote_a2a_agent.py @@ -437,7 +437,7 @@ async def _handle_a2a_response( event = convert_a2a_task_to_event(task, self.name, ctx) else: # This is a streaming update without a message (e.g. status change) - # or an partial artifact update. We don't emit an event for these + # or a partial artifact update. We don't emit an event for these # for now. return None @@ -532,7 +532,7 @@ async def _run_async_impl( event.custom_metadata[A2A_METADATA_PREFIX + "request"] = ( a2a_request.model_dump(exclude_none=True, by_alias=True) ) - # If the response is a ClientEvent, record the task state, otherwise + # If the response is a ClientEvent, record the task state; otherwise, # record the message object. if isinstance(a2a_response, tuple): event.custom_metadata[A2A_METADATA_PREFIX + "response"] = ( diff --git a/src/google/adk/agents/run_config.py b/src/google/adk/agents/run_config.py index 315de43f00..c379b3d608 100644 --- a/src/google/adk/agents/run_config.py +++ b/src/google/adk/agents/run_config.py @@ -38,7 +38,7 @@ class StreamingMode(Enum): class RunConfig(BaseModel): """Configs for runtime behavior of agents. - The configs here will be overriden by agent-specific configurations. + The configs here will be overridden by agent-specific configurations. """ model_config = ConfigDict( diff --git a/src/google/adk/apps/base_events_summarizer.py b/src/google/adk/apps/base_events_summarizer.py index 5e72d7a18c..a8cbc50140 100644 --- a/src/google/adk/apps/base_events_summarizer.py +++ b/src/google/adk/apps/base_events_summarizer.py @@ -35,13 +35,13 @@ async def maybe_summarize_events( If compaction failed, return None. Otherwise, compact into a content and return it. - This method will summarize the events and return a new summray event + This method will summarize the events and return a new summary event indicating the range of events it summarized. Args: events: Events to compact. Returns: - The new compacted event, or None if no compaction happended. + The new compacted event, or None if no compaction happened. """ raise NotImplementedError() diff --git a/src/google/adk/cli/cli_tools_click.py b/src/google/adk/cli/cli_tools_click.py index 5a71384b17..dc53f0bbbf 100644 --- a/src/google/adk/cli/cli_tools_click.py +++ b/src/google/adk/cli/cli_tools_click.py @@ -501,7 +501,7 @@ def cli_eval( *Eval Set File Path* For each file, all evals will be run by default. - If you want to run only specific evals from a eval set, first create a comma + If you want to run only specific evals from an eval set, first create a comma separated list of eval names and then add that as a suffix to the eval set file name, demarcated by a `:`. @@ -521,7 +521,7 @@ def cli_eval( *Eval Set ID* For each eval set, all evals will be run by default. - If you want to run only specific evals from a eval set, first create a comma + If you want to run only specific evals from an eval set, first create a comma separated list of eval names and then add that as a suffix to the eval set file name, demarcated by a `:`. @@ -1598,7 +1598,7 @@ def cli_deploy_cloud_run( default="", help=( "Optional. The filepath to the `.agent_engine_config.json` file to use." - " The values in this file will be overriden by the values set by other" + " The values in this file will be overridden by the values set by other" " flags. (default: the `.agent_engine_config.json` file in the `agent`" " directory, if any.)" ), diff --git a/src/google/adk/cli/service_registry.py b/src/google/adk/cli/service_registry.py index bc95bad285..707715c1bd 100644 --- a/src/google/adk/cli/service_registry.py +++ b/src/google/adk/cli/service_registry.py @@ -51,7 +51,7 @@ def _parse_agent_engine_kwargs( """Helper to parse agent engine resource name.""" if not uri_part: raise ValueError( - "Agent engine resource name or resource id can not be empty." + "Agent engine resource name or resource id cannot be empty." ) if "/" in uri_part: parts = uri_part.split("/") @@ -192,7 +192,7 @@ def rag_memory_factory(uri: str, **kwargs): rag_corpus = urlparse(uri).netloc if not rag_corpus: - raise ValueError("Rag corpus can not be empty.") + raise ValueError("Rag corpus cannot be empty.") agents_dir = kwargs.get("agents_dir") project, location = _load_gcp_config(agents_dir, "RAG memory service") return VertexAiRagMemoryService( diff --git a/src/google/adk/evaluation/agent_evaluator.py b/src/google/adk/evaluation/agent_evaluator.py index 8c8359f2f2..cafa712f56 100644 --- a/src/google/adk/evaluation/agent_evaluator.py +++ b/src/google/adk/evaluation/agent_evaluator.py @@ -123,7 +123,7 @@ async def evaluate_eval_set( eval_set: The eval set. criteria: Evaluation criteria, a dictionary of metric names to their respective thresholds. This field is deprecated. - eval_config: The evauation config. + eval_config: The evaluation config. num_runs: Number of times all entries in the eval dataset should be assessed. agent_name: The name of the agent, if trying to evaluate something other diff --git a/src/google/adk/evaluation/eval_metrics.py b/src/google/adk/evaluation/eval_metrics.py index 321e2cc1d9..8a56a50bc4 100644 --- a/src/google/adk/evaluation/eval_metrics.py +++ b/src/google/adk/evaluation/eval_metrics.py @@ -90,7 +90,7 @@ class JudgeModelOptions(EvalBaseModel): class BaseCriterion(BaseModel): - """Base creterion to use for an Eval Metric.""" + """Base criterion to use for an Eval Metric.""" model_config = ConfigDict( alias_generator=alias_generators.to_camel, @@ -126,7 +126,7 @@ class RubricsBasedCriterion(BaseCriterion): "Rubrics to be used by Metric. Not all metrics rely on rubrics, but" " metrics like `rubric_based_final_response_quality_v1` do. Metrics" " that don't use Rubrics, will just ignore this field, if specified." - " Metrics that do use rubrics will raise an execption, if they are" + " Metrics that do use rubrics will raise an exception, if they are" " not specified." ), ) diff --git a/src/google/adk/evaluation/evaluator.py b/src/google/adk/evaluation/evaluator.py index 7a97855bec..c235bb1e71 100644 --- a/src/google/adk/evaluation/evaluator.py +++ b/src/google/adk/evaluation/evaluator.py @@ -71,6 +71,6 @@ def evaluate_invocations( expected_invocations: An optional list of invocations, if specified, usually act as a benchmark/golden response. If these are specified usually the expectation is that the length of this list and actual - invocaiton is the same. + invocation is the same. """ raise NotImplementedError() diff --git a/src/google/adk/evaluation/hallucinations_v1.py b/src/google/adk/evaluation/hallucinations_v1.py index 01fbc3a09c..e2797dfdd9 100644 --- a/src/google/adk/evaluation/hallucinations_v1.py +++ b/src/google/adk/evaluation/hallucinations_v1.py @@ -58,10 +58,10 @@ **Instructions:** 1. Overall, you should decompose the whole provided response into individual sentences. You should make sure the output covers ALL the sentences in the provided response block. -2. You should COPY each sentence as it is, WORD BY WORD. DO NOT modify the sentence or the surrounding punctuations. +2. You should COPY each sentence as it is, WORD BY WORD. DO NOT modify the sentence or the surrounding punctuation. 3. If there are bullet points in the response, you should segment each bullet point into DIFFERENT sentences. If one bullet point has sub bullet points, you should further decompose sub bullet points into DIFFERENT sentences. For example, if there are responses like "it has three criteria: * aaa. * bbb. * ccc", you should segment them into FOUR sentences: "it has three criteria", "aaa", "bbb", "ccc". Bullet points could start with numbers (1/2/3/etc) or symbols like "*", "-" etc. -4. When encoutering tables, you should include the whole table in ONE sentence output. +4. When encountering tables, you should include the whole table in ONE sentence output. 5. Each sentence should be meaningful to further analyze on. DO NOT ONLY put symbols themselves into a sentence. 6. You should ONLY output segmented sentences in the provided response. DO NOT make up any new sentences. @@ -716,7 +716,7 @@ async def evaluate_invocations( expected_invocations: Optional[list[Invocation]], ) -> EvaluationResult: # expected_invocations are not required by the metric and if they are not - # supplied, we provide an a list of None to rest of the code. + # supplied, we provide a list of None to rest of the code. expected_invocations = ( [None] * len(actual_invocations) if expected_invocations is None diff --git a/src/google/adk/evaluation/llm_as_judge.py b/src/google/adk/evaluation/llm_as_judge.py index a33e827778..652a12b5c1 100644 --- a/src/google/adk/evaluation/llm_as_judge.py +++ b/src/google/adk/evaluation/llm_as_judge.py @@ -122,7 +122,7 @@ async def evaluate_invocations( raise ValueError("expected_invocations is needed by this metric.") # If expected_invocation are not required by the metric and if they are not - # supplied, we provide an a list of None. + # supplied, we provide a list of None. expected_invocations = ( [None] * len(actual_invocations) if expected_invocations is None diff --git a/src/google/adk/evaluation/request_intercepter_plugin.py b/src/google/adk/evaluation/request_intercepter_plugin.py index 374a30f67a..85d7b11019 100644 --- a/src/google/adk/evaluation/request_intercepter_plugin.py +++ b/src/google/adk/evaluation/request_intercepter_plugin.py @@ -34,7 +34,7 @@ class _RequestIntercepterPlugin(BasePlugin): """A plugin that intercepts requests that are made to the model and couples them with the model response. NOTE: This implementation is intended for eval systems internal usage. Do not - take direct depdency on it. + take direct dependency on it. Context behind the creation of this intercepter: Some of the newer AutoRater backed metrics need access the pieces of diff --git a/src/google/adk/evaluation/rubric_based_evaluator.py b/src/google/adk/evaluation/rubric_based_evaluator.py index 0e90996057..1d361cb113 100644 --- a/src/google/adk/evaluation/rubric_based_evaluator.py +++ b/src/google/adk/evaluation/rubric_based_evaluator.py @@ -122,7 +122,7 @@ def aggregate( """Returns a combined result for the invocation using majority vote. This method takes all those samples for a single invocation and combines - them to genreate one single result for the invocation. + them to generate one single result for the invocation. This method specifically uses majority vote to aggregate scores for a rubric. Take following Invocation and Rubric for example: @@ -132,7 +132,7 @@ def aggregate( Weather Agent: No, it will be moderately warm as predicted temperature for Seattle, WA tomorrow is 88F. - Rubric: Agent's reponse was concise and to the point. + Rubric: Agent's response was concise and to the point. We will sample the AutoRater 5 times, and the AutoRater responds with (skipping the rationale field for now): @@ -223,7 +223,7 @@ def summarize( assessed for each invocation. But, we do want to summarize and make a statement on how the eval case as a whole performed on the metric. - This method helps us aggreate rubric scores across invocation. + This method helps us aggregate rubric scores across invocation. This method calculates the mean score of a rubric across several invocations. diff --git a/src/google/adk/evaluation/rubric_based_tool_use_quality_v1.py b/src/google/adk/evaluation/rubric_based_tool_use_quality_v1.py index fe1f1e6e6b..40d48a7cf6 100644 --- a/src/google/adk/evaluation/rubric_based_tool_use_quality_v1.py +++ b/src/google/adk/evaluation/rubric_based_tool_use_quality_v1.py @@ -135,9 +135,9 @@ class RubricBasedToolUseV1Evaluator(RubricBasedEvaluator): Example: Lets take an example of a Weather Agent that has access to two tools: 1: GeoCoding Tool: Coverts a city name, address or zip code into geographic - cordinates. + coordinates. 2: GetWeather Tool: Gets weather for the next 10 days for the given geographic - cordinates. + coordinates. For this agent, one can create following Rubrics that could focus on tool use diff --git a/src/google/adk/evaluation/vertex_ai_eval_facade.py b/src/google/adk/evaluation/vertex_ai_eval_facade.py index cd676aee44..f80b7abaa5 100644 --- a/src/google/adk/evaluation/vertex_ai_eval_facade.py +++ b/src/google/adk/evaluation/vertex_ai_eval_facade.py @@ -74,7 +74,7 @@ def evaluate_invocations( raise ValueError("expected_invocations is needed by this metric.") # If expected_invocation are not required by the metric and if they are not - # supplied, we provide an a list of None. + # supplied, we provide a list of None. expected_invocations = ( [None] * len(actual_invocations) if expected_invocations is None diff --git a/src/google/adk/flows/llm_flows/base_llm_flow.py b/src/google/adk/flows/llm_flows/base_llm_flow.py index de51df939d..433d7f524c 100644 --- a/src/google/adk/flows/llm_flows/base_llm_flow.py +++ b/src/google/adk/flows/llm_flows/base_llm_flow.py @@ -392,7 +392,7 @@ async def _run_one_step_async( and events and len(events) > 1 # TODO: here we are using the last 2 events to decide whether to pause - # the invocation. But this is just being optmisitic, we should find a + # the invocation. But this is just being optimistic, we should find a # way to pause when the long running tool call is followed by more than # one text responses. and ( diff --git a/src/google/adk/flows/llm_flows/contents.py b/src/google/adk/flows/llm_flows/contents.py index da4cee945f..9e0f7e1bda 100644 --- a/src/google/adk/flows/llm_flows/contents.py +++ b/src/google/adk/flows/llm_flows/contents.py @@ -213,7 +213,7 @@ def _rearrange_events_for_latest_function_response( def _contains_empty_content(event: Event) -> bool: """Check if an event should be skipped due to missing or empty content. - This can happen to the evnets that only changed session state. + This can happen to the events that only changed session state. When both content and transcriptions are empty, the event will be considered as empty. @@ -251,7 +251,7 @@ def _process_compaction_events(events: list[Event]) -> list[Event]: # compaction_1(event_1, event_2, timestamp=3), event_3(timestamp=4), # compaction_2(event_2, event_3, timestamp=5), event_4(timestamp=6)] # for each compaction event, it only covers the events at most between the - # current compaction and the previous compaction. So during copmaction, we + # current compaction and the previous compaction. So during compaction, we # don't have to go across compaction boundaries. # Compaction events are always strictly in order based on event timestamp. events_to_process = [] @@ -589,7 +589,7 @@ def _is_event_belongs_to_branch( ) -> bool: """Check if an event belongs to the current branch. - This is for event context segration between agents. E.g. agent A shouldn't + This is for event context segregation between agents. E.g. agent A shouldn't see output of agent B. """ if not invocation_branch or not event.branch: diff --git a/src/google/adk/flows/llm_flows/functions.py b/src/google/adk/flows/llm_flows/functions.py index c5d2eea96b..ffe1657be1 100644 --- a/src/google/adk/flows/llm_flows/functions.py +++ b/src/google/adk/flows/llm_flows/functions.py @@ -656,7 +656,7 @@ async def _process_function_live_helper( } elif hasattr(tool, 'func') and inspect.isasyncgenfunction(tool.func): # for streaming tool use case - # we require the function to be a async generator function + # we require the function to be an async generator function async def run_tool_and_update_queue(tool, function_args, tool_context): try: async with Aclosing( diff --git a/src/google/adk/flows/llm_flows/request_confirmation.py b/src/google/adk/flows/llm_flows/request_confirmation.py index 358cae80b3..3cb92bf22b 100644 --- a/src/google/adk/flows/llm_flows/request_confirmation.py +++ b/src/google/adk/flows/llm_flows/request_confirmation.py @@ -78,7 +78,7 @@ async def run_async( and len(function_response.response.values()) == 1 and 'response' in function_response.response.keys() ): - # ADK web client will send a request that is always encapted in a + # ADK web client will send a request that is always encapsulated in a # 'response' key. tool_confirmation = ToolConfirmation.model_validate( json.loads(function_response.response['response']) diff --git a/src/google/adk/models/lite_llm.py b/src/google/adk/models/lite_llm.py index 3874216d42..7ffcb31787 100644 --- a/src/google/adk/models/lite_llm.py +++ b/src/google/adk/models/lite_llm.py @@ -481,7 +481,7 @@ def _schema_to_dict(schema: types.Schema) -> dict: def _function_declaration_to_tool_param( function_declaration: types.FunctionDeclaration, ) -> dict: - """Converts a types.FunctionDeclaration to a openapi spec dictionary. + """Converts a types.FunctionDeclaration to an openapi spec dictionary. Args: function_declaration: The function declaration to convert. diff --git a/src/google/adk/models/llm_response.py b/src/google/adk/models/llm_response.py index dfe77fffdd..0e42c02d09 100644 --- a/src/google/adk/models/llm_response.py +++ b/src/google/adk/models/llm_response.py @@ -33,7 +33,7 @@ class LlmResponse(BaseModel): Attributes: content: The content of the response. grounding_metadata: The grounding metadata of the response. - partial: Indicates whether the text content is part of a unfinished text + partial: Indicates whether the text content is part of an unfinished text stream. Only used for streaming mode and when the content is plain text. turn_complete: Indicates whether the response from the model is complete. Only used for streaming mode. @@ -69,7 +69,7 @@ class LlmResponse(BaseModel): """The grounding metadata of the response.""" partial: Optional[bool] = None - """Indicates whether the text content is part of a unfinished text stream. + """Indicates whether the text content is part of an unfinished text stream. Only used for streaming mode and when the content is plain text. """ diff --git a/src/google/adk/plugins/save_files_as_artifacts_plugin.py b/src/google/adk/plugins/save_files_as_artifacts_plugin.py index c207c61087..a1ce1be2a2 100644 --- a/src/google/adk/plugins/save_files_as_artifacts_plugin.py +++ b/src/google/adk/plugins/save_files_as_artifacts_plugin.py @@ -75,7 +75,7 @@ async def on_user_message_callback( continue try: - # Use display_name if available, otherwise generate a filename + # Use display_name if available; otherwise, generate a filename file_name = part.inline_data.display_name if not file_name: file_name = f'artifact_{invocation_context.invocation_id}_{i}' diff --git a/src/google/adk/runners.py b/src/google/adk/runners.py index f016272b32..1146505502 100644 --- a/src/google/adk/runners.py +++ b/src/google/adk/runners.py @@ -1044,7 +1044,7 @@ async def _setup_context_for_new_invocation( """Sets up the context for a new invocation. Args: - session: The session to setup the invocation context for. + session: The session to set up the invocation context for. new_message: The new message to process and append to the session. run_config: The run config of the agent. state_delta: Optional state changes to apply to the session. @@ -1083,7 +1083,7 @@ async def _setup_context_for_resumed_invocation( """Sets up the context for a resumed invocation. Args: - session: The session to setup the invocation context for. + session: The session to set up the invocation context for. new_message: The new message to process and append to the session. invocation_id: The invocation id to resume. run_config: The run config of the agent. @@ -1099,7 +1099,7 @@ async def _setup_context_for_resumed_invocation( if not session.events: raise ValueError(f'Session {session.id} has no events to resume.') - # Step 1: Maybe retrive a previous user message for the invocation. + # Step 1: Maybe retrieve a previous user message for the invocation. user_message = new_message or self._find_user_message_for_invocation( session.events, invocation_id ) diff --git a/src/google/adk/sessions/database_session_service.py b/src/google/adk/sessions/database_session_service.py index 89502d53ff..5d987aab5a 100644 --- a/src/google/adk/sessions/database_session_service.py +++ b/src/google/adk/sessions/database_session_service.py @@ -247,7 +247,7 @@ class StorageEvent(Base): PreciseTimestamp, default=func.now() ) - # === Fileds from llm_response.py === + # === Fields from llm_response.py === content: Mapped[dict[str, Any]] = mapped_column(DynamicJSON, nullable=True) grounding_metadata: Mapped[dict[str, Any]] = mapped_column( DynamicJSON, nullable=True diff --git a/src/google/adk/telemetry/google_cloud.py b/src/google/adk/telemetry/google_cloud.py index fbad8cea3e..e815d71194 100644 --- a/src/google/adk/telemetry/google_cloud.py +++ b/src/google/adk/telemetry/google_cloud.py @@ -53,7 +53,7 @@ def get_gcp_exporters( Args: enable_tracing: whether to enable tracing to Cloud Trace. - enable_metrics: whether to enable raporting metrics to Cloud Monitoring. + enable_metrics: whether to enable reporting metrics to Cloud Monitoring. enable_logging: whether to enable sending logs to Cloud Logging. google_auth: optional custom credentials and project_id. google.auth.default() used when this is omitted. """ diff --git a/src/google/adk/telemetry/tracing.py b/src/google/adk/telemetry/tracing.py index bda9fd0be8..f03cdc8010 100644 --- a/src/google/adk/telemetry/tracing.py +++ b/src/google/adk/telemetry/tracing.py @@ -91,7 +91,7 @@ def trace_agent_invocation( Args: span: Span on which attributes are set. agent: Agent from which attributes are gathered. - ctx: InvocationContext from which attrbiutes are gathered. + ctx: InvocationContext from which attributes are gathered. Inference related fields are not set, due to their planned removal from invoke_agent span: https://github.com/open-telemetry/semantic-conventions/issues/2632 diff --git a/src/google/adk/tools/_google_credentials.py b/src/google/adk/tools/_google_credentials.py index c61f942f5c..59fa3185a9 100644 --- a/src/google/adk/tools/_google_credentials.py +++ b/src/google/adk/tools/_google_credentials.py @@ -153,7 +153,7 @@ async def get_valid_credentials( else None ) - # If credentails are empty use the default credential + # If credentials are empty use the default credential if not creds: creds = self.credentials_config.credentials diff --git a/src/google/adk/tools/bigquery/config.py b/src/google/adk/tools/bigquery/config.py index f8e3089d5b..d810100a4e 100644 --- a/src/google/adk/tools/bigquery/config.py +++ b/src/google/adk/tools/bigquery/config.py @@ -71,7 +71,7 @@ class BigQueryToolConfig(BaseModel): """Name of the application using the BigQuery tools. By default, no particular application name will be set in the BigQuery - interaction. But if the the tool user (agent builder) wants to differentiate + interaction. But if the tool user (agent builder) wants to differentiate their application/agent for tracking or support purpose, they can set this field. """ diff --git a/src/google/adk/tools/bigquery/metadata_tool.py b/src/google/adk/tools/bigquery/metadata_tool.py index 65c7efc200..fdc63dc91b 100644 --- a/src/google/adk/tools/bigquery/metadata_tool.py +++ b/src/google/adk/tools/bigquery/metadata_tool.py @@ -318,7 +318,7 @@ def get_job_info( dict: Dictionary representing the properties of the job. Examples: - >>> user may give job id in fomat of: project_id:region.job_id + >>> user may give job id in format of: project_id:region.job_id like bigquery-public-data:US.bquxjob_12345678_1234567890 >>> get_job_info("bigquery-public-data", "bquxjob_12345678_1234567890") { diff --git a/src/google/adk/tools/bigquery/query_tool.py b/src/google/adk/tools/bigquery/query_tool.py index 4a4913d3d7..95d855f3e4 100644 --- a/src/google/adk/tools/bigquery/query_tool.py +++ b/src/google/adk/tools/bigquery/query_tool.py @@ -841,14 +841,14 @@ def forecast( >>> forecast( ... project_id="my-gcp-project", - ... history_data="my-dataset.non-existent-table", + ... history_data="my-dataset.nonexistent-table", ... timestamp_col="sale_date", ... data_col="daily_sales" ... ) { "status": "ERROR", "error_details": "Not found: Table - my-gcp-project:my-dataset.non-existent-table was not found in + my-gcp-project:my-dataset.nonexistent-table was not found in location US" } """ @@ -1116,7 +1116,7 @@ def detect_anomalies( history_data (str): The table id of the BigQuery table containing the history time series data or a query statement that select the history data. - times_series_timestamp_col (str): The name of the colum containing the + times_series_timestamp_col (str): The name of the column containing the timestamp for each data point. times_series_data_col (str): The name of the column containing the numerical values to be forecasted and anomaly detected. @@ -1216,14 +1216,14 @@ def detect_anomalies( >>> detect_anomalies( ... project_id="my-gcp-project", - ... history_data="my-dataset.non-existent-table", + ... history_data="my-dataset.nonexistent-table", ... times_series_timestamp_col="sale_date", ... times_series_data_col="daily_sales" ... ) { "status": "ERROR", "error_details": "Not found: Table - my-gcp-project:my-dataset.non-existent-table was not found in + my-gcp-project:my-dataset.nonexistent-table was not found in location US" } """ diff --git a/src/google/adk/tools/function_tool.py b/src/google/adk/tools/function_tool.py index b8b87e4ff1..d957d1c16b 100644 --- a/src/google/adk/tools/function_tool.py +++ b/src/google/adk/tools/function_tool.py @@ -52,7 +52,7 @@ def __init__( Args: func: The function to wrap. - require_confirmation: Wether this tool requires confirmation. A boolean or + require_confirmation: Whether this tool requires confirmation. A boolean or a callable that takes the function's arguments and returns a boolean. If the callable returns True, the tool will require confirmation from the user. diff --git a/src/google/adk/tools/google_api_tool/google_api_toolset.py b/src/google/adk/tools/google_api_tool/google_api_toolset.py index 714e654229..d808fe87e9 100644 --- a/src/google/adk/tools/google_api_tool/google_api_toolset.py +++ b/src/google/adk/tools/google_api_tool/google_api_toolset.py @@ -34,8 +34,8 @@ class GoogleApiToolset(BaseToolset): """Google API Toolset contains tools for interacting with Google APIs. - Usually one toolsets will contains tools only related to one Google API, e.g. - Google Bigquery API toolset will contains tools only related to Google + Usually one toolsets will contain tools only related to one Google API, e.g. + Google Bigquery API toolset will contain tools only related to Google Bigquery API, like list dataset tool, list table tool etc. Args: diff --git a/src/google/adk/tools/google_maps_grounding_tool.py b/src/google/adk/tools/google_maps_grounding_tool.py index 30cf8f3a85..eb51026993 100644 --- a/src/google/adk/tools/google_maps_grounding_tool.py +++ b/src/google/adk/tools/google_maps_grounding_tool.py @@ -53,7 +53,7 @@ async def process_llm_request( llm_request.config.tools = llm_request.config.tools or [] if is_gemini_1_model(llm_request.model): raise ValueError( - 'Google Maps grounding tool can not be used with Gemini 1.x models.' + 'Google Maps grounding tool cannot be used with Gemini 1.x models.' ) elif is_gemini_model(llm_request.model): llm_request.config.tools.append( diff --git a/src/google/adk/tools/mcp_tool/mcp_tool.py b/src/google/adk/tools/mcp_tool/mcp_tool.py index efbffc7f25..8743f6baae 100644 --- a/src/google/adk/tools/mcp_tool/mcp_tool.py +++ b/src/google/adk/tools/mcp_tool/mcp_tool.py @@ -140,7 +140,7 @@ async def _invoke_callable( # Functions are callable objects, but not all callable objects are functions # checking coroutine function is not enough. We also need to check whether - # Callable's __call__ function is a coroutine funciton + # Callable's __call__ function is a coroutine function is_async = inspect.iscoroutinefunction(target) or ( hasattr(target, "__call__") and inspect.iscoroutinefunction(target.__call__) diff --git a/src/google/adk/tools/tool_confirmation.py b/src/google/adk/tools/tool_confirmation.py index df14ff5026..a561ac6a95 100644 --- a/src/google/adk/tools/tool_confirmation.py +++ b/src/google/adk/tools/tool_confirmation.py @@ -39,7 +39,7 @@ class ToolConfirmation(BaseModel): hint: str = "" """The hint text for why the input is needed.""" confirmed: bool = False - """Whether the tool excution is confirmed.""" + """Whether the tool execution is confirmed.""" payload: Optional[Any] = None """The custom data payload needed from the user to continue the flow. It should be JSON serializable.""" diff --git a/src/google/adk/utils/context_utils.py b/src/google/adk/utils/context_utils.py index 243d5edfb6..bd8dacb9d8 100644 --- a/src/google/adk/utils/context_utils.py +++ b/src/google/adk/utils/context_utils.py @@ -35,7 +35,7 @@ class Aclosing(AbstractAsyncContextManager): https://docs.python.org/3/library/contextlib.html#contextlib.aclosing which is available in Python 3.10+. - TODO: replace all occurences with contextlib.aclosing once Python 3.9 is no + TODO: replace all occurrences with contextlib.aclosing once Python 3.9 is no longer supported. """