reasoning_content 필드에서 확인할 수 있습니다. 이 필드는 다른 모델의 출력에는 포함되지 않습니다.
- Python
- Bash
W&B Inference 응답에서 추론(Reasoning) 과정을 반환하고 확인하는 방법
reasoning_content 필드에서 확인할 수 있습니다. 이 필드는 다른 모델의 출력에는 포함되지 않습니다.
import openai
client = openai.OpenAI(
base_url='https://api.inference.wandb.ai/v1',
api_key="<your-api-key>", # https://wandb.ai/settings 에서 API 키를 생성하세요.
)
response = client.chat.completions.create(
model="openai/gpt-oss-20b",
messages=[
{"role": "user", "content": "3.11 and 3.8, which is greater?"}
],
)
print(response.choices[0].message.reasoning_content)
print("--------------------------------")
print(response.choices[0].message.content)
curl https://api.inference.wandb.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your-api-key>" \
-d '{
"model": "openai/gpt-oss-20b",
"messages": [
{ "role": "user", "content": "3.11 and 3.8, which is greater?" }
],
}'