mirror of
https://github.com/encounter/adk-python.git
synced 2026-07-09 18:19:28 -07:00
chore: Fix spelling
Merge https://github.com/google/adk-python/pull/2447 This PR corrects misspellings identified by the [check-spelling action](https://github.com/marketplace/actions/check-spelling) The misspellings have been reported at https://github.com/jsoref/adk-python/actions/runs/16840838898/attempts/1#summary-47711379253 The action reports that the changes in this PR would make it happy: https://github.com/jsoref/adk-python/actions/runs/16840839269/attempts/1#summary-47711380479 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. I've included a couple of changes to make CI happy. Personally, I object to CI being in a state of "random drive by person who adds a blank line in the middle of a file must fix all the preexisting bugs in the file", but that appears to be the state for this repository. COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/2447 from jsoref:spelling d85398e7fd154d124d477c6af6181481a01f34e0 PiperOrigin-RevId: 827629615
This commit is contained in:
committed by
Copybara-Service
parent
8dff85099d
commit
aa1233608a
@@ -101,7 +101,7 @@ class TestGcsEvalSetsManager:
|
||||
app_name = "test_app"
|
||||
eval_set_id = "invalid-id"
|
||||
|
||||
with pytest.raises(ValueError, match="Invalid Eval Set Id"):
|
||||
with pytest.raises(ValueError, match="Invalid Eval Set ID"):
|
||||
gcs_eval_sets_manager.create_eval_set(app_name, eval_set_id)
|
||||
|
||||
def test_gcs_eval_sets_manager_list_eval_sets_success(
|
||||
|
||||
@@ -527,7 +527,7 @@ def test_generate_final_eval_status_doesn_t_throw_on(eval_service):
|
||||
# eval case.
|
||||
|
||||
# We go over all the possible values of EvalStatus one by one and expect
|
||||
# the _generate_final_eval_status to handle it without throwing an exeception.
|
||||
# the _generate_final_eval_status to handle it without throwing an exception.
|
||||
for status in EvalStatus:
|
||||
eval_metric_result = EvalMetricResult(
|
||||
metric_name="metric1", threshold=0.5, eval_status=status
|
||||
|
||||
@@ -24,7 +24,7 @@ from google.adk.evaluation.eval_case import IntermediateData
|
||||
from google.adk.evaluation.eval_case import Invocation
|
||||
from google.adk.evaluation.eval_set import EvalSet
|
||||
from google.adk.evaluation.local_eval_sets_manager import _EVAL_SET_FILE_EXTENSION
|
||||
from google.adk.evaluation.local_eval_sets_manager import convert_eval_set_to_pydanctic_schema
|
||||
from google.adk.evaluation.local_eval_sets_manager import convert_eval_set_to_pydantic_schema
|
||||
from google.adk.evaluation.local_eval_sets_manager import load_eval_set_from_file
|
||||
from google.adk.evaluation.local_eval_sets_manager import LocalEvalSetsManager
|
||||
from google.genai import types as genai_types
|
||||
@@ -32,10 +32,10 @@ from pydantic import ValidationError
|
||||
import pytest
|
||||
|
||||
|
||||
class TestConvertEvalSetToPydancticSchema:
|
||||
"""Tests convert_eval_set_to_pydanctic_schema method."""
|
||||
class TestConvertEvalSetToPydanticSchema:
|
||||
"""Tests convert_eval_set_to_pydantic_schema method."""
|
||||
|
||||
def test_convert_eval_set_to_pydanctic_schema_complete(self):
|
||||
def test_convert_eval_set_to_pydantic_schema_complete(self):
|
||||
eval_set_id = "test_eval_set"
|
||||
eval_set_in_json_format = [{
|
||||
"name": "roll_17_sided_dice_twice",
|
||||
@@ -71,7 +71,7 @@ class TestConvertEvalSetToPydancticSchema:
|
||||
},
|
||||
}]
|
||||
|
||||
eval_set = convert_eval_set_to_pydanctic_schema(
|
||||
eval_set = convert_eval_set_to_pydantic_schema(
|
||||
eval_set_id, eval_set_in_json_format
|
||||
)
|
||||
|
||||
@@ -93,14 +93,14 @@ class TestConvertEvalSetToPydancticSchema:
|
||||
== 1
|
||||
)
|
||||
|
||||
def test_convert_eval_set_to_pydanctic_schema_minimal(self):
|
||||
def test_convert_eval_set_to_pydantic_schema_minimal(self):
|
||||
eval_set_id = "test_eval_set"
|
||||
eval_set_in_json_format = [{
|
||||
"name": "minimal_case",
|
||||
"data": [{"query": "Hello", "reference": "World"}],
|
||||
}]
|
||||
|
||||
eval_set = convert_eval_set_to_pydanctic_schema(
|
||||
eval_set = convert_eval_set_to_pydantic_schema(
|
||||
eval_set_id, eval_set_in_json_format
|
||||
)
|
||||
|
||||
@@ -117,7 +117,7 @@ class TestConvertEvalSetToPydancticSchema:
|
||||
== "World"
|
||||
)
|
||||
|
||||
def test_convert_eval_set_to_pydanctic_schema_empty_tool_use_and_intermediate_responses(
|
||||
def test_convert_eval_set_to_pydantic_schema_empty_tool_use_and_intermediate_responses(
|
||||
self,
|
||||
):
|
||||
eval_set_id = "test_eval_set"
|
||||
@@ -131,7 +131,7 @@ class TestConvertEvalSetToPydancticSchema:
|
||||
}],
|
||||
}]
|
||||
|
||||
eval_set = convert_eval_set_to_pydanctic_schema(
|
||||
eval_set = convert_eval_set_to_pydantic_schema(
|
||||
eval_set_id, eval_set_in_json_format
|
||||
)
|
||||
|
||||
@@ -150,7 +150,7 @@ class TestConvertEvalSetToPydancticSchema:
|
||||
== 0
|
||||
)
|
||||
|
||||
def test_convert_eval_set_to_pydanctic_schema_empty_initial_session(self):
|
||||
def test_convert_eval_set_to_pydantic_schema_empty_initial_session(self):
|
||||
eval_set_id = "test_eval_set"
|
||||
eval_set_in_json_format = [{
|
||||
"name": "empty_session",
|
||||
@@ -158,14 +158,14 @@ class TestConvertEvalSetToPydancticSchema:
|
||||
"initial_session": {},
|
||||
}]
|
||||
|
||||
eval_set = convert_eval_set_to_pydanctic_schema(
|
||||
eval_set = convert_eval_set_to_pydantic_schema(
|
||||
eval_set_id, eval_set_in_json_format
|
||||
)
|
||||
|
||||
assert eval_set.eval_set_id == eval_set_id
|
||||
assert eval_set.eval_cases[0].session_input is None
|
||||
|
||||
def test_convert_eval_set_to_pydanctic_schema_invalid_data(self):
|
||||
def test_convert_eval_set_to_pydantic_schema_invalid_data(self):
|
||||
# This test implicitly checks for potential validation errors during Pydantic
|
||||
# object creation
|
||||
eval_set_id = "test_eval_set"
|
||||
@@ -190,7 +190,7 @@ class TestConvertEvalSetToPydancticSchema:
|
||||
}]
|
||||
|
||||
with pytest.raises(ValidationError):
|
||||
convert_eval_set_to_pydanctic_schema(eval_set_id, eval_set_in_json_format)
|
||||
convert_eval_set_to_pydantic_schema(eval_set_id, eval_set_in_json_format)
|
||||
|
||||
|
||||
class TestLoadEvalSetFromFile:
|
||||
@@ -300,14 +300,14 @@ class TestLoadEvalSetFromFile:
|
||||
def test_load_eval_set_from_file_invalid_data(self, tmp_path, mocker):
|
||||
# Create a dummy file with invalid data that fails both Pydantic validation
|
||||
# and the old format conversion. We mock the
|
||||
# convert_eval_set_to_pydanctic_schema function to raise a ValueError
|
||||
# convert_eval_set_to_pydantic_schema function to raise a ValueError
|
||||
# so that we can assert that the exception is raised.
|
||||
file_path = tmp_path / "invalid_data.json"
|
||||
with open(file_path, "w", encoding="utf-8") as f:
|
||||
f.write('{"invalid": "data"}')
|
||||
|
||||
mocker.patch(
|
||||
"google.adk.evaluation.local_eval_sets_manager.convert_eval_set_to_pydanctic_schema",
|
||||
"google.adk.evaluation.local_eval_sets_manager.convert_eval_set_to_pydantic_schema",
|
||||
side_effect=ValueError(),
|
||||
)
|
||||
|
||||
@@ -392,7 +392,7 @@ class TestLocalEvalSetsManager:
|
||||
app_name = "test_app"
|
||||
eval_set_id = "invalid-id"
|
||||
|
||||
with pytest.raises(ValueError, match="Invalid Eval Set Id"):
|
||||
with pytest.raises(ValueError, match="Invalid Eval Set ID"):
|
||||
local_eval_sets_manager.create_eval_set(app_name, eval_set_id)
|
||||
|
||||
def test_local_eval_sets_manager_create_eval_set_already_exists(
|
||||
|
||||
Reference in New Issue
Block a user