Versions in this module Expand all Collapse all v0 v0.2.2 Jun 21, 2023 v0.2.1 Jun 14, 2023 Changes in this version + const GPT3Dot5Turbo0613 + const GPT3Dot5Turbo16k + const GPT3Dot5Turbo16k0613 + const GPT40613 v0.2.0 May 10, 2023 Changes in this version + type Categories struct + Hate bool + HateThreatening bool + SelfHarm bool + Sexual bool + SexualMinors bool + Violence bool + ViolenceGraphic bool + type CategoryScores struct + Hate float64 + HateThreatening float64 + SelfHarm float64 + Sexual float64 + SexualMinors float64 + Violence float64 + ViolenceGraphic float64 type Client + func (c *Client) CancelFineTune(ctx context.Context, id string) (response FineTune, err error) + func (c *Client) CreateFineTune(ctx context.Context, request FineTuneRequest) (response FineTune, err error) + func (c *Client) CreateModeration(ctx context.Context, request ModerationRequest) (response ModerationResponse, err error) + func (c *Client) DeleteFineTuneModel(ctx context.Context, model string) (response FineTuneDeleteResponse, err error) + func (c *Client) ListFineTuneEvents(ctx context.Context, id string) (response FineTuneEventList, err error) + func (c *Client) ListFineTunes(ctx context.Context) (response FineTuneList, err error) + func (c *Client) RetrieveFineTune(ctx context.Context, id string) (response FineTune, err error) + type FineTune struct + CreatedAt int64 + Events []FineTuneEvent + FineTunedModel string + Hyperparams FineTuneHyperparams + ID string + Model string + Object string + OrganizationID string + ResultFiles []File + Status string + TrainingFiles []File + UpdatedAt int64 + ValidationFiles []File + type FineTuneDeleteResponse struct + Deleted bool + Id string + Object string + type FineTuneEvent struct + CreatedAt int64 + Level string + Message string + Object string + type FineTuneEventList struct + Data []FineTuneEvent + Object string + type FineTuneHyperparams struct + BatchSize int64 + LearningRateMultiplier float64 + NEpochs int64 + PromptLossWeight float64 + type FineTuneList struct + Data []FineTune + Object string + type FineTuneRequest struct + BatchSize int + ClassificationBetas []float32 + ClassificationNClasses int + ClassificationPositiveClass string + ComputeClassificationMetrics bool + LearningRateMultiplier float32 + Model string + NEpochs int + PromptLossWeight float32 + Suffix string + TrainingFile string + ValidationFile string + type ModerationRequest struct + Input string + Model string + type ModerationResponse struct + ID string + Model string + Results []Result + type Result struct + Categories Categories + CategoryScores CategoryScores + Flagged bool v0.1.0 May 10, 2023 Changes in this version type TranscriptionsRequest + FilePath string v0.0.3 Apr 23, 2023 v0.0.2 Apr 21, 2023 Changes in this version type Client + func NewClientWithConfig(config *ClientConfig) *Client + func (c *Client) CreateFile(ctx context.Context, request *FileRequest) (response File, err error) + func (c *Client) DeleteFile(ctx context.Context, request *File) (response File, err error) + func (c *Client) ListFiles(ctx context.Context) (response Files, err error) + func (c *Client) RetrieveFile(ctx context.Context, request *File) (response File, err error) + func (c *Client) RetrieveFileContent(ctx context.Context, request *File) (response File, err error) + type ClientConfig struct + APIKey string + HttpFielFormFactory func(body io.Writer) FormFactory + HttpRequestFactory RequestFactory + Org string + Proxy string + type File struct + Bytes int + CreatedAt int64 + Deleted bool + Filename string + Id string + Object string + Purpose string + type FileRequest struct + File string + Purpose string + type Files struct + Data []File + type FormFactory interface + Close func() error + CreateFormFile func(fieldname string, file *os.File) error + FormDataContentType func() string + WriteField func(fieldname string, value string) error v0.0.1 Apr 20, 2023 Changes in this version + const ChatMessageRoleAssistant + const ChatMessageRoleSystem + const ChatMessageRoleUser + const GPT3Ada + const GPT3Babbage + const GPT3CodeDavinciEdit001 + const GPT3Curie + const GPT3Davinci + const GPT3Dot5CodeDavinci002 + const GPT3Dot5TextDavinci002 + const GPT3Dot5TextDavinci003 + const GPT3Dot5Turbo + const GPT3Dot5Turbo0301 + const GPT3TextAda001 + const GPT3TextBabbage001 + const GPT3TextCurie001 + const GPT3TextDavincEdit001 + const GPT3Whisper1 + const GPT4 + const GPT40314 + const GPT432K + const GPT432K0314 + const TextEmbeddingAda002 + const TextModerationLatest + const TextModerationStable + const TextSearchAdaDoc001 + type APIError struct + Code string + Message string + Param string + StatusCode int + Type string + func (e *APIError) Error() string + type ChatCompletionRequset struct + FrequencyPenalty float64 + LogitBias map[string]interface{} + MaxTokens int + Messages []Message + Model string + PresencePenalty float64 + Stop string + Stream bool + Temperature float64 + TopP float64 + User string + type ChatCompletionResponse struct + Choices []Choice + Created int64 + Id string + Model string + Object string + Usage Usage + type ChatRequest struct + Content string + Tokens int + type Choice struct + FinishReason string + Index int + type Client struct + HttpClient *http.Client + func NewClient(apikey, org, proxyUrl string) *Client + func (c *Client) CreateChatCompletion(ctx context.Context, request *ChatCompletionRequset) (response ChatCompletionResponse, err error) + func (c *Client) CreateCompletion(ctx context.Context, request *CompletionRequest) (response CompletionResponse, err error) + func (c *Client) CreateEdits(ctx context.Context, request *EditsRequest) (response EditsResponse, err error) + func (c *Client) CreateEmbeddings(ctx context.Context, request *EmbeddingsRequest) (response EmbeddingsResponse, err error) + func (c *Client) CreateImage(ctx context.Context, request *ImagesReuqest) (response ImagesResponse, err error) + func (c *Client) CreateImageEdits(ctx context.Context, request *ImagesEditReuqest) (response ImagesResponse, err error) + func (c *Client) CreateImageVariation(ctx context.Context, request *ImagesVariationReuqest) (response ImagesResponse, err error) + func (c *Client) CreateTranscriptions(ctx context.Context, request *TranscriptionsRequest) (response TranscriptionsResponse, err error) + func (c *Client) CreateTranslations(ctx context.Context, request *TranscriptionsRequest) (response TranscriptionsResponse, err error) + func (c *Client) ModelInfo(ctx context.Context, name string) (model Model, err error) + func (c *Client) ModelList(ctx context.Context) (list ModelList, err error) + func (c *Client) SetFactor(factory RequestFactory) + type CompletionChoice struct + FinishReason string + Index int + LogProbs LogprobResult + Text string + type CompletionRequest struct + BestOf int + Echo bool + FrequencyPenalty float32 + LogProbs int + LogitBias map[string]int + MaxTokens int + Model string + N int + PresencePenalty float32 + Prompt interface{} + Stop []string + Stream bool + Suffix string + Temperature float32 + TopP float32 + User string + type CompletionResponse struct + Choices []CompletionChoice + Created int64 + ID string + Model string + Object string + Usage Usage + type EditsChoice struct + Index int + Text string + type EditsRequest struct + Input string + Instruction string + Model string + N int + Temperature float32 + TopP float32 + type EditsResponse struct + Choices []EditsChoice + Created int64 + Object string + Usage Usage + type Embedding struct + Embedding []float32 + Index int + Object string + type EmbeddingsRequest struct + Input interface{} + Model string + User string + type EmbeddingsResponse struct + Data []Embedding + Model string + Object string + Usage Usage + type ErrResponse struct + Err *APIError + func (e *ErrResponse) Error() string + type ImagesEditReuqest struct + Image *os.File + Mask *os.File + N int + Prompt string + ResponseFormat string + Size string + User string + type ImagesResponse struct + Created int64 + Data []ImagesResponseData + type ImagesResponseData struct + B64JSON string + URL string + type ImagesReuqest struct + N int + Prompt string + ResponseFormat string + Size string + User string + type ImagesVariationReuqest struct + Image *os.File + N int + ResponseFormat string + Size string + User string + type LogprobResult struct + TextOffset []int + TokenLogprobs []float32 + Tokens []string + TopLogprobs []map[string]float32 + type Message struct + Content string + Role string + type Model struct + Created int64 + ID string + Object string + OwnedBy string + Parent interface{} + Permission []Permission + Root string + type ModelList struct + Models []Model + type Permission struct + AllowCreateEngine bool + AllowFineTuning bool + AllowLogprobs bool + AllowSampling bool + AllowSearchIndices bool + AllowView bool + Created int64 + Group interface{} + ID string + IsBlocking bool + Object string + Organization string + type RequestError struct + Code int + Err error + func (e *RequestError) Error() string + type RequestFactory interface + Build func(ctx context.Context, method, url string, request any) (*http.Request, error) + type TranscriptionsRequest struct + File *os.File + Language string + Model string + Prompt string + ResponseFormat string + Temperature float64 + type TranscriptionsResponse struct + Text string + type Usage struct + CompletionTokens int + PromptTokens int + TotalTokens int + type WeChatCache struct + Content string + OpenID string + func (cache *WeChatCache) Key() string + type WeChatInfo struct + AppID string + Appsecret string + Token string + type WeChatMsg struct + Content string + CreateTime int64 + FromUserName string + MsgType string + ToUserName string + XMLName xml.Name + type WeChatVerify struct + Echostr string + Nonce string + Signature string + Timestamp string + func (p *WeChatVerify) Verify(token string) bool