Support custom httpx client creation (#752)
This commit is contained in:
parent
7c8ad510b7
commit
10cf0f78a8
1 changed files with 16 additions and 5 deletions
|
|
@ -1,12 +1,21 @@
|
|||
"""Utilities for creating standardized httpx AsyncClient instances."""
|
||||
|
||||
from typing import Any
|
||||
from typing import Any, Protocol
|
||||
|
||||
import httpx
|
||||
|
||||
__all__ = ["create_mcp_http_client"]
|
||||
|
||||
|
||||
class McpHttpClientFactory(Protocol):
|
||||
def __call__(
|
||||
self,
|
||||
headers: dict[str, str] | None = None,
|
||||
timeout: httpx.Timeout | None = None,
|
||||
auth: httpx.Auth | None = None,
|
||||
) -> httpx.AsyncClient: ...
|
||||
|
||||
|
||||
def create_mcp_http_client(
|
||||
headers: dict[str, str] | None = None,
|
||||
timeout: httpx.Timeout | None = None,
|
||||
|
|
|
|||
Loading…
Reference in a new issue