Versions in this module Expand all Collapse all v0 v0.2.0 Mar 6, 2023 Changes in this version + type ChatCompletionRequest struct + FrequencyPenalty float64 + LogitBias map[string]int + MaxTokens int + Messages []ChatCompletionRequestMessage + Model string + N int + PresencePenalty float64 + Stop []string + Stream bool + Temperature float64 + TopP float64 + User string + type ChatCompletionRequestMessage struct + Content string + Name string + Role ChatRole + type ChatCompletionResponse struct + Choices []struct{ ... } + Created int + ID string + Model string + Object string + Usage struct{ ... } + type ChatCompletionResponseMessage struct + Content string + Role ChatRole + type ChatRole string + const ChatRoleAssistant + const ChatRoleSystem + const ChatRoleUser type Client + func (c *Client) ChatCompletion(ctx context.Context, request ChatCompletionRequest) (ChatCompletionResponse, error) + func (c *Client) Transcription(ctx context.Context, request TranscriptionRequest) (TranscriptionResponse, error) + func (c *Client) Translation(ctx context.Context, request TranslationRequest) (TranslationResponse, error) + type TranscriptionRequest struct + File formdata.File + Language string + Model string + Prompt string + ResponseFormat TranscriptionResponseFormat + Temperature float64 + type TranscriptionResponse struct + Text string + type TranscriptionResponseFormat string + const TranscriptionResponseFormatJSON + const TranscriptionResponseFormatSRT + const TranscriptionResponseFormatText + const TranscriptionResponseFormatVTT + const TranscriptionResponseFormatVerboseJSON + type TranslationRequest struct + File formdata.File + Model string + Prompt string + ResponseFormat TranslationResponseFormat + Temperature float64 + type TranslationResponse struct + Text string + type TranslationResponseFormat string + const TranslationResponseFormatJSON + const TranslationResponseFormatSRT + const TranslationResponseFormatText + const TranslationResponseFormatVTT + const TranslationResponseFormatVerboseJSON v0.1.0 Feb 13, 2023 Changes in this version + type Client struct + func NewClient(apiKey string, options ...ClientOption) *Client + func (c *Client) CancelFineTune(ctx context.Context, id string) (FineTune, error) + func (c *Client) Completion(ctx context.Context, request CompletionRequest) (CompletionResponse, error) + func (c *Client) CreateFineTune(ctx context.Context, request FineTuneRequest) (FineTune, error) + func (c *Client) DeleteFile(ctx context.Context, id string) (DeleteFileResponse, error) + func (c *Client) DeleteModel(ctx context.Context, id string) (DeleteModelResponse, error) + func (c *Client) Edit(ctx context.Context, request EditRequest) (EditResponse, error) + func (c *Client) Embedding(ctx context.Context, request EmbeddingRequest) (EmbeddingResponse, error) + func (c *Client) File(ctx context.Context, id string) (File, error) + func (c *Client) FileContent(ctx context.Context, id string) (string, error) + func (c *Client) Files(ctx context.Context) (FilesResponse, error) + func (c *Client) FineTune(ctx context.Context, id string) (FineTune, error) + func (c *Client) FineTuneEvents(ctx context.Context, id string) (FineTuneEventsResponse, error) + func (c *Client) FineTunes(ctx context.Context) (FineTunesResponse, error) + func (c *Client) Image(ctx context.Context, request ImageRequest) (ImageResponse, error) + func (c *Client) ImageEdit(ctx context.Context, request ImageEditRequest) (ImageEditResponse, error) + func (c *Client) ImageVariation(ctx context.Context, request ImageVariationRequest) (ImageVariationResponse, error) + func (c *Client) Model(ctx context.Context, id string) (Model, error) + func (c *Client) Models(ctx context.Context) (ModelsResponse, error) + func (c *Client) Moderation(ctx context.Context, request ModerationRequest) (ModerationResponse, error) + func (c *Client) UploadFile(ctx context.Context, request UploadFileRequest) (File, error) + type ClientOption func(*Client) + func WithBaseURL(baseURL string) ClientOption + func WithOrganization(organization string) ClientOption + func WithTimeout(timeout time.Duration) ClientOption + type CompletionRequest struct + BestOf int + Echo bool + FrequencyPenalty float64 + LogitBias map[string]int + Logprobs int + MaxTokens int + Model string + N int + PresencePenalty float64 + Prompt []string + Stop []string + Stream bool + Suffix string + Temperature float64 + TopP float64 + User string + type CompletionResponse struct + Choices []struct{ ... } + Created int + ID string + Model string + Object string + Usage struct{ ... } + type DeleteFileResponse struct + Deleted bool + ID string + Object string + type DeleteModelResponse struct + Deleted bool + ID string + Object string + type EditRequest struct + Input string + Instruction string + Model string + N int + Temperature float64 + TopP float64 + type EditResponse struct + Choices []struct{ ... } + Created int + ID string + Model string + Object string + Usage struct{ ... } + type EmbeddingRequest struct + Input []string + Model string + User string + type EmbeddingResponse struct + Data []struct{ ... } + Model string + Object string + Usage struct{ ... } + type Error struct + Message string + StatusCode int + Type string + func (e Error) Error() string + type File struct + Bytes int + CreatedAt int + Filename string + ID string + Object string + Purpose string + Status string + StatusDetails map[string]any + type FilesResponse struct + Data []File + Object string + type FineTune struct + CreatedAt int + Events []FineTuneEvent + FineTunedModel string + Hyperparams map[string]any + ID string + Model string + Object string + OrganizationID string + ResultFiles []File + Status string + TrainingFiles []File + UpdatedAt int + ValidationFiles []File + type FineTuneEvent struct + CreatedAt int + Level string + Message string + Object string + type FineTuneEventsResponse struct + Data []FineTuneEvent + Object string + type FineTuneRequest struct + BatchSize int + ClassificationBetas []float64 + ClassificationNClasses int + ClassificationPositiveClass string + ComputeClassificationMetrics bool + LearningRateMultiplier float64 + Model string + NEpochs int + PromptLossWeight float64 + Suffix string + TrainingFile string + ValidationFile string + type FineTunesResponse struct + Data []FineTune + Object string + type ImageEditRequest struct + Image formdata.File + Mask formdata.File + N int + Prompt string + ResponseFormat ImageResponseFormat + Size ImageSize + User string + type ImageEditResponse struct + Created int + Data []struct{ ... } + type ImageRequest struct + N int + Prompt string + ResponseFormat ImageResponseFormat + Size ImageSize + User string + type ImageResponse struct + Created int + Data []struct{ ... } + type ImageResponseFormat string + const ImageResponseFormatB64JSON + const ImageResponseFormatURL + type ImageSize string + const ImageSize1024x1024 + const ImageSize256x256 + const ImageSize512x512 + type ImageVariationRequest struct + Image formdata.File + N int + ResponseFormat ImageResponseFormat + Size ImageSize + User string + type ImageVariationResponse struct + Created int + Data []struct{ ... } + type Model struct + Created int + ID string + Object string + OwnedBy string + type ModelsResponse struct + Data []Model + Object string + type ModerationRequest struct + Input []string + Model string + type ModerationResponse struct + ID string + Model string + Results []struct{ ... } + type UploadFileRequest struct + File formdata.File + Purpose string