← Về thư mục
openai4s/llm/transport.py
- bind_call_context · function · L41-L67 — def bind_call_context(fn, **context)
- _header_dict · function · L85-L89 — def _header_dict(e: urllib.error.HTTPError) -> dict[str, str]
- _request_id · function · L92-L96 — def _request_id(headers: dict[str, str]) -> str | None
- _error_code · function · L99-L116 — def _error_code(body: str) -> str | None
- _http_error · function · L119-L139 — def _http_error( e: urllib.error.HTTPError, *, provider: str | None, operation: str ) -> TransportError
- _url_error · function · L142-L152 — def _url_error( e: urllib.error.URLError, *, provider: str | None, operation: str ) -> TransportError
- _wait · function · L161-L179 — def _wait(delay: float, do_sleep, should_cancel) -> bool
- _sleep_for · function · L182-L197 — def _sleep_for(err: TransportError, attempt: int, base: float, cap: float) -> float
- _retry_loop · function · L200-L268 — def _retry_loop( attempt_fn, *, provider: str | None, operation: str, max_attempts: int, base_backoff: float, max_backoff: float, retry_budget: float, should_cancel=None, sleep=None, ): # noqa: C901 # Resolved per call, not captured as a default: a default argument is # evaluated once at def time, which would pin the original time.sleep and # silently ignore any test that patches it.
- post_json · function · L271-L310 — def post_json( url: str, payload: dict, headers: dict, timeout: float, *, provider: str | None = None, max_attempts: int = DEFAULT_MAX_ATTEMPTS, retry_budget: float = DEFAULT_RETRY_BUDGET, should_cancel=None, sleep=None, ) -> dict
- attempt · function · L290-L298 — def attempt() -> dict
- post_sse · function · L319-L365 — def post_sse( url: str, payload: dict, headers: dict, timeout: float, on_event, *, provider: str | None = None, max_attempts: int = DEFAULT_MAX_ATTEMPTS, retry_budget: float = DEFAULT_RETRY_BUDGET, should_cancel=None, sleep=None, ) -> None
- attempt · function · L345-L353 — def attempt() -> None
- _consume · function · L368-L452 — def _consume(resp, on_event, *, provider: str | None, should_cancel=None) -> None
- cancelled · function · L381-L387 — def cancelled() -> bool
- dispatch · function · L389-L421 — def dispatch() -> None