Documentation
¶
Index ¶
- Constants
- func Factory(cfg llm.APIConfig, model string, opts ...llm.Option) (llm.Client, error)
- type Client
- func (c *Client) Apply(opts ...llm.Option)
- func (c *Client) Complete(ctx context.Context, messages []llm.Message, toolSet []tools.Tool) (llm.Response, error)
- func (c *Client) Model() string
- func (c *Client) Name() string
- func (c *Client) SetModel(m string)
- func (c *Client) Stream(ctx context.Context, messages []llm.Message, toolSet []tools.Tool, ...) (llm.Response, error)
Constants ¶
const (
DefaultModel = "deepseek-v4-flash"
)
const ProviderName = "deepseek"
ProviderName is the registry key under which this client registers.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements llm.Client backed by DeepSeek's OpenAI-compatible chat API.
func New ¶
New builds a DeepSeek client from provider config and applies the given options. Options can be re-applied at runtime via Apply.
func (*Client) Stream ¶
func (c *Client) Stream(ctx context.Context, messages []llm.Message, toolSet []tools.Tool, sink llm.ChunkSink) (llm.Response, error)
Stream is the chunked variant of Complete. It opens a streaming SSE connection to DeepSeek's chat endpoint, forwards each delta to sink as a Chunk, and returns the fully-assembled Response (content, thinking, tool calls, usage) once the server emits its terminal data: [DONE] frame.
On context cancellation the underlying request transport aborts; the scanner loop honors ctx.Err() between reads and returns llm.ErrInterrupted in that case so the agent's interrupt path treats it like any other cancelled completion.