fix toolset codes to make it work with python 3.9

PiperOrigin-RevId: 757991503
This commit is contained in:
Xiang (Sean) Zhou 2025-05-12 18:22:37 -07:00 committed by Copybara-Service
parent 80813a75cf
commit 2d84b13219
4 changed files with 6 additions and 5 deletions

View File

@ -15,9 +15,9 @@
from typing import List
from typing import Optional
from typing import override
from typing import Union
from typing_extensions import override
import yaml
from ...agents.readonly_context import ReadonlyContext

View File

@ -14,10 +14,10 @@
from typing import List
from typing import Optional
from typing import override
from typing import Union
from fastapi.openapi.models import HTTPBearer
from typing_extensions import override
from ...auth.auth_credential import AuthCredential
from ...auth.auth_credential import AuthCredentialTypes

View File

@ -19,10 +19,11 @@ import os
from typing import Any
from typing import List
from typing import Optional
from typing import override
from typing import Type
from typing import Union
from typing_extensions import override
from ...agents.readonly_context import ReadonlyContext
from ...auth import OpenIdConnectWithConfig
from ...tools.base_toolset import BaseToolset

View File

@ -20,9 +20,9 @@ from typing import Final
from typing import List
from typing import Literal
from typing import Optional
from typing import override
from typing import Union
from typing_extensions import override
import yaml
from ....agents.readonly_context import ReadonlyContext
@ -101,7 +101,7 @@ class OpenAPIToolset(BaseToolset):
AuthCredential or use helpers in
`google.adk.tools.openapi_tool.auth.auth_helpers`
tool_filter: The filter used to filter the tools in the toolset. It can be
either a tool predicate or a list of tool names of the tools to expose
either a tool predicate or a list of tool names of the tools to expose.
"""
if not spec_dict:
spec_dict = self._load_spec(spec_str, spec_str_type)