Skip to content

Commit 1e752b1

Browse files
Jacksunweicopybara-github
authored andcommitted
chore: Fixes type hints in google_api_tool_set.py.
PiperOrigin-RevId: 749844560
1 parent 5ab43e8 commit 1e752b1

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,6 @@ adk eval \
112112
samples_for_testing/hello_world/hello_world_eval_set_001.evalset.json
113113
```
114114

115-
## 🤖 A2A and ADK integration
116-
117-
For remote agent-to-agent communication, ADK integrates with the [A2A protocol](https://github.com/google/A2A/). See this [example](https://github.com/google/A2A/tree/main/samples/python/agents/google_adk) for how they can work together.
118115

119116
## 🤝 Contributing
120117

src/google/adk/tools/google_api_tool/google_api_tool_set.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14+
15+
from __future__ import annotations
16+
1417
import inspect
1518
import os
1619
from typing import Any
17-
from typing import Dict
1820
from typing import Final
1921
from typing import List
2022
from typing import Optional
@@ -28,6 +30,7 @@
2830

2931

3032
class GoogleApiToolSet:
33+
"""Google API Tool Set."""
3134

3235
def __init__(self, tools: List[RestApiTool]):
3336
self.tools: Final[List[GoogleApiTool]] = [
@@ -45,10 +48,10 @@ def get_tool(self, tool_name: str) -> Optional[GoogleApiTool]:
4548

4649
@staticmethod
4750
def _load_tool_set_with_oidc_auth(
48-
spec_file: str = None,
49-
spec_dict: Dict[str, Any] = None,
50-
scopes: list[str] = None,
51-
) -> Optional[OpenAPIToolset]:
51+
spec_file: Optional[str] = None,
52+
spec_dict: Optional[dict[str, Any]] = None,
53+
scopes: Optional[list[str]] = None,
54+
) -> OpenAPIToolset:
5255
spec_str = None
5356
if spec_file:
5457
# Get the frame of the caller
@@ -90,18 +93,18 @@ def configure_auth(self, client_id: str, client_secret: str):
9093

9194
@classmethod
9295
def load_tool_set(
93-
cl: Type['GoogleApiToolSet'],
96+
cls: Type[GoogleApiToolSet],
9497
api_name: str,
9598
api_version: str,
96-
) -> 'GoogleApiToolSet':
99+
) -> GoogleApiToolSet:
97100
spec_dict = GoogleApiToOpenApiConverter(api_name, api_version).convert()
98101
scope = list(
99102
spec_dict['components']['securitySchemes']['oauth2']['flows'][
100103
'authorizationCode'
101104
]['scopes'].keys()
102105
)[0]
103-
return cl(
104-
cl._load_tool_set_with_oidc_auth(
106+
return cls(
107+
cls._load_tool_set_with_oidc_auth(
105108
spec_dict=spec_dict, scopes=[scope]
106109
).get_tools()
107110
)

0 commit comments

Comments
 (0)