deepseek

package
v1.2.49 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RoleSys  = "system"
	RoleUser = "user"
	RoleAssi = "assistant"
	RoleTool = "tool"
)
View Source
const DefaultModel = "deepseek-chat"

Variables

View Source
var Dec = safe_json.GoCCY().Unmarshal
View Source
var Enc = safe_json.GoCCY().Marshal
View Source
var ErrFrequencyPenalty = errors.New("frequency penalty not in range [-2.0, 2.0]")
View Source
var ErrMaxTokens = errors.New("max tokens not in range [1, 8192]")
View Source
var ErrMessageNoContent = errors.New("message no content")
View Source
var ErrMessageRole = errors.New("message role not in (system, user, assistant, tool)")
View Source
var ErrNoMessage = errors.New("completions request no message")
View Source
var ErrPresencePenalty = errors.New("presence penalty not in range [-2.0, 2.0]")
View Source
var ErrRespNotOK = errors.New("response is not 200OK")

Functions

This section is empty.

Types

type Balance

type Balance struct {
	IsAvailable  bool `json:"is_available"`
	BalanceInfos []struct {
		Currency        string `json:"currency"`
		TotalBalance    string `json:"total_balance"`
		GrantedBalance  string `json:"granted_balance"`
		ToppedUpBalance string `json:"topped_up_balance"`
	} `json:"balance_infos"`
}

type Client

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

func New

func New(baseUrl, apiKey string) (*Client, error)

func (*Client) Balance

func (c *Client) Balance() (resp Balance, err error)

func (*Client) Completions

func (c *Client) Completions(topic string, req CompletionsReq) (resp CompletionsResp, err error)

func (*Client) FIM

func (c *Client) FIM()

func (*Client) Models

func (c *Client) Models() (resp openai.ModelsList, err error)

type CompletionsReq

type CompletionsReq openai.ChatCompletionRequest

func NewCompletionReq

func NewCompletionReq(ques string) CompletionsReq

func (*CompletionsReq) AddMsgs

func (*CompletionsReq) AddUserMsg

func (r *CompletionsReq) AddUserMsg(ques string) *CompletionsReq

func (*CompletionsReq) Valid

func (r *CompletionsReq) Valid() error

type CompletionsResp

type CompletionsResp openai.ChatCompletionResponse

Jump to

Keyboard shortcuts

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