Documentation
¶
Overview ¶
Package deepseek provides a DeepSeek adapter for model.LLM.
Index ¶
- Constants
- type ChatCompletion
- func New(apiKey, modelName string, retryCfg ...retry.Config) *ChatCompletion
- func NewWithBaseURL(apiKey, baseURL, modelName string, retryCfg ...retry.Config) *ChatCompletion
- func NewWithBaseURLOptions(apiKey, baseURL, modelName string, opts ...Option) *ChatCompletion
- func NewWithOptions(apiKey, modelName string, opts ...Option) *ChatCompletion
- type Option
- type ReasoningEffort
Constants ¶
const ( // ModelV4Flash is DeepSeek's fast general-purpose model. ModelV4Flash = "deepseek-v4-flash" // ModelV4Pro is DeepSeek's higher-capability general-purpose model. ModelV4Pro = "deepseek-v4-pro" // ModelChat is DeepSeek's legacy non-thinking compatibility model. // // Deprecated: use ModelV4Flash with WithThinkingEnabled(false) instead. ModelChat = "deepseek-chat" // ModelReasoner is DeepSeek's legacy thinking compatibility model. // // Deprecated: use ModelV4Flash or ModelV4Pro with WithThinkingEnabled(true) instead. ModelReasoner = "deepseek-reasoner" )
const BaseURL = "https://api.deepseek.com"
BaseURL is the default DeepSeek OpenAI-compatible API endpoint.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChatCompletion ¶
type ChatCompletion struct {
// contains filtered or unexported fields
}
ChatCompletion implements model.LLM using DeepSeek's OpenAI-compatible Chat Completions API.
func New ¶
func New(apiKey, modelName string, retryCfg ...retry.Config) *ChatCompletion
New creates a new DeepSeek ChatCompletion instance using the default DeepSeek OpenAI-compatible API endpoint.
func NewWithBaseURL ¶
func NewWithBaseURL(apiKey, baseURL, modelName string, retryCfg ...retry.Config) *ChatCompletion
NewWithBaseURL creates a new DeepSeek ChatCompletion instance using a custom OpenAI-compatible base URL, which is useful for proxies and tests.
func NewWithBaseURLOptions ¶
func NewWithBaseURLOptions(apiKey, baseURL, modelName string, opts ...Option) *ChatCompletion
NewWithBaseURLOptions creates a new DeepSeek ChatCompletion instance using a custom OpenAI-compatible base URL and explicit adapter options.
func NewWithOptions ¶
func NewWithOptions(apiKey, modelName string, opts ...Option) *ChatCompletion
NewWithOptions creates a new DeepSeek ChatCompletion instance using the default DeepSeek OpenAI-compatible API endpoint and explicit adapter options.
func (*ChatCompletion) GenerateContent ¶
func (c *ChatCompletion) GenerateContent(ctx context.Context, req *model.LLMRequest, cfg *model.GenerateConfig, stream bool) iter.Seq2[*model.LLMResponse, error]
GenerateContent sends the request to the DeepSeek Chat Completions API.
func (*ChatCompletion) Name ¶
func (c *ChatCompletion) Name() string
Name returns the DeepSeek model identifier.
type Option ¶
Option configures a DeepSeek ChatCompletion.
func WithReasoningEffort ¶ added in v0.0.9
func WithReasoningEffort(effort ReasoningEffort) Option
WithReasoningEffort sets DeepSeek thinking-mode reasoning effort.
func WithRetryConfig ¶
WithRetryConfig sets the retry behavior for transient API errors.
func WithThinkingEnabled ¶
WithThinkingEnabled explicitly enables or disables DeepSeek thinking.
type ReasoningEffort ¶ added in v0.0.9
type ReasoningEffort string
ReasoningEffort controls DeepSeek thinking-mode reasoning effort.
const ( // ReasoningEffortHigh uses DeepSeek's default reasoning effort. ReasoningEffortHigh ReasoningEffort = "high" // ReasoningEffortMax requests DeepSeek's maximum reasoning effort. ReasoningEffortMax ReasoningEffort = "max" )