← Về thư mục
openai4s/mcp_http.py
- _NoRedirect · class · L53-L57 — class _NoRedirect(urllib.request.HTTPRedirectHandler)
- redirect_request · method · L56-L57 — def redirect_request(self, _args, *_kwargs): # noqa: ANN002, ANN003
- _SessionExpired · class · L60-L61 — class _SessionExpired(Exception)
- _validated_url · function · L64-L80 — def _validated_url(value: Any) -> str
- _validated_headers · function · L83-L102 — def _validated_headers(value: Any) -> dict[str, str]
- _session_id · function · L105-L116 — def _session_id(value: str | None) -> str | None
- _protocol_version · function · L119-L122 — def _protocol_version(value: Any) -> str
- _sse_messages · function · L125-L164 — def _sse_messages(body: bytes) -> list[dict[str, Any]]
- finish_event · function · L134-L146 — def finish_event() -> None
- _json_messages · function · L167-L176 — def _json_messages(body: bytes) -> list[dict[str, Any]]
- _select_response · function · L179-L200 — def _select_response( body: bytes, content_type: str, expected_id: int, ) -> dict[str, Any]
- _redact_reflection · function · L203-L206 — def _redact_reflection(value: Any, secret: str) -> Any
- _redact_jsonrpc_message · function · L209-L244 — def _redact_jsonrpc_message(message: dict[str, Any], secret: str) -> dict[str, Any]
- MCPHTTPConnection · class · L247-L606 — class MCPHTTPConnection
- init · method · L250-L290 — def init( self, url: str, headers: Mapping[str, Any] | None = None, *, headers_provider: Callable[[], Mapping[str, Any] | None] | None = None, timeout: float | None = None, ) -> None
- repr · method · L292-L293 — def repr(self) -> str
- _next_id · method · L295-L297 — def _next_id(self) -> int
- _wire_headers · method · L299-L319 — def _wire_headers(self) -> dict[str, str]
- _check_network_policy · method · L321-L333 — def _check_network_policy(self) -> None
- _read_body · method · L335-L366 — def _read_body( self, response: Any, exchange: HTTPExchangeDeadline, ) -> bytes
- _oversize · function · L349-L350 — def _oversize() -> BaseException
- _post · method · L368-L465 — def _post( self, payload: dict[str, Any], *, expected_id: int | None, ) -> dict[str, Any] | None
- _request · method · L467-L516 — def _request( self, method: str, params: dict[str, Any] | None = None, *, recover_session: bool = True, ) -> dict[str, Any]
- _notify · method · L518-L523 — def _notify(self, method: str, params: dict[str, Any] | None = None) -> None
- _initialize · method · L525-L545 — def _initialize(self) -> None
- alive · method · L547-L548 — def alive(self) -> bool
- faulted · method · L550-L554 — def faulted(self) -> bool: # A connection that lost its session and could not re-handshake can never # answer another request, so the manager must evict it. Reporting only #
_closed made this health check dead for the HTTP transport.
- failure · method · L556-L557 — def failure(self) -> str | None
- stderr_tail · method · L559-L560 — def stderr_tail(self) -> str
- close · method · L562-L570 — def close(self) -> bool
- list_tools · method · L572-L575 — def list_tools(self) -> list[dict]
- call_tool · method · L577-L589 — def call_tool(self, name: str, arguments: dict | None = None) -> dict
- list_resources · method · L591-L593 — def list_resources(self, cursor: str | None = None) -> dict
- read_resource · method · L595-L596 — def read_resource(self, uri: str) -> dict
- list_prompts · method · L598-L600 — def list_prompts(self, cursor: str | None = None) -> dict
- get_prompt · method · L602-L606 — def get_prompt(self, name: str, arguments: dict | None = None) -> dict