Metadata-Version: 2.4
Name: ya-oauth-provider
Version: 0.82.0
Summary: Pydantic AI OAuth-backed model provider helpers for YA
Project-URL: Repository, https://github.com/wh1isper/ya-mono
Author-email: wh1isper <jizhongsheng957@gmail.com>
Keywords: agents,oauth,pydantic-ai
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: <3.14,>=3.11
Requires-Dist: httpx>=0.28.1
Requires-Dist: pydantic-ai<2,>=1.100.0
Requires-Dist: pydantic>=2.12.0
Requires-Dist: tenacity>=9.0.0
Requires-Dist: ya-oauth==0.82.0
Description-Content-Type: text/markdown

# ya-oauth-provider

Pydantic AI model/provider helpers that consume OAuth token sources from `ya-oauth`.

## Codex model string

YA Agent SDK loads this package for model strings such as:

```text
oauth@codex:gpt-5.5
```

The provider attaches Codex-compatible bearer, account, originator, session, and thread headers. It omits the Codex `version` header by default to avoid coupling YA package versions to Codex CLI release gates.

## Proactive refresh

`ya_oauth_provider.OAuthRefreshSupervisor` refreshes configured OAuth token sources on startup and on a background interval. Runtime packages can use `create_oauth_refresh_supervisor_for_models(...)` to detect `oauth@provider:model` strings and maintain logged-in providers before the first model request needs a token refresh.
