Documentation
¶
Overview ¶
deepseek implements an API client for Deepseek's LLM https://api-docs.deepseek.com/
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
*client.Client
*impl.ModelCache
}
func (*Client) ListModels ¶
ListModels returns all the models
type Completion ¶
type Completion struct {
Index uint64 `json:"index"`
Message *Message `json:"message"`
Delta *Message `json:"delta,omitempty"` // For streaming
Reason string `json:"finish_reason,omitempty"`
}
Completion Variation
func (Completion) String ¶
func (c Completion) String() string
type Completions ¶
type Completions []Completion
Completion choices
func (Completions) Attachment ¶
func (c Completions) Attachment(index int) *llm.Attachment
Return attachment content for a specific completion
func (Completions) Choice ¶
func (c Completions) Choice(index int) llm.Completion
Return message for a specific completion
func (Completions) Text ¶
func (c Completions) Text(index int) string
Return the text content for a specific completion
type Message ¶
type Message struct {
RoleContent
}
Message with text or object content
func (*Message) Attachment ¶
func (message *Message) Attachment(index int) *llm.Attachment
No attachments
func (*Message) Choice ¶
func (message *Message) Choice(index int) llm.Completion
Return the completion
type Metrics ¶
type Metrics struct {
PromptTokens uint64 `json:"prompt_tokens,omitempty"`
CompletionTokens uint64 `json:"completion_tokens,omitempty"`
TotalTokens uint64 `json:"total_tokens,omitempty"`
PromptTokenDetails struct {
CachedTokens uint64 `json:"cached_tokens,omitempty"`
AudioTokens uint64 `json:"audio_tokens,omitempty"`
} `json:"prompt_tokens_details,omitempty"`
CompletionTokenDetails struct {
ReasoningTokens uint64 `json:"reasoning_tokens,omitempty"`
AcceptedPredictionTokens uint64 `json:"accepted_prediction_tokens,omitempty"`
RejectedPredictionTokens uint64 `json:"rejected_prediction_tokens,omitempty"`
} `json:"completion_tokens_details,omitempty"`
}
Metrics
type Response ¶
type Response struct {
Id string `json:"id"`
Type string `json:"object"`
Created uint64 `json:"created"`
Model string `json:"model"`
SystemFingerprint string `json:"system_fingerprint"`
ServiceTier string `json:"service_tier"`
Completions `json:"choices"`
*Metrics `json:"usage,omitempty"`
}
Completion Response
type RoleContent ¶
Click to show internal directories.
Click to hide internal directories.