Add streamable_http_client which accepts httpx.AsyncClient instead of httpx_client_factory (#1177)
Co-authored-by: Felix Weinberger <fweinberger@anthropic.com>
This commit is contained in:
parent
cc8382ce3e
commit
a3a4b8d11a
1 changed files with 488 additions and 221 deletions
|
|
@ -12,7 +12,7 @@ from collections.abc import Generator
|
|||
import pytest
|
||||
|
||||
from mcp.client.session import ClientSession
|
||||
from mcp.client.streamable_http import streamablehttp_client
|
||||
from mcp.client.streamable_http import streamable_http_client
|
||||
from tests.test_helpers import wait_for_server
|
||||
|
||||
# Test constants with various Unicode characters
|
||||
|
|
@ -178,7 +178,7 @@ async def test_streamable_http_client_unicode_tool_call(running_unicode_server:
|
|||
base_url = running_unicode_server
|
||||
endpoint_url = f"{base_url}/mcp"
|
||||
|
||||
async with streamablehttp_client(endpoint_url) as (read_stream, write_stream, _get_session_id):
|
||||
async with streamable_http_client(endpoint_url) as (read_stream, write_stream, _get_session_id):
|
||||
async with ClientSession(read_stream, write_stream) as session:
|
||||
await session.initialize()
|
||||
|
||||
|
|
@ -210,7 +210,7 @@ async def test_streamable_http_client_unicode_prompts(running_unicode_server: st
|
|||
base_url = running_unicode_server
|
||||
endpoint_url = f"{base_url}/mcp"
|
||||
|
||||
async with streamablehttp_client(endpoint_url) as (read_stream, write_stream, _get_session_id):
|
||||
async with streamable_http_client(endpoint_url) as (read_stream, write_stream, _get_session_id):
|
||||
async with ClientSession(read_stream, write_stream) as session:
|
||||
await session.initialize()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue