사고 모드

복잡한 문제 해결을 위한 확장 추론.

개요

사고 모드(확장 추론)는 모델이 최종 답변을 생성하기 전에 "소리 내어 생각"할 수 있게 합니다. 모델이 단계별 추론 체인을 생성하여 수학, 논리, 코드 분석 등 복잡한 작업에서 정확도가 향상됩니다.

사용 방법

추론을 지원하는 모델(예: deepseek-reasoner)을 사용하면 사고 모드가 자동으로 활성화됩니다. 추론 출력은 reasoning_content 필드에 나타납니다:

TypeScript
1const stream = await client.chat.completions.create({
2 model: 'deepseek-reasoner',
3 messages: [{ role: 'user', content: '루트 2가 무리수임을 증명하세요' }],
4 stream: true,
5});
6
7for 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 추론 모델

모델 페이지에서 추론 모델을 필터링하세요.