ruff check fix
This commit is contained in:
@@ -65,17 +65,19 @@ __all__ = [
|
||||
"AdapterLookupRef",
|
||||
"AuthRecord",
|
||||
"DiscoveredConnectionCapabilities",
|
||||
"LegacyAdapterRef",
|
||||
"LegacyConnectionConfigLike",
|
||||
"SourceAdapterRef",
|
||||
"FileSourceRegistryStore",
|
||||
"HttpSourceTransport",
|
||||
"LegacyAdapterRef",
|
||||
"LegacyConnectionConfigLike",
|
||||
"McpSourceConnection",
|
||||
"McpSourceRegistryEntry",
|
||||
"SourceAdapterRef",
|
||||
"SourceRegistryFile",
|
||||
"SourceRegistryStore",
|
||||
"SourceTransport",
|
||||
"StdioSourceTransport",
|
||||
"ToolWrapperEvent",
|
||||
"ToolWrapperEventSink",
|
||||
"auth_missing_diagnostic",
|
||||
"auth_ref_for_connection",
|
||||
"connection_auth_diagnostic",
|
||||
@@ -92,8 +94,6 @@ __all__ = [
|
||||
"specs_from_discovered_tools",
|
||||
"tool_call_completed_event",
|
||||
"tool_call_started_event",
|
||||
"ToolWrapperEvent",
|
||||
"ToolWrapperEventSink",
|
||||
"wrap_discovered_tool",
|
||||
]
|
||||
|
||||
|
||||
@@ -77,14 +77,16 @@ async def open_mcp_session(
|
||||
headers=bound.headers or None,
|
||||
auth=bound.auth,
|
||||
)
|
||||
async with http_client:
|
||||
async with streamable_http_client(
|
||||
async with (
|
||||
http_client,
|
||||
streamable_http_client(
|
||||
str(transport.url),
|
||||
http_client=http_client,
|
||||
) as (read_stream, write_stream, _get_session_id):
|
||||
async with ClientSession(read_stream, write_stream) as session:
|
||||
await session.initialize()
|
||||
yield session
|
||||
) as (read_stream, write_stream, _get_session_id),
|
||||
):
|
||||
async with ClientSession(read_stream, write_stream) as session:
|
||||
await session.initialize()
|
||||
yield session
|
||||
return
|
||||
|
||||
raise ValueError(f"unsupported MCP transport {transport.kind!r}")
|
||||
|
||||
Reference in New Issue
Block a user