Documentation ¶
Index ¶
- type ChatAPI
- func (obj *ChatAPI) Ask(question string) string
- func (obj *ChatAPI) CreateChatCompletion(param CreateChatCompletionStructParam) (*CreateChatCompletionStruct, error)
- func (obj *ChatAPI) CreateImage(param CreateImageStructParam) (*CreateImageStruct, error)
- func (obj *ChatAPI) ListModels() (*ListModelsStruct, error)
- type CreateChatCompletionStruct
- type CreateChatCompletionStructParam
- type CreateImageStruct
- type CreateImageStructParam
- type ListModelsStruct
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChatAPI ¶
func NewChatAPI ¶
func (*ChatAPI) CreateChatCompletion ¶
func (obj *ChatAPI) CreateChatCompletion(param CreateChatCompletionStructParam) (*CreateChatCompletionStruct, error)
CreateChatCompletion 创建一个会话
func (*ChatAPI) CreateImage ¶
func (obj *ChatAPI) CreateImage(param CreateImageStructParam) (*CreateImageStruct, error)
CreateImage 生成一张图片
func (*ChatAPI) ListModels ¶
func (obj *ChatAPI) ListModels() (*ListModelsStruct, error)
ListModels 列出所有模型
type CreateChatCompletionStruct ¶
type CreateChatCompletionStruct struct { ID string `json:"id"` Object string `json:"object"` Created int `json:"created"` Model string `json:"model"` Usage struct { PromptTokens int `json:"prompt_tokens"` CompletionTokens int `json:"completion_tokens"` TotalTokens int `json:"total_tokens"` } `json:"usage"` Choices []struct { Message struct { Role string `json:"role"` Content string `json:"content"` } `json:"message"` FinishReason string `json:"finish_reason"` Index int `json:"index"` } `json:"choices"` }
type CreateImageStruct ¶
type CreateImageStructParam ¶
type ListModelsStruct ¶
type ListModelsStruct struct { Object string `json:"object"` Data []struct { ID string `json:"id"` Object string `json:"object"` Created int `json:"created"` OwnedBy string `json:"owned_by"` Permission []struct { ID string `json:"id"` Object string `json:"object"` Created int `json:"created"` AllowCreateEngine bool `json:"allow_create_engine"` AllowSampling bool `json:"allow_sampling"` AllowLogprobs bool `json:"allow_logprobs"` AllowSearchIndices bool `json:"allow_search_indices"` AllowView bool `json:"allow_view"` AllowFineTuning bool `json:"allow_fine_tuning"` Organization string `json:"organization"` Group interface{} `json:"group"` IsBlocking bool `json:"is_blocking"` } `json:"permission"` Root string `json:"root"` Parent interface{} `json:"parent"` } `json:"data"` }
Click to show internal directories.
Click to hide internal directories.