Spaces:
Sleeping
Sleeping
File size: 1,176 Bytes
d094faf 701d9c5 d094faf | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | """Generic CLIProxyAPI integration shared by every agent runner.
CLIProxyAPI (github.com/router-for-me/CLIProxyAPI) is a single local proxy
that bridges Anthropic, OpenAI/Codex, and Gemini protocol surfaces on one
port. Pointing every agent at it lets us share OAuth state, credentials, and
rate-limit budget across many harnesses.
Public surface — three things:
ProxyEndpoint → where the proxy is + what API key to send
{anthropic,openai,gemini}_env(ep, model=...) → env-var dicts to splice
into subprocess.Popen
openai_yaml_block(ep, model) → snippet for agents whose configs take
base_url/api_key/model directly
Plus `wait_until_ready(ep)` for runners that should fail fast if the proxy
isn't up, and an opt-in `spawn_proxy()` ctx-manager for one-off testing.
"""
from .endpoint import ProxyEndpoint
from .env import anthropic_env, openai_env, openai_yaml_block
from .health import is_ready, wait_until_ready
__all__ = [
"ProxyEndpoint",
"anthropic_env",
"openai_env",
"openai_yaml_block",
"is_ready",
"wait_until_ready",
]
|