deepseek

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2026 License: BSD-2-Clause Imports: 7 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

type Adapter struct {
	chat.Adapter
}

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.

func (LLMConfig) Validate added in v0.3.0

func (c LLMConfig) Validate() error

Validate reports whether the configuration is usable.

type LLMService added in v1.0.0

type LLMService struct {
	*chat.LLMService
}

LLMService is the DeepSeek LLM service NewLLM builds.

func NewLLM

func NewLLM(cfg LLMConfig) *LLMService

NewLLM builds a DeepSeek LLM service.

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.

Jump to

Keyboard shortcuts

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