8000 Fix typos in docstrings of evaluation_generator.py and event.py (#101… · gsarthakdev/adk-python@089c1e6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 089c1e6

Browse files
fangyh20hangfei
andauthored
Fix typos in docstrings of evaluation_generator.py and event.py (google#101) (google#121)
* Fix typos in docstrings of evaluation_generator.py and event.py (google#101) Corrected 'resposnes' to 'responses', 'uncertainity' to 'uncertainty', 'conversaction' to 'conversation', and 'exeuction' to 'execution' in relevant docstrings for clarity. * Fix typos in docstrings and comments across multiple files Corrected 'detla' to 'delta', 'buil-in' to 'built-in', 'walkaround' to 'workaround', and 'conversaction' to 'conversation' for clarity in relevant files. Updated comments for consistency. --------- Co-authored-by: Hangfei Lin <hangfei@google.com>
1 parent d810ff7 commit 089c1e6

File tree

9 files changed

+21
-21
lines changed

9 files changed

+21
-21
lines changed

src/google/adk/evaluation/evaluation_generator.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ def generate_responses(
4242
"""Returns evaluation responses for the given dataset and agent.
4343
4444
Args:
45-
eval_dataset: The dataset that needs to be scraped for resposnes.
45+
eval_dataset: The dataset that needs to be scraped for responses.
4646
agent_module_path: Path to the module that contains the root agent.
4747
repeat_num: Number of time the eval dataset should be repeated. This is
48-
usually done to remove uncertainity that a single run may bring.
48+
usually done to remove uncertainty that a single run may bring.
4949
agent_name: The name of the agent that should be evaluated. This is
5050
usually the sub-agent.
5151
initial_session: Initial session for the eval data.
@@ -253,8 +253,8 @@ def apply_before_tool_callback(
253253
all_mock_tools: set[str],
254254
):
255255
"""Recursively apply the before_tool_callback to the root agent and all its subagents."""
256-
# check if the agent has tools that defined by evalset
257-
# We use function name to check if tools match
256+
# Check if the agent has tools that are defined by evalset.
257+
# We use function names to check if tools match
258258
if not isinstance(agent, Agent) and not isinstance(agent, LlmAgent):
259259
return
260260

src/google/adk/events/event.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class Event(LlmResponse):
7070
agent_2, and agent_2 is the parent of agent_3.
7171
7272
Branch is used when multiple sub-agent shouldn't see their peer agents'
73-
conversaction history.
73+
conversation history.
7474
"""
7575

7676
# The following are computed fields.
@@ -94,7 +94,7 @@ def is_final_response(self) -> bool:
9494
not self.get_function_calls()
9595
and not self.get_function_responses()
9696
and not self.partial
97-
and not self.has_trailing_code_exeuction_result()
97+
and not self.has_trailing_code_execution_result()
9898
)
9999

100100
def get_function_calls(self) -> list[types.FunctionCall]:
@@ -115,7 +115,7 @@ def get_function_responses(self) -> list[types.FunctionResponse]:
115115
func_response.append(part.function_response)
116116
return func_response
117117

118-
def has_trailing_code_exeuction_result(
118+
def has_trailing_code_execution_result(
119119
self,
120120
) -> bool:
121121
"""Returns whether the event has a trailing code execution result."""

src/google/adk/planners/plan_re_act_planner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131

3232

3333
class PlanReActPlanner(BasePlanner):
34-
"""Plan-Re-Act planner that constraints the LLM response to generate a plan before any action/observation.
34+
"""Plan-Re-Act planner that constrains the LLM response to generate a plan before any action/observation.
3535
36-
Note: this planner does not require the model to support buil-in thinking
36+
Note: this planner does not require the model to support built-in thinking
3737
features or setting the thinking config.
3838
"""
3939

src/google/adk/runners.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def run(
108108
"""Runs the agent.
109109
110110
NOTE: This sync interface is only for local testing and convenience purpose.
111-
Consider to use `run_async` for production usage.
111+
Consider using `run_async` for production usage.
112112
113113
Args:
114114
user_id: The user ID of the session.

src/google/adk/sessions/state.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def __contains__(self, key: str) -> bool:
4949
return key in self._value or key in self._delta
5050

5151
def has_delta(self) -> bool:
52-
"""Whether the state has pending detla."""
52+
"""Whether the state has pending delta."""
5353
return bool(self._delta)
5454

5555
def get(self, key: str, default: Any = None) -> Any:

src/google/adk/tests/integration/utils/asserts.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,21 @@ def assert_agent_says(
3636

3737

3838
def assert_agent_says_in_order(
39-
expected_conversaction: list[Message], agent_runner: TestRunner
39+
expected_conversation: list[Message], agent_runner: TestRunner
4040
):
41-
expected_conversaction_idx = len(expected_conversaction) - 1
41+
expected_conversation_idx = len(expected_conversation) - 1
4242
for event in reversed(agent_runner.get_events()):
4343
if event.content.parts and event.content.parts[0].text:
4444
assert (
4545
event.author
46-
== expected_conversaction[expected_conversaction_idx]['agent_name']
46+
== expected_conversation[expected_conversation_idx]['agent_name']
4747
)
4848
assert (
4949
event.content.parts[0].text.strip()
50-
== expected_conversaction[expected_conversaction_idx]['expected_text']
50+
== expected_conversation[expected_conversation_idx]['expected_text']
5151
)
52-
expected_conversaction_idx -= 1
53-
if expected_conversaction_idx < 0:
52+
expected_conversation_idx -= 1
53+
if expected_conversation_idx < 0:
5454
return
5555

5656

src/google/adk/tests/integration/utils/test_runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828

2929
class TestRunner:
30-
"""Agents runner for testings."""
30+
"""Agents runner for testing."""
3131

3232
app_name = "test_app"
3333
user_id = "test_user"

src/google/adk/tools/function_parameter_parse_util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def _raise_for_any_of_if_mldev(schema: types.Schema):
5353

5454
def _update_for_default_if_mldev(schema: types.Schema):
5555
if schema.default is not None:
56-
# TODO(kech): Remove this walkaround once mldev supports default value.
56+
# TODO(kech): Remove this workaround once mldev supports default value.
5757
schema.default = None
5858
logger.warning(
5959
'Default value is not supported in function declaration schema for'

tests/unittests/tools/test_build_function_declaration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,11 +267,11 @@ def simple_function(input_str: List[CustomInput]) -> str:
267267
# TODO: comment out this test for now as crewai requires python 3.10 as minimum
268268
# def test_crewai_tool():
269269
# docs_tool = CrewaiTool(
270-
# name='direcotry_read_tool',
270+
# name='directory_read_tool',
271271
# description='use this to find files for you.',
272272
# tool=FileReadTool(),
273273
# )
274274
# function_decl = docs_tool.get_declaration()
275-
# assert function_decl.name == 'direcotry_read_tool'
275+
# assert function_decl.name == 'directory_read_tool'
276276
# assert function_decl.parameters.type == 'OBJECT'
277277
# assert function_decl.parameters.properties['file_path'].type == 'STRING'

0 commit comments

Comments
 (0)
0