OpenRouter's API for pyfect.ai (Effect's @effect/ai-openrouter):
the client (chat completions, streamed chat completions, alpha
decisions and the generated client of every operation), its per-call
config, the language_model and decision_model, the decisions
wire schema and the error metadata an AiError carries.
generated holds the schemas and client of OpenRouter's OpenAPI
document, generated by scripts/gen_ai_schemas.py::
from pyfect.ai.openrouter import client, language_model
program.pipe(fx.provide(language_model.model("openai/gpt-4o-mini").layer)).pipe(
fx.provide(client.layer_config(api_key=config.redacted("OPENROUTER_API_KEY")))
)Re-exports#
- From
pyfect.ai.openrouter.client:OpenRouterClient - From
pyfect.ai.openrouter.config:OpenRouterConfig