Documentation
¶
Overview ¶
Package deepseek provides DeepSeek-backed LLM via OpenAI-compatible API.
Index ¶
Constants ¶
View Source
const DefaultLLMModel = "deepseek-chat"
DefaultLLMModel is the default DeepSeek chat model when none is specified.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LLMService ¶
type LLMService struct {
// contains filtered or unexported fields
}
LLMService implements services.LLMService using DeepSeek's OpenAI-compatible chat API.
func NewLLMService ¶
func NewLLMService(apiKey, model string) *LLMService
NewLLMService creates a DeepSeek LLM service. If apiKey is empty, config.GetEnv("DEEPSEEK_API_KEY", "") is used. If model is empty, DefaultLLMModel is used.
func (*LLMService) Chat ¶
func (s *LLMService) Chat(ctx context.Context, messages []map[string]any, onToken func(*frames.LLMTextFrame)) error
Chat runs a completion and calls onToken for each streamed content delta (as LLMTextFrame).
Click to show internal directories.
Click to hide internal directories.