Documentation
¶
Overview ¶
Package deepseek implements DeepSeek's read-only web APIs.
Index ¶
- Constants
- type Service
- func (s *Service) Available() bool
- func (s *Service) Call(ctx context.Context, operation string, payload []byte) (body []byte, status int, err error)
- func (s *Service) Fetch(ctx context.Context, args map[string]any) (string, error)
- func (s *Service) Name() string
- func (s *Service) Search(ctx context.Context, args map[string]any) (string, error)
- func (s *Service) Tool(ctx context.Context, operation string, args map[string]any) (string, error)
Constants ¶
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 ¶
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 ¶
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 ¶
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) 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.