deepseek

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package deepseek provides a DeepSeek adapter for model.LLM.

Index

Constants

View Source
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"
)
View Source
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

type Option = openai.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

func WithRetryConfig(cfg retry.Config) Option

WithRetryConfig sets the retry behavior for transient API errors.

func WithThinkingEnabled

func WithThinkingEnabled(enabled bool) Option

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"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL