Documentation
¶
Overview ¶
Package deepseek provides an interfaces.LLMClient for DeepSeek.
DeepSeek exposes an OpenAI-compatible Chat Completions API, so this client uses the openai-go SDK as its transport but implements the interface independently: it defaults to DeepSeek's base URL, sends system prompts with the "system" role (DeepSeek does not accept OpenAI's "developer" role), and maps the deepseek-reasoner "reasoning_content" field into LLMResponse.Metadata["reasoning_content"] and streaming ThinkingDelta.
Common models: "deepseek-chat" and "deepseek-reasoner".
Index ¶
- Constants
- type Client
- func (c *Client) Generate(ctx context.Context, req *interfaces.LLMRequest) (*interfaces.LLMResponse, error)
- func (c *Client) GenerateStream(ctx context.Context, req *interfaces.LLMRequest) (interfaces.LLMStream, error)
- func (c *Client) GetModel() string
- func (c *Client) GetProvider() interfaces.LLMProvider
- func (c *Client) IsStreamSupported() bool
Constants ¶
const DefaultBaseURL = "https://api.deepseek.com"
DefaultBaseURL is DeepSeek's OpenAI-compatible API endpoint.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client implements interfaces.LLMClient for DeepSeek.
func NewClient ¶
NewClient creates a new DeepSeek LLM client. The base URL defaults to DefaultBaseURL; a caller-supplied llm.WithBaseURL overrides it.
func (*Client) Generate ¶
func (c *Client) Generate(ctx context.Context, req *interfaces.LLMRequest) (*interfaces.LLMResponse, error)
func (*Client) GenerateStream ¶
func (c *Client) GenerateStream(ctx context.Context, req *interfaces.LLMRequest) (interfaces.LLMStream, error)
func (*Client) GetProvider ¶
func (c *Client) GetProvider() interfaces.LLMProvider