カタログの実装完了、ドキュメント整理
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
|
||||
### 宣言した層が解決する
|
||||
|
||||
ある層が構成を宣言として受け取ったなら、その解決もその層の責務。マニフェストに `provider.kind = "anthropic"` と書いた以上、`ProviderConfig` → `LlmClient` の変換は insomnia が行う。逆に llm-worker が `LlmClient` trait だけを受け取るのは正しい — llm-worker はプロバイダの選択を宣言として受け取っていないから。
|
||||
ある層が構成を宣言として受け取ったなら、その解決もその層の責務。マニフェストに `[model] ref = "anthropic/claude-sonnet-4-6"`(あるいは `scheme = "anthropic"` + `model_id = ...` の inline 形式)と書いた以上、`ModelManifest` → `LlmClient` の変換は insomnia 側(`crates/provider`)が行う。逆に llm-worker が `LlmClient` trait だけを受け取るのは正しい — llm-worker はプロバイダの選択を宣言として受け取っていないから。
|
||||
|
||||
### 概念の追加は不在が問題になってから
|
||||
|
||||
@@ -76,8 +76,7 @@ name = "agent"
|
||||
pwd = "/abs/path"
|
||||
|
||||
[model]
|
||||
scheme = "anthropic"
|
||||
model_id = "claude-sonnet-4-20250514"
|
||||
ref = "anthropic/claude-sonnet-4-6"
|
||||
|
||||
[worker]
|
||||
instruction = "$insomnia/default"
|
||||
@@ -88,6 +87,8 @@ target = "/abs/path"
|
||||
permission = "write"
|
||||
```
|
||||
|
||||
`[model]` は `ref = "<provider>/<model_id>"` でプロバイダ / モデルカタログを引く短縮形と、`scheme` / `model_id` / `auth` を直書きする inline 形式の両方を受ける。カタログは `resources/{providers,models}/builtin.toml` を builtin、`$XDG_CONFIG_HOME/insomnia/{providers,models}.toml` を user override として解決する。詳細は `docs/pod-factory.md` と `crates/provider/README.md`。
|
||||
|
||||
### PodFactory: カスケード設定
|
||||
|
||||
マニフェストを手書きせず、4 層のカスケードで `PodManifest` を組み立てる:
|
||||
|
||||
@@ -20,7 +20,7 @@ Ollama は独自 scheme を作らず `scheme/anthropic` を base_url 差し替
|
||||
|
||||
### 二次サポート(OpenAI 互換共通枠)
|
||||
|
||||
`provider_kind: openai_compatible` + `base_url` + API key + `available_models[]` の汎用アダプタ 1 本で以下を収容:
|
||||
`scheme = "openai_chat"` + `base_url` + API key を宣言するプロバイダカタログエントリ(`resources/providers/builtin.toml`)1 つで以下を収容。個別モデルはモデルカタログ(`resources/models/builtin.toml`)側で列挙する:
|
||||
|
||||
- OpenRouter
|
||||
- xAI (Grok)
|
||||
@@ -44,7 +44,7 @@ Ollama は独自 scheme を作らず `scheme/anthropic` を base_url 差し替
|
||||
## 実装原則
|
||||
|
||||
- 認証ストアを読むアダプタ(`~/.codex/auth.json` 等)は **llm-worker 直下に置かず上位層に配置**。llm-worker は低レベル基盤に留める方針(`feedback_llm_worker_scope.md`)と整合
|
||||
- モデル列挙は **auto_discover と宣言型の両輪**。Ollama は `/api/tags` で自動、OpenAI 互換枠は `available_models[]` を宣言
|
||||
- モデル列挙は **auto_discover と宣言型の両輪**。Ollama は `/api/tags` で自動、OpenAI 互換枠はモデルカタログ(`resources/models/builtin.toml` + `$XDG_CONFIG_HOME/insomnia/models.toml` の user override)で宣言
|
||||
- UI のプロバイダ選択肢も第一級 → 二次の優先順位で並べる
|
||||
- **`ollama launch insomnia` 対応を視野に**、env 注入(`ANTHROPIC_BASE_URL` / `OPENAI_BASE_URL` 等)で起動設定を受け入れる作り
|
||||
|
||||
|
||||
+20
-4
@@ -80,11 +80,16 @@ resolve 段を取りこぼしている証拠なので `ResolveError::RelativePat
|
||||
|
||||
```toml
|
||||
[model]
|
||||
scheme = "anthropic"
|
||||
model_id = "claude-sonnet-4-20250514"
|
||||
ref = "anthropic/claude-sonnet-4-6"
|
||||
auth = { kind = "api_key", file = "/home/you/.config/insomnia/keys/anthropic" }
|
||||
```
|
||||
|
||||
`ref = "<provider>/<model_id>"` はプロバイダ / モデルカタログを引く短縮形。
|
||||
`scheme` / `base_url` / `model_id` は provider 側の宣言から引かれ、`auth` も
|
||||
カタログの `auth_hint` を起点に解決する。ここでは env 既定(`INSOMNIA_API_KEY_ANTHROPIC`)
|
||||
ではなく file から読みたいので `auth` だけ override している。詳細は
|
||||
`crates/provider/README.md` と `resources/{providers,models}/builtin.toml` を参照。
|
||||
|
||||
### プロジェクト層(最小)
|
||||
|
||||
`<project>/.insomnia/manifest.toml`:
|
||||
@@ -108,9 +113,20 @@ compact_threshold = 80000
|
||||
[pod]
|
||||
name = "reviewer"
|
||||
|
||||
# Form A: ref のみ(カタログから scheme / base_url / auth_hint / capability を全部引く)
|
||||
# [model]
|
||||
# ref = "anthropic/claude-sonnet-4-6"
|
||||
#
|
||||
# Form B: ref + 部分 override(ここで示している形)
|
||||
# カタログ起点に個別フィールドだけ上書き。ref 指定時は scheme / model_id / auth は任意 override。
|
||||
#
|
||||
# Form C: 完全 inline(カタログ無視。実験用 / カタログに無いモデル)
|
||||
# [model]
|
||||
# scheme = "anthropic"
|
||||
# model_id = "claude-sonnet-4-6"
|
||||
# auth = { kind = "api_key", file = "..." }
|
||||
[model]
|
||||
scheme = "anthropic"
|
||||
model_id = "claude-sonnet-4-20250514"
|
||||
ref = "anthropic/claude-sonnet-4-6"
|
||||
base_url = "https://api.anthropic.com"
|
||||
auth = { kind = "api_key", file = "/home/you/.config/insomnia/keys/anthropic" }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user