deepseek

package
v1.261203.2 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2026 License: MPL-2.0 Imports: 12 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 implements DeepSeek's read-only web APIs.

Index

Constants

View Source
const DefaultBaseURL = "https://api.deepseek.com"

DefaultBaseURL is the first-party DeepSeek API base used for direct tokens.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	Resolve func() *typ.Provider
}

Service authenticates web tool calls with a DeepSeek token. Resolve is called on every request so a rotated or cleared token takes effect immediately.

func Direct

func Direct(token, base string) *Service

Direct builds a Service that sends every call with an explicit, user-pasted DeepSeek token. An empty token yields an unavailable Service whose calls fail with noTokenMessage rather than sending an empty Authorization header.

func FromEnv

func FromEnv(env map[string]string) *Service

FromEnv builds a Service from a web-tool connection's environment. The token is the directly entered DEEPSEEK_API_KEY shared by Search and Fetch (they are the same DeepSeek account); DEEPSEEK_BASE_URL optionally overrides the base. This is the one place the env contract lives, so callers never hard-code the variable names. An empty token still yields an unavailable Service (see Direct) so the call fails with an actionable "enter a token" error.

func (*Service) Available

func (s *Service) Available() bool

func (*Service) Call

func (s *Service) Call(ctx context.Context, operation string, payload []byte) (body []byte, status int, err error)

Call preserves the upstream status and JSON body for gateway passthrough.

func (*Service) Fetch

func (s *Service) Fetch(ctx context.Context, args map[string]any) (string, error)

Fetch runs a DeepSeek web fetch and renders model-oriented text.

func (*Service) Name

func (s *Service) Name() string

Name returns the backend name used in selection and readiness.

func (*Service) Search

func (s *Service) Search(ctx context.Context, args map[string]any) (string, error)

Search runs a DeepSeek web search and renders model-oriented text.

func (*Service) Tool

func (s *Service) Tool(ctx context.Context, operation string, args map[string]any) (string, error)

Tool maps the stable built-in MCP arguments and renders model-oriented text. ori_question is passed only when explicitly supplied, never from conversation.

Jump to

Keyboard shortcuts

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