Documentation
¶
Overview ¶
Package deepseek provides DeepSeek's OpenAI-compatible LLM service.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶ added in v1.0.0
Adapter converts a universal conversation into a DeepSeek chat-completions request. The zero value is ready to use.
It embeds the OpenAI adapter and adds an empty reasoning_content to every assistant message that has none, so requests are accepted in thinking mode after a tool call. Messages travel under the OpenAI identifier, which the embedded adapter supplies: DeepSeek reads the same message format.
func (*Adapter) LLMInvocationParams ¶ added in v1.0.0
func (a *Adapter) LLMInvocationParams( convo *frames.LLMContext, opts adapter.Options, ) (chat.Params, error)
LLMInvocationParams converts the conversation and then adds the reasoning_content DeepSeek requires on every assistant message.
type LLMConfig ¶ added in v0.3.0
type LLMConfig struct {
chat.LLMConfig
// Thinking is the thinking mode configuration. Nil uses the service
// default, disabled: DeepSeek's V4 models otherwise run a reasoning pass
// before every answer, which delays the first spoken token. Set
// &ThinkingConfig{Type: "enabled"} to turn it on, or &ThinkingConfig{} to
// leave the choice to DeepSeek's own default.
Thinking *ThinkingConfig
}
LLMConfig configures a DeepSeek LLM service: everything the OpenAI-compatible endpoint takes, plus the thinking mode DeepSeek adds to it.
DeepSeek does not support some OpenAI parameters, so Seed, MaxCompletionTokens and ServiceTier are not sent. Bound the reply with MaxTokens instead.
type LLMService ¶ added in v1.0.0
type LLMService struct {
*chat.LLMService
}
LLMService is the DeepSeek LLM service NewLLM builds.
type LLMSettings ¶ added in v1.2.0
type LLMSettings struct {
chat.LLMSettings
// Thinking is the thinking mode configuration. See LLMConfig.Thinking. A
// value with no type, or no value, sends no thinking field.
Thinking settings.Opt[ThinkingConfig] `settings:"thinking"`
}
LLMSettings is the DeepSeek LLM configuration that can change while the pipeline runs, through an LLMUpdateSettingsFrame: the OpenAI-compatible settings, plus the thinking mode. Every request is built from it.
type ThinkingConfig ¶ added in v0.3.0
type ThinkingConfig struct {
// Type is the thinking mode: "enabled" or "disabled". DeepSeek's V4 models
// think before answering unless "disabled" turns it off, which for real-time
// voice cuts the time to the first answer token. It is not restricted to
// those two so a mode DeepSeek adds later stays usable. Empty sends no
// thinking field at all, leaving the choice to DeepSeek's own default.
Type string `json:"type,omitempty"`
}
ThinkingConfig is DeepSeek's thinking mode configuration.