diff --git a/src/google/adk/evaluation/evaluation_generator.py b/src/google/adk/evaluation/evaluation_generator.py index 3d93659..3a43098 100644 --- a/src/google/adk/evaluation/evaluation_generator.py +++ b/src/google/adk/evaluation/evaluation_generator.py @@ -42,10 +42,10 @@ class EvaluationGenerator: """Returns evaluation responses for the given dataset and agent. Args: - eval_dataset: The dataset that needs to be scraped for resposnes. + eval_dataset: The dataset that needs to be scraped for responses. agent_module_path: Path to the module that contains the root agent. repeat_num: Number of time the eval dataset should be repeated. This is - usually done to remove uncertainity that a single run may bring. + usually done to remove uncertainty that a single run may bring. agent_name: The name of the agent that should be evaluated. This is usually the sub-agent. initial_session: Initial session for the eval data. @@ -253,8 +253,8 @@ class EvaluationGenerator: all_mock_tools: set[str], ): """Recursively apply the before_tool_callback to the root agent and all its subagents.""" - # check if the agent has tools that defined by evalset - # We use function name to check if tools match + # Check if the agent has tools that are defined by evalset. + # We use function names to check if tools match if not isinstance(agent, Agent) and not isinstance(agent, LlmAgent): return diff --git a/src/google/adk/events/event.py b/src/google/adk/events/event.py index e6a8aba..c2ff07d 100644 --- a/src/google/adk/events/event.py +++ b/src/google/adk/events/event.py @@ -70,7 +70,7 @@ class Event(LlmResponse): agent_2, and agent_2 is the parent of agent_3. Branch is used when multiple sub-agent shouldn't see their peer agents' - conversaction history. + conversation history. """ # The following are computed fields. @@ -94,7 +94,7 @@ class Event(LlmResponse): not self.get_function_calls() and not self.get_function_responses() and not self.partial - and not self.has_trailing_code_exeuction_result() + and not self.has_trailing_code_execution_result() ) def get_function_calls(self) -> list[types.FunctionCall]: @@ -115,7 +115,7 @@ class Event(LlmResponse): func_response.append(part.function_response) return func_response - def has_trailing_code_exeuction_result( + def has_trailing_code_execution_result( self, ) -> bool: """Returns whether the event has a trailing code execution result.""" diff --git a/src/google/adk/planners/plan_re_act_planner.py b/src/google/adk/planners/plan_re_act_planner.py index 87da2a5..2e236a6 100644 --- a/src/google/adk/planners/plan_re_act_planner.py +++ b/src/google/adk/planners/plan_re_act_planner.py @@ -31,9 +31,9 @@ FINAL_ANSWER_TAG = '/*FINAL_ANSWER*/' class PlanReActPlanner(BasePlanner): - """Plan-Re-Act planner that constraints the LLM response to generate a plan before any action/observation. + """Plan-Re-Act planner that constrains the LLM response to generate a plan before any action/observation. - Note: this planner does not require the model to support buil-in thinking + Note: this planner does not require the model to support built-in thinking features or setting the thinking config. """ diff --git a/src/google/adk/runners.py b/src/google/adk/runners.py index 7204f92..9041957 100644 --- a/src/google/adk/runners.py +++ b/src/google/adk/runners.py @@ -108,7 +108,7 @@ class Runner: """Runs the agent. NOTE: This sync interface is only for local testing and convenience purpose. - Consider to use `run_async` for production usage. + Consider using `run_async` for production usage. Args: user_id: The user ID of the session. diff --git a/src/google/adk/sessions/state.py b/src/google/adk/sessions/state.py index a333a17..b9c4f4b 100644 --- a/src/google/adk/sessions/state.py +++ b/src/google/adk/sessions/state.py @@ -49,7 +49,7 @@ class State: return key in self._value or key in self._delta def has_delta(self) -> bool: - """Whether the state has pending detla.""" + """Whether the state has pending delta.""" return bool(self._delta) def get(self, key: str, default: Any = None) -> Any: diff --git a/src/google/adk/tests/integration/utils/asserts.py b/src/google/adk/tests/integration/utils/asserts.py index 98d25b8..c367016 100644 --- a/src/google/adk/tests/integration/utils/asserts.py +++ b/src/google/adk/tests/integration/utils/asserts.py @@ -36,21 +36,21 @@ def assert_agent_says( def assert_agent_says_in_order( - expected_conversaction: list[Message], agent_runner: TestRunner + expected_conversation: list[Message], agent_runner: TestRunner ): - expected_conversaction_idx = len(expected_conversaction) - 1 + expected_conversation_idx = len(expected_conversation) - 1 for event in reversed(agent_runner.get_events()): if event.content.parts and event.content.parts[0].text: assert ( event.author - == expected_conversaction[expected_conversaction_idx]['agent_name'] + == expected_conversation[expected_conversation_idx]['agent_name'] ) assert ( event.content.parts[0].text.strip() - == expected_conversaction[expected_conversaction_idx]['expected_text'] + == expected_conversation[expected_conversation_idx]['expected_text'] ) - expected_conversaction_idx -= 1 - if expected_conversaction_idx < 0: + expected_conversation_idx -= 1 + if expected_conversation_idx < 0: return diff --git a/src/google/adk/tests/integration/utils/test_runner.py b/src/google/adk/tests/integration/utils/test_runner.py index 13e7566..9ac7c32 100644 --- a/src/google/adk/tests/integration/utils/test_runner.py +++ b/src/google/adk/tests/integration/utils/test_runner.py @@ -27,7 +27,7 @@ from google.genai import types class TestRunner: - """Agents runner for testings.""" + """Agents runner for testing.""" app_name = "test_app" user_id = "test_user" diff --git a/src/google/adk/tools/function_parameter_parse_util.py b/src/google/adk/tools/function_parameter_parse_util.py index 4252c4f..21e192d 100644 --- a/src/google/adk/tools/function_parameter_parse_util.py +++ b/src/google/adk/tools/function_parameter_parse_util.py @@ -53,7 +53,7 @@ def _raise_for_any_of_if_mldev(schema: types.Schema): def _update_for_default_if_mldev(schema: types.Schema): if schema.default is not None: - # TODO(kech): Remove this walkaround once mldev supports default value. + # TODO(kech): Remove this workaround once mldev supports default value. schema.default = None logger.warning( 'Default value is not supported in function declaration schema for' diff --git a/tests/unittests/tools/test_build_function_declaration.py b/tests/unittests/tools/test_build_function_declaration.py index d71d6d2..508608c 100644 --- a/tests/unittests/tools/test_build_function_declaration.py +++ b/tests/unittests/tools/test_build_function_declaration.py @@ -267,11 +267,11 @@ def test_basemodel_list(): # TODO: comment out this test for now as crewai requires python 3.10 as minimum # def test_crewai_tool(): # docs_tool = CrewaiTool( -# name='direcotry_read_tool', +# name='directory_read_tool', # description='use this to find files for you.', # tool=FileReadTool(), # ) # function_decl = docs_tool.get_declaration() -# assert function_decl.name == 'direcotry_read_tool' +# assert function_decl.name == 'directory_read_tool' # assert function_decl.parameters.type == 'OBJECT' # assert function_decl.parameters.properties['file_path'].type == 'STRING'