Documentation
¶
Overview ¶
This example calls the real DeepSeek REST and SSE APIs for a multi-turn conversation. It reads DEEPSEEK_API_KEY into an in-memory credential store and DEEPSEEK_MODEL (default: deepseek-chat; deepseek-reasoner also emits reasoning chunks), builds system/user/assistant messages with temperature and length limits, streams reasoning/text/tool-call chunks, and prints usage including cache hits and misses. Run from the repository root with your own key from https://platform.deepseek.com. PowerShell: set $env:DEEPSEEK_API_KEY and optionally $env:DEEPSEEK_MODEL, then run go run ./examples/chat. Linux/macOS: DEEPSEEK_API_KEY="sk-your-key" DEEPSEEK_MODEL="deepseek-reasoner" go run ./examples/chat.