Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/google/adk/evaluation/evaluation_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ def generate_responses(
"""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.
Expand Down Expand Up @@ -253,8 +253,8 @@ def apply_before_tool_callback(
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

Expand Down
6 changes: 3 additions & 3 deletions src/google/adk/events/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -94,7 +94,7 @@ def is_final_response(self) -> bool:
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]:
Expand All @@ -115,7 +115,7 @@ def get_function_responses(self) -> list[types.FunctionResponse]:
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."""
Expand Down
4 changes: 2 additions & 2 deletions src/google/adk/planners/plan_re_act_planner.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@


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.
"""

Expand Down
2 changes: 1 addition & 1 deletion src/google/adk/runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def run(
"""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.
Expand Down
2 changes: 1 addition & 1 deletion src/google/adk/sessions/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def __contains__(self, key: str) -> bool:
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:
Expand Down
12 changes: 6 additions & 6 deletions src/google/adk/tests/integration/utils/asserts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
2 changes: 1 addition & 1 deletion src/google/adk/tests/integration/utils/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@


class TestRunner:
"""Agents runner for testings."""
"""Agents runner for testing."""

app_name = "test_app"
user_id = "test_user"
Expand Down
2 changes: 1 addition & 1 deletion src/google/adk/tools/function_parameter_parse_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions tests/unittests/tools/test_build_function_declaration.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,11 +267,11 @@ def simple_function(input_str: List[CustomInput]) -> str:
# 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'