deepseek

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package deepseek is a native DeepSeek model adapter: an agentcore.ChatModel (llm.LLM) backed by DeepSeek's chat-completions API. DeepSeek's own API is OpenAI-shaped, so a plain HTTP client IS native here, not a compatibility shim, and it needs no heavyweight SDK.

Scope: built for cheap one-shot work (summaries, extraction). Tool-calling is not advertised, and GenerateStream returns the full result as one terminal event (the Once pattern) rather than true token streaming. Wire real streaming and tools before using DeepSeek as a primary conversational model.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter struct {
	// contains filtered or unexported fields
}

Adapter wraps DeepSeek's chat-completions API as an llm.LLM.

func New

func New(cfg Config) (*Adapter, error)

New builds an Adapter from config.

func (*Adapter) Generate

func (a *Adapter) Generate(ctx context.Context, msgs []ac.Message, _ []ac.ToolSpec, _ ...ac.CallOption) (*ac.LLMResponse, error)

Generate runs a one-shot chat completion. Messages are flattened to their text content (this adapter is text-only for now); tools are ignored.

func (*Adapter) GenerateStream

func (a *Adapter) GenerateStream(ctx context.Context, msgs []ac.Message, tools []ac.ToolSpec, opts ...ac.CallOption) (<-chan ac.StreamEvent, error)

GenerateStream synthesizes a degenerate stream from the one-shot result: one terminal StreamEventDone with the full message (the Once pattern). Enough for the agent loop to advance; add real token streaming before conversational use.

func (*Adapter) SupportsTools

func (a *Adapter) SupportsTools() bool

SupportsTools reports false: this adapter does not wire tool-calling yet.

type Config

type Config struct {
	APIKey  string
	Model   string // e.g. "deepseek-chat"
	BaseURL string
	// Meter, if set, receives token/latency Usage for every call.
	Meter llm.Meter
}

Config configures the adapter. APIKey and Model are required; BaseURL defaults to DeepSeek's public endpoint.

Jump to

Keyboard shortcuts

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