思考モード
複雑な問題解決のための拡張推論。
概要
思考モード(拡張推論)を使うと、モデルは最終的な回答を生成する前に「声に出して考える」ことができます。モデルは段階的な推論チェーンを生成し、数学、論理、コード分析などの複雑なタスクでの精度が向上します。
使い方
推論対応モデル(deepseek-reasoner など)を使用すると、思考モードが自動的に有効になります。推論の出力は reasoning_content フィールドに表示されます:
TypeScript
| 1 | const stream = await client.chat.completions.create({ |
| 2 | model: 'deepseek-reasoner', |
| 3 | messages: [{ role: 'user', content: '√2 が無理数であることを証明してください' }], |
| 4 | stream: true, |
| 5 | }); |
| 6 | |
| 7 | for await (const chunk of stream) { |
| 8 | const thinking = chunk.choices[0]?.delta?.reasoning_content; |
| 9 | if (thinking) process.stderr.write(thinking); |
| 10 | |
| 11 | const content = chunk.choices[0]?.delta?.content; |
| 12 | if (content) process.stdout.write(content); |
| 13 | } |
推論モデル
拡張推論をサポートするモデル:
deepseek-reasoner— DeepSeek の専用推論モデルclaude-opus-4— Anthropic Claude 推論モードo1、o1-mini— OpenAI 推論モデル
モデルページ で推論モデルをフィルタリングできます。