8000 chore: auto format mcp tools · CentML/adk-python@b70e74c · GitHub
[go: up one dir, main page]

Skip to content

Commit b70e74c

Browse files
seanzhougooglecopybara-github
authored andcommitted
chore: auto format mcp tools
PiperOrigin-RevId: 764547299
1 parent 791ac9e commit b70e74c

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

src/google/adk/tools/mcp_tool/mcp_session_manager.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
from typing import Any
2323
from typing import Optional
2424
from typing import TextIO
25+
from typing import Union
2526

2627
import anyio
2728
from pydantic import BaseModel
@@ -65,6 +66,7 @@ class StreamableHTTPServerParams(BaseModel):
6566
See MCP SSE Client documentation for more details.
6667
https://github.com/modelcontextprotocol/python-sdk/blob/main/src/mcp/client/streamable_http.py
6768
"""
69+
6870
url: str
6971
headers: dict[str, Any] | None = None
7072
timeout: float = 5
@@ -139,7 +141,9 @@ class MCPSessionManager:
139141

140142
def __init__(
141143
self,
142-
connection_params: StdioServerParameters | SseServerParams | StreamableHTTPServerParams,
144+
connection_params: Union[
145+
StdioServerParameters, SseServerParams, StreamableHTTPServerParams
146+
],
143147
errlog: TextIO = sys.stderr,
144148
):
145149
"""Initializes the MCP session manager.
@@ -184,7 +188,9 @@ async def create_session(self) -> ClientSession:
184188
url=self._connection_params.url,
185189
headers=self._connection_params.headers,
186190
timeout=timedelta(seconds=self._connection_params.timeout),
187-
sse_read_timeout=timedelta(seconds=self._connection_params.sse_read_timeout),
191+
sse_read_timeout=timedelta(
192+
seconds=self._connection_params.sse_read_timeout
193+
),
188194
terminate_on_close=self._connection_params.terminate_on_close,
189195
)
190196
else:

src/google/adk/tools/mcp_tool/mcp_tool.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
from __future__ import annotations
1516

1617
import logging
1718
from typing import Optional

src/google/adk/tools/mcp_tool/mcp_toolset.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
from __future__ import annotations
16+
1517
import logging
1618
import sys
1719
from typing import List
@@ -83,7 +85,9 @@ class MCPToolset(BaseToolset):
8385
def __init__(
8486
self,
8587
*,
86-
connection_params: StdioServerParameters | SseServerParams | StreamableHTTPServerParams,
88+
connection_params: (
89+
StdioServerParameters | SseServerParams | StreamableHTTPServerParams
90+
),
8791
tool_filter: Optional[Union[ToolPredicate, List[str]]] = None,
8892
errlog: TextIO = sys.stderr,
8993
):

0 commit comments

Comments
 (0)
0