deepseek

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: MIT Imports: 14 Imported by: 0 modules, 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 API integration for the LLM gateway.

Index

Constants

This section is empty.

Variables

View Source
var Registration = providers.Registration{
	Type:                        "deepseek",
	New:                         New,
	PassthroughSemanticEnricher: passthroughSemanticEnricher,
	Discovery: providers.DiscoveryConfig{
		DefaultBaseURL: defaultBaseURL,
	},
}

Registration provides factory registration for the DeepSeek provider.

Functions

func AdaptCompatibility added in v0.1.92

func AdaptCompatibility(req *core.ChatRequest, providerName string, mode JSONSchemaMode) (*core.ChatRequest, error)

AdaptCompatibility applies DeepSeek's request requirements that do not depend on the serving provider's reasoning-effort dialect. Providers that route to DeepSeek models (deepseek, opencode_go) call it from their chat request hook, which runs after virtual-model routing has resolved the target.

func IsModel added in v0.1.92

func IsModel(model string) bool

IsModel reports whether a model ID names a DeepSeek model, tolerating a vendor or provider prefix such as "deepseek/" or "opencode_go/".

func New

New creates a new DeepSeek provider.

Types

type JSONSchemaMode added in v0.1.92

type JSONSchemaMode string

JSONSchemaMode is the handling applied to response_format type json_schema.

const (
	// JSONSchemaDowngrade sends json_object and adds the schema as a system
	// instruction. The output is JSON but no longer schema-enforced upstream.
	JSONSchemaDowngrade JSONSchemaMode = "downgrade"
	// JSONSchemaError rejects the request with an invalid_request_error.
	JSONSchemaError JSONSchemaMode = "error"
)

func LoadJSONSchemaMode added in v0.1.92

func LoadJSONSchemaMode() JSONSchemaMode

LoadJSONSchemaMode resolves DEEPSEEK_JSON_SCHEMA_MODE, defaulting to downgrade so clients routed to DeepSeek through a virtual model keep working.

type Provider

type Provider struct {
	*openai.ChatCompatible
}

Provider implements the core.Provider interface for DeepSeek. DeepSeek's API is OpenAI-compatible, so all transport goes through the shared chat-centric adapter. Its request hook handles reasoning-effort mapping and the DeepSeek compatibility rules in compat.go; DeepSeek does not expose an embeddings endpoint.

func (*Provider) Embeddings

Embeddings returns an error because DeepSeek does not expose an embeddings endpoint.

Jump to

Keyboard shortcuts

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