Spaces:
Sleeping
Sleeping
Download agents/cliproxyapi/__init__.py from lanczos/graphtestbed: direct link, hf CLI and curl.
- Browser
- Download file 1.18 kB
-
https://huggingface.co/spaces/lanczos/graphtestbed/resolve/main/agents/cliproxyapi/__init__.py
- Command line
-
hf download hf://spaces/lanczos/graphtestbed/agents/cliproxyapi/__init__.py
-
curl -L -o __init__.py https://huggingface.co/spaces/lanczos/graphtestbed/resolve/main/agents/cliproxyapi/__init__.py
1.18 kB
| """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", | |
| ] | |