Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Exports = map[string]interface{}{ "TranslateToChinese": translate, "Chat": chat, "apiKey": WithAPIKey, "localAPIKey": WithAPIKeyFromYakitHome, "proxy": WithProxy, "domain": WithDomain, "yakDomain": WithYakProxy, "model": WithModel, }
Functions ¶
This section is empty.
Types ¶
type ChatChoice ¶
type ChatChoice struct { Index int `json:"index"` Message ChatDetail `json:"message"` FinishReason string `json:"finish_reason"` }
type ChatCompletion ¶
type ChatCompletion struct { ID string `json:"id"` Object string `json:"object"` Created int64 `json:"created"` Choices []ChatChoice `json:"choices"` Usage ChatUsage `json:"usage"` }
type ChatDetail ¶
type ChatMessage ¶
type ChatMessage struct { Model string `json:"model"` Messages []ChatDetail `json:"messages"` }
func NewChatMessage ¶
func NewChatMessage(model string, messages ...ChatDetail) *ChatMessage
type Client ¶
type Client struct { Proxy string APIKey string Organization string ChatModel string // Role in Org! public model, the role is user Role string Domain string // contains filtered or unexported fields }
func NewOpenAIClient ¶
func NewOpenAIClient(opt ...ConfigOption) *Client
type ConfigOption ¶
type ConfigOption func(client *Client)
func WithAPIKey ¶
func WithAPIKey(i string) ConfigOption
func WithAPIKeyFromYakitHome ¶
func WithAPIKeyFromYakitHome() ConfigOption
func WithDomain ¶
func WithDomain(i string) ConfigOption
func WithModel ¶
func WithModel(i string) ConfigOption
func WithProxy ¶
func WithProxy(i string) ConfigOption
func WithYakProxy ¶
func WithYakProxy() ConfigOption
Click to show internal directories.
Click to hide internal directories.