mirror of
https://github.com/encounter/adk-python.git
synced 2026-07-09 18:19:28 -07:00
fix: import deprecated from typing_extensions
Fixes https://github.com/google/adk-python/issues/1125 and add it to pyproject.toml. This was added to typing_extensions in 4.5.0. I followed versioning guidance from https://typing-extensions.readthedocs.io/en/latest/index.html#versioning-and-backwards-compatibility. PiperOrigin-RevId: 767317467
This commit is contained in:
committed by
Copybara-Service
parent
86e15cab89
commit
068df04bce
@@ -44,6 +44,7 @@ dependencies = [
|
||||
"PyYAML>=6.0.2", # For APIHubToolset.
|
||||
"sqlalchemy>=2.0", # SQL database ORM
|
||||
"tzlocal>=5.3", # Time zone utilities
|
||||
"typing-extensions>=4.5, <5",
|
||||
"uvicorn>=0.34.0", # ASGI server for FastAPI
|
||||
# go/keep-sorted end
|
||||
]
|
||||
|
||||
@@ -12,18 +12,20 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
from typing import Tuple
|
||||
|
||||
from deprecated import deprecated
|
||||
from google.genai import types as genai_types
|
||||
from typing_extensions import deprecated
|
||||
|
||||
from ...evaluation.eval_case import IntermediateData
|
||||
from ...evaluation.eval_case import Invocation
|
||||
from ...sessions.session import Session
|
||||
|
||||
|
||||
@deprecated(reason='Use convert_session_to_eval_invocations instead.')
|
||||
@deprecated('Use convert_session_to_eval_invocations instead.')
|
||||
def convert_session_to_eval_format(session: Session) -> list[dict[str, Any]]:
|
||||
"""Converts a session data into eval format.
|
||||
|
||||
|
||||
@@ -12,13 +12,15 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
from typing import Optional
|
||||
|
||||
from deprecated import deprecated
|
||||
from google.genai import types as genai_types
|
||||
import pandas as pd
|
||||
from tabulate import tabulate
|
||||
from typing_extensions import deprecated
|
||||
from typing_extensions import override
|
||||
from vertexai.preview.evaluation import EvalTask
|
||||
from vertexai.preview.evaluation import MetricPromptTemplateExamples
|
||||
@@ -124,10 +126,8 @@ class ResponseEvaluator(Evaluator):
|
||||
|
||||
@staticmethod
|
||||
@deprecated(
|
||||
reason=(
|
||||
"This method has been deprecated and will be removed soon. Please use"
|
||||
" evaluate_invocations instead."
|
||||
)
|
||||
"This method has been deprecated and will be removed soon. Please use"
|
||||
" evaluate_invocations instead."
|
||||
)
|
||||
def evaluate(
|
||||
raw_eval_dataset: list[list[dict[str, Any]]],
|
||||
|
||||
@@ -12,13 +12,15 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
from typing import cast
|
||||
|
||||
from deprecated import deprecated
|
||||
from google.genai import types as genai_types
|
||||
import pandas as pd
|
||||
from tabulate import tabulate
|
||||
from typing_extensions import deprecated
|
||||
from typing_extensions import override
|
||||
|
||||
from .eval_case import Invocation
|
||||
@@ -100,10 +102,8 @@ class TrajectoryEvaluator(Evaluator):
|
||||
|
||||
@staticmethod
|
||||
@deprecated(
|
||||
reason=(
|
||||
"This method has been deprecated and will be removed soon. Please use"
|
||||
" evaluate_invocations instead."
|
||||
)
|
||||
"This method has been deprecated and will be removed soon. Please use"
|
||||
" evaluate_invocations instead."
|
||||
)
|
||||
def evaluate(
|
||||
eval_dataset: list[list[dict[str, Any]]],
|
||||
@@ -218,7 +218,10 @@ class TrajectoryEvaluator(Evaluator):
|
||||
return new_row, failure
|
||||
|
||||
@staticmethod
|
||||
@deprecated()
|
||||
@deprecated(
|
||||
"are_tools_equal is deprecated and will be removed soon. Please use"
|
||||
" TrajectoryEvaluator._are_tool_calls_equal instead."
|
||||
)
|
||||
def are_tools_equal(list_a_original, list_b_original):
|
||||
# Remove other entries that we don't want to evaluate
|
||||
list_a = [
|
||||
|
||||
Reference in New Issue
Block a user