Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ The conversational agent picks its provider from `AGENT_MODEL`, written as

| `AGENT_MODEL` | Provider | Required secret |
| ------------------------- | ----------------------- | ---------------------- |
| `openai:gpt-5.6-luna` | OpenAI | `OPENAI_API_KEY` |
| `openai:gpt-6-luna` | OpenAI | `OPENAI_API_KEY` |
| `anthropic:<model>` | Anthropic | `ANTHROPIC_API_KEY` |
| `google:gemini-3.8-flash` | Google Vertex AI | `GOOGLE_VERTEX_SA_KEY` |

Expand Down
24 changes: 24 additions & 0 deletions src/agent/llm.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,3 +175,27 @@ describe('resolveGoogleReasoningSetting', () => {
expect(resolveOpenAIReasoningOptions('gemini-3.8-flash')).toBeUndefined();
});
});

describe('resolveOpenAIReasoningOptions', () => {
it("'none' 対応が確認できている GPT-5.1 以降・GPT-6 系では none を返す", () => {
expect(resolveOpenAIReasoningOptions('gpt-5.1')).toEqual({
reasoningEffort: 'none',
});
expect(resolveOpenAIReasoningOptions('gpt-5.6-luna')).toEqual({
reasoningEffort: 'none',
});
expect(resolveOpenAIReasoningOptions('gpt-6-luna')).toEqual({
reasoningEffort: 'none',
});
expect(resolveOpenAIReasoningOptions('gpt-6')).toEqual({
reasoningEffort: 'none',
});
});

it('gpt-5 無印・o 系・非 reasoning モデルには何も指定しない', () => {
expect(resolveOpenAIReasoningOptions('gpt-5')).toBeUndefined();
expect(resolveOpenAIReasoningOptions('gpt-5-mini')).toBeUndefined();
expect(resolveOpenAIReasoningOptions('o4-mini')).toBeUndefined();
expect(resolveOpenAIReasoningOptions('gpt-4.1')).toBeUndefined();
});
});
4 changes: 2 additions & 2 deletions src/agent/llm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,11 @@ const modelIdOf = (model: LanguageModel): string =>

/**
* reasoningEffort: 'none' を受け付ける OpenAI モデル(GPT-5.1 系以降の
* マイナーバージョン付き GPT-5)。gpt-5 無印('minimal' まで)・o 系
* マイナーバージョン付き GPT-5 と GPT-6 系)。gpt-5 無印('minimal' まで)・o 系
* (low/medium/high のみ)・非 reasoning モデル(パラメータ自体を拒否)へ
* 'none' を送ると API エラー(400)になる。
*/
const OPENAI_REASONING_NONE_MODELS = /^gpt-5\.[1-9]/;
const OPENAI_REASONING_NONE_MODELS = /^gpt-(?:5\.[1-9]|6(?:[.-]|$))/;
Comment thread
TinyKitten marked this conversation as resolved.

/**
* OpenAI 向け reasoning 抑制の providerOptions をモデル別に解決する。
Expand Down
4 changes: 2 additions & 2 deletions wrangler.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
// --- AI エージェント(/agent/chat)---
// モデルは "anthropic:<model>" | "openai:<model>" | "google:<model>"。比較検証で差し替える
// ("google:" は Vertex AI 経由。API キーではなく GOOGLE_VERTEX_SA_KEY が必要)
"AGENT_MODEL": "openai:gpt-5.6-luna",
"AGENT_MODEL": "openai:gpt-6-luna",
// Vertex AI 用(AGENT_MODEL が google: のときのみ使う)。
// GOOGLE_VERTEX_PROJECT 未設定なら GOOGLE_VERTEX_SA_KEY の project_id を使う。
// ロケーションは "global" がモデルの提供範囲が最も広い。特定リージョンに寄せるなら
Expand Down Expand Up @@ -152,7 +152,7 @@
"FEW_SHOT_LIMIT": "16",
"FEW_SHOT_PER_EX_MAX": "800",
// --- AI エージェント(/agent/chat)---
"AGENT_MODEL": "openai:gpt-5.6-luna",
"AGENT_MODEL": "openai:gpt-6-luna",
"GOOGLE_VERTEX_LOCATION": "global",
"AGENT_GATE_MODEL": "@cf/meta/llama-3.1-8b-instruct-fast",
"AGENT_FAQ_KV_KEY": "config:agent-faq",
Expand Down
Loading