Documentation
¶
Overview ¶
Package deepseek provides DeepSeek API integration for the LLM gateway.
Index ¶
Constants ¶
This section is empty.
Variables ¶
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
IsModel reports whether a model ID names a DeepSeek model, tolerating a vendor or provider prefix such as "deepseek/" or "opencode_go/".
func New ¶
func New(cfg providers.ProviderConfig, opts providers.ProviderOptions) core.Provider
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 ¶
func (p *Provider) Embeddings(_ context.Context, _ *core.EmbeddingRequest) (*core.EmbeddingResponse, error)
Embeddings returns an error because DeepSeek does not expose an embeddings endpoint.