chore: Fix spelling in src

Merge https://github.com/google/adk-python/pull/3382

This PR corrects misspellings identified by the [check-spelling action](https://github.com/marketplace/actions/check-spelling)

Note: while I use tooling to identify errors, the tooling doesn't _actually_ provide the corrections, I'm picking them on my own. I'm a human, and I may make mistakes.

### Testing Plan

The misspellings have been reported at https://github.com/jsoref/adk-python/actions/runs/19056081305/attempts/1#summary-54426435973

The action reports that the changes in this PR would make it happy: https://github.com/jsoref/adk-python/actions/runs/19056081446/attempts/1#summary-54426436321

**Unit Tests:**

- [ ] I have added or updated unit tests for my change.
- [ ] All unit tests pass locally.

_Please include a summary of passed `pytest` results._

**Manual End-to-End (E2E) Tests:**

_Please provide instructions on how to manually test your changes, including any
necessary setup or configuration. Please provide logs or screenshots to help
reviewers better understand the fix._

### Checklist

- [x] I have read the [CONTRIBUTING.md](https://github.com/google/adk-python/blob/main/CONTRIBUTING.md) document.
- [x] I have performed a self-review of my own code.
- [ ] I have commented my code, particularly in hard-to-understand areas.
- [ ] I have added tests that prove my fix is effective or that my feature works.
- [ ] New and existing unit tests pass locally with my changes.
- [ ] I have manually tested my changes end-to-end.
- [ ] Any dependent changes have been merged and published in downstream modules.

### Additional context

- follow-up to #2447

Co-authored-by: Hangfei Lin <hangfei@google.com>
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/3382 from jsoref:spelling 3df5932e97391c437e1638d7163e5e3d5c52d5c3
PiperOrigin-RevId: 828686941
This commit is contained in:
Josh Soref
2025-11-05 16:58:35 -08:00
committed by Copybara-Service
parent 48681cb31b
commit 1d80d32efc
38 changed files with 60 additions and 60 deletions
+1 -1
View File
@@ -171,7 +171,7 @@ class BaseAgent(BaseModel):
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
@@ -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": {
+1 -1
View File
@@ -442,7 +442,7 @@ class LlmAgent(BaseAgent):
) -> 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)
+2 -2
View File
@@ -437,7 +437,7 @@ class RemoteA2aAgent(BaseAgent):
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 @@ class RemoteA2aAgent(BaseAgent):
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"] = (
+1 -1
View File
@@ -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(
@@ -35,13 +35,13 @@ class BaseEventsSummarizer(abc.ABC):
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()
+3 -3
View File
@@ -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.)"
),
+2 -2
View File
@@ -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 _register_builtin_services(registry: ServiceRegistry) -> None:
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(
+1 -1
View File
@@ -123,7 +123,7 @@ class AgentEvaluator:
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
+2 -2
View File
@@ -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."
),
)
+1 -1
View File
@@ -71,6 +71,6 @@ class Evaluator(ABC):
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()
@@ -58,10 +58,10 @@ Your task is to segment the provided response sentence by sentence so that we co
**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 @@ class HallucinationsV1Evaluator(Evaluator):
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
+1 -1
View File
@@ -122,7 +122,7 @@ class LlmAsJudge(Evaluator):
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
@@ -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
@@ -122,7 +122,7 @@ class MajorityVotePerInvocationResultsAggregator(
"""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 @@ class MajorityVotePerInvocationResultsAggregator(
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 @@ class MeanInvocationResultsSummarizer(InvocationResultsSummarizer):
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.
@@ -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
@@ -74,7 +74,7 @@ class _VertexAiEvalFacade(Evaluator):
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
@@ -392,7 +392,7 @@ class BaseLlmFlow(ABC):
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 (
+3 -3
View File
@@ -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:
+1 -1
View File
@@ -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(

Some files were not shown because too many files have changed in this diff Show More