From 1664b455627c01194a804b880d31bd2602e1a447 Mon Sep 17 00:00:00 2001 From: Nilanjan De Date: Sun, 20 Apr 2025 22:52:42 -0700 Subject: [PATCH] Copybara import of the project: -- 16994cb2d5d646341f5285ca71d72697d81d18fe by Nilanjan De : chore: fix typos COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/272 from n1lanjan:fix-typos a1ab655b08ec08c5dd2da71aab9a2386e3610e84 PiperOrigin-RevId: 749690489 --- CHANGELOG.md | 4 ++-- pylintrc | 2 +- src/google/adk/cli/cli_eval.py | 2 +- src/google/adk/evaluation/agent_evaluator.py | 4 ++-- src/google/adk/evaluation/response_evaluator.py | 4 ++-- src/google/adk/evaluation/trajectory_evaluator.py | 9 ++++----- src/google/adk/flows/llm_flows/agent_transfer.py | 2 +- src/google/adk/flows/llm_flows/base_llm_flow.py | 2 +- src/google/adk/flows/llm_flows/contents.py | 2 +- src/google/adk/flows/llm_flows/instructions.py | 4 ++-- src/google/adk/models/gemini_llm_connection.py | 4 ++-- src/google/adk/sessions/database_session_service.py | 2 +- src/google/adk/sessions/state.py | 2 +- src/google/adk/tools/load_artifacts_tool.py | 2 +- .../auth/credential_exchangers/oauth2_exchanger.py | 2 +- 15 files changed, 23 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab4ee3f..37fb24b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,12 +45,12 @@ * Initial release of the Agent Development Kit (ADK). * Multi-agent, agent-as-workflow, and custom agent support * Tool authentication support -* Rich tool support, e.g. bult-in tools, google-cloud tools, third-party tools, and MCP tools +* Rich tool support, e.g. built-in tools, google-cloud tools, third-party tools, and MCP tools * Rich callback support * Built-in code execution capability * Asynchronous runtime and execution * Session, and memory support * Built-in evaluation support -* Development UI that makes local devlopment easy +* Development UI that makes local development easy * Deploy to Google Cloud Run, Agent Engine * (Experimental) Live(Bidi) auido/video agent support and Compositional Function Calling(CFC) support diff --git a/pylintrc b/pylintrc index d35fac3..3fc2263 100644 --- a/pylintrc +++ b/pylintrc @@ -45,7 +45,7 @@ confidence= # can either give multiple identifiers separated by comma (,) or put this # option multiple times (only on the command line, not in the configuration # file where it should appear only once).You can also use "--disable=all" to -# disable everything first and then reenable specific checks. For example, if +# disable everything first and then re-enable specific checks. For example, if # you want to run only the similarities checker, you can use "--disable=all # --enable=similarities". If you want to run only the classes checker, but have # no Warning level messages displayed, use"--disable=all --enable=classes diff --git a/src/google/adk/cli/cli_eval.py b/src/google/adk/cli/cli_eval.py index 6039acb..fc9d5af 100644 --- a/src/google/adk/cli/cli_eval.py +++ b/src/google/adk/cli/cli_eval.py @@ -256,7 +256,7 @@ def run_evals( ) if final_eval_status == EvalStatus.PASSED: - result = "✅ Passsed" + result = "✅ Passed" else: result = "❌ Failed" diff --git a/src/google/adk/evaluation/agent_evaluator.py b/src/google/adk/evaluation/agent_evaluator.py index 71d9496..1de087f 100644 --- a/src/google/adk/evaluation/agent_evaluator.py +++ b/src/google/adk/evaluation/agent_evaluator.py @@ -55,7 +55,7 @@ def load_json(file_path: str) -> Union[Dict, List]: class AgentEvaluator: - """An evaluator for Agents, mainly intented for helping with test cases.""" + """An evaluator for Agents, mainly intended for helping with test cases.""" @staticmethod def find_config_for_test_file(test_file: str): @@ -91,7 +91,7 @@ class AgentEvaluator: look for 'root_agent' in the loaded module. eval_dataset: The eval data set. This can be either a string representing full path to the file containing eval dataset, or a directory that is - recusively explored for all files that have a `.test.json` suffix. + recursively explored for all files that have a `.test.json` suffix. num_runs: Number of times all entries in the eval dataset should be assessed. agent_name: The name of the agent. diff --git a/src/google/adk/evaluation/response_evaluator.py b/src/google/adk/evaluation/response_evaluator.py index 0412232..99475e8 100644 --- a/src/google/adk/evaluation/response_evaluator.py +++ b/src/google/adk/evaluation/response_evaluator.py @@ -35,7 +35,7 @@ class ResponseEvaluator: Args: raw_eval_dataset: The dataset that will be evaluated. evaluation_criteria: The evaluation criteria to be used. This method - support two criterias, `response_evaluation_score` and + support two criteria, `response_evaluation_score` and `response_match_score`. print_detailed_results: Prints detailed results on the console. This is usually helpful during debugging. @@ -56,7 +56,7 @@ class ResponseEvaluator: Value range: [0, 5], where 0 means that the agent's response is not coherent, while 5 means it is . High values are good. A note on raw_eval_dataset: - The dataset should be a list session, where each sesssion is represented + The dataset should be a list session, where each session is represented as a list of interaction that need evaluation. Each evaluation is represented as a dictionary that is expected to have values for the following keys: diff --git a/src/google/adk/evaluation/trajectory_evaluator.py b/src/google/adk/evaluation/trajectory_evaluator.py index 8578ed9..29b4069 100644 --- a/src/google/adk/evaluation/trajectory_evaluator.py +++ b/src/google/adk/evaluation/trajectory_evaluator.py @@ -31,10 +31,9 @@ class TrajectoryEvaluator: ): r"""Returns the mean tool use accuracy of the eval dataset. - Tool use accuracy is calculated by comparing the expected and actuall tool - use trajectories. An exact match scores a 1, 0 otherwise. The final number - is an - average of these individual scores. + Tool use accuracy is calculated by comparing the expected and the actual + tool use trajectories. An exact match scores a 1, 0 otherwise. The final + number is an average of these individual scores. Value range: [0, 1], where 0 is means none of the too use entries aligned, and 1 would mean all of them aligned. Higher value is good. @@ -45,7 +44,7 @@ class TrajectoryEvaluator: usually helpful during debugging. A note on eval_dataset: - The dataset should be a list session, where each sesssion is represented + The dataset should be a list session, where each session is represented as a list of interaction that need evaluation. Each evaluation is represented as a dictionary that is expected to have values for the following keys: diff --git a/src/google/adk/flows/llm_flows/agent_transfer.py b/src/google/adk/flows/llm_flows/agent_transfer.py index 7fba6d5..e795c78 100644 --- a/src/google/adk/flows/llm_flows/agent_transfer.py +++ b/src/google/adk/flows/llm_flows/agent_transfer.py @@ -94,7 +94,7 @@ can answer it. If another agent is better for answering the question according to its description, call `{_TRANSFER_TO_AGENT_FUNCTION_NAME}` function to transfer the -question to that agent. When transfering, do not generate any text other than +question to that agent. When transferring, do not generate any text other than the function call. """ 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 48be153..188f3a5 100644 --- a/src/google/adk/flows/llm_flows/base_llm_flow.py +++ b/src/google/adk/flows/llm_flows/base_llm_flow.py @@ -115,7 +115,7 @@ class BaseLlmFlow(ABC): yield event # send back the function response if event.get_function_responses(): - logger.debug('Sending back last function resonse event: %s', event) + logger.debug('Sending back last function response event: %s', event) invocation_context.live_request_queue.send_content(event.content) if ( event.content diff --git a/src/google/adk/flows/llm_flows/contents.py b/src/google/adk/flows/llm_flows/contents.py index f284755..0a7e442 100644 --- a/src/google/adk/flows/llm_flows/contents.py +++ b/src/google/adk/flows/llm_flows/contents.py @@ -111,7 +111,7 @@ def _rearrange_events_for_latest_function_response( """Rearrange the events for the latest function_response. If the latest function_response is for an async function_call, all events - bewteen the initial function_call and the latest function_response will be + between the initial function_call and the latest function_response will be removed. Args: diff --git a/src/google/adk/flows/llm_flows/instructions.py b/src/google/adk/flows/llm_flows/instructions.py index 02af9dc..860240d 100644 --- a/src/google/adk/flows/llm_flows/instructions.py +++ b/src/google/adk/flows/llm_flows/instructions.py @@ -52,7 +52,7 @@ class _InstructionsLlmRequestProcessor(BaseLlmRequestProcessor): # Appends global instructions if set. if ( isinstance(root_agent, LlmAgent) and root_agent.global_instruction - ): # not emtpy str + ): # not empty str raw_si = root_agent.canonical_global_instruction( ReadonlyContext(invocation_context) ) @@ -60,7 +60,7 @@ class _InstructionsLlmRequestProcessor(BaseLlmRequestProcessor): llm_request.append_instructions([si]) # Appends agent instructions if set. - if agent.instruction: # not emtpy str + if agent.instruction: # not empty str raw_si = agent.canonical_instruction(ReadonlyContext(invocation_context)) si = _populate_values(raw_si, invocation_context) llm_request.append_instructions([si]) diff --git a/src/google/adk/models/gemini_llm_connection.py b/src/google/adk/models/gemini_llm_connection.py index bbf35e2..30f1fb2 100644 --- a/src/google/adk/models/gemini_llm_connection.py +++ b/src/google/adk/models/gemini_llm_connection.py @@ -152,7 +152,7 @@ class GeminiLlmConnection(BaseLlmConnection): ): # TODO: Right now, we just support output_transcription without # changing interface and data protocol. Later, we can consider to - # support output_transcription as a separete field in LlmResponse. + # support output_transcription as a separate field in LlmResponse. # Transcription is always considered as partial event # We rely on other control signals to determine when to yield the @@ -179,7 +179,7 @@ class GeminiLlmConnection(BaseLlmConnection): # in case of empty content or parts, we sill surface it # in case it's an interrupted message, we merge the previous partial # text. Other we don't merge. because content can be none when model - # safty threshold is triggered + # safety threshold is triggered if message.server_content.interrupted and text: yield self.__build_full_text_response(text) text = '' diff --git a/src/google/adk/sessions/database_session_service.py b/src/google/adk/sessions/database_session_service.py index 19aa75a..93e66f7 100644 --- a/src/google/adk/sessions/database_session_service.py +++ b/src/google/adk/sessions/database_session_service.py @@ -217,7 +217,7 @@ class DatabaseSessionService(BaseSessionService): """ # 1. Create DB engine for db connection # 2. Create all tables based on schema - # 3. Initialize all properies + # 3. Initialize all properties try: db_engine = create_engine(db_url) diff --git a/src/google/adk/sessions/state.py b/src/google/adk/sessions/state.py index b9c4f4b..1cb3c58 100644 --- a/src/google/adk/sessions/state.py +++ b/src/google/adk/sessions/state.py @@ -26,7 +26,7 @@ class State: """ Args: value: The current value of the state dict. - delta: The delta change to the current value that hasn't been commited. + delta: The delta change to the current value that hasn't been committed. """ self._value = value self._delta = delta diff --git a/src/google/adk/tools/load_artifacts_tool.py b/src/google/adk/tools/load_artifacts_tool.py index 4972856..bee650f 100644 --- a/src/google/adk/tools/load_artifacts_tool.py +++ b/src/google/adk/tools/load_artifacts_tool.py @@ -89,7 +89,7 @@ class LoadArtifactsTool(BaseTool): than the function call. """]) - # Attache the content of the artifacts if the model requests them. + # Attach the content of the artifacts if the model requests them. # This only adds the content to the model request, instead of the session. if llm_request.contents and llm_request.contents[-1].parts: function_response = llm_request.contents[-1].parts[0].function_response diff --git a/src/google/adk/tools/openapi_tool/auth/credential_exchangers/oauth2_exchanger.py b/src/google/adk/tools/openapi_tool/auth/credential_exchangers/oauth2_exchanger.py index ee1935d..267d4a9 100644 --- a/src/google/adk/tools/openapi_tool/auth/credential_exchangers/oauth2_exchanger.py +++ b/src/google/adk/tools/openapi_tool/auth/credential_exchangers/oauth2_exchanger.py @@ -66,7 +66,7 @@ class OAuth2CredentialExchanger(BaseAuthCredentialExchanger): Returns: An AuthCredential object containing the HTTP bearer access token. If the - HTTO bearer token cannot be generated, return the origianl credential + HTTP bearer token cannot be generated, return the original credential. """ if "access_token" not in auth_credential.oauth2.token: