yoi/crates/provider/README.md
2026-04-19 23:32:14 +09:00

16 lines
839 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# provider
マニフェストの `ModelConfig` から適切な `LlmClient``HttpTransport<S>`を構築するファクトリクレート。APIキーの環境変数 / ファイル解決と scheme ↔ auth の整合検証を担う。
## 公開型
- `build_client(config: &ModelConfig) -> Result<Box<dyn LlmClient>, ProviderError>``SchemeKind``AuthRef` から `HttpTransport<S>` を構築
- `ProviderError` — クライアント構築エラー
## 責務
- `AuthRef::ApiKey``ResolvedAuth::ApiKey` に解決env → file の優先順位)
- `AuthRef::None``ResolvedAuth::None` に変換
- `Scheme::required_auth()``ResolvedAuth` の妥当性検証(非対応組合せは構築エラー)
- 既知モデルは scheme の静的テーブル、未知モデルは scheme 既定の `ModelCapability` を採用