Documentation ¶
Index ¶
- func Authentication(apiKey string, orgID string) error
- func CancelFineTune(apiKey string, fineTuneID string) error
- func CreateFineTune(apiKey string, trainingFileID string) (string, error)
- func DeleteFile(apiKey string, fileId string) error
- func DeleteFineTune(apiKey string, fineTuneID string) error
- func GetChatCompletion(apiKey string, model string, messages []ChatMessage) (string, error)
- func GetCompletion(apiKey string, model string, prompt string, maxTokens int, temperature float32) (string, error)
- func GetEdit(apiKey string, model string, input string, instruction string) (string, error)
- func GetEmbeddings(apiKey string, model string, input string) ([]float32, error)
- func GetFileContent(apiKey string, fileId string) ([]byte, error)
- func GetModeration(apiKey string, input string) (float32, error)
- type AudioTranscriptionResponse
- type AudioTranslationResponse
- type ChatMessage
- type ChatRequest
- type ChatResponse
- type CompletionRequest
- type CompletionResponse
- type EditRequest
- type EditResponse
- type EmbeddingsRequest
- type EmbeddingsResponse
- type FileResponse
- type FileUploadResponse
- type FineTune
- type FineTuneEvents
- type FineTuneList
- type FineTuneResponse
- type ImageEditRequest
- type ImageEditResponse
- type ImageGenerationRequest
- type ImageGenerationResponse
- type ImageVariationResponse
- type Logprob
- type Model
- type ModelListResponse
- type ModerationRequest
- type ModerationResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Authentication ¶
func CancelFineTune ¶ added in v1.0.8
func CreateFineTune ¶ added in v1.0.8
func DeleteFile ¶ added in v1.0.8
func DeleteFineTune ¶ added in v1.0.8
func GetChatCompletion ¶ added in v1.0.5
func GetChatCompletion(apiKey string, model string, messages []ChatMessage) (string, error)
func GetCompletion ¶
func GetEmbeddings ¶ added in v1.0.7
func GetFileContent ¶ added in v1.0.8
Types ¶
type AudioTranscriptionResponse ¶ added in v1.0.9
type AudioTranscriptionResponse struct { ID string `json:"id"` Object string `json:"object"` Text string `json:"text"` Status string `json:"status"` JobID string `json:"job_id"` JobType string `json:"job_type"` }
func TranscribeAudio ¶ added in v1.0.9
func TranscribeAudio(apiKey string, audioFilePath string, model string) (*AudioTranscriptionResponse, error)
type AudioTranslationResponse ¶ added in v1.0.9
type AudioTranslationResponse struct { ID string `json:"id"` Object string `json:"object"` Text string `json:"text"` Status string `json:"status"` JobID string `json:"job_id"` JobType string `json:"job_type"` }
func TranslateAudio ¶ added in v1.0.9
func TranslateAudio(apiKey string, audioFilePath string, model string) (*AudioTranslationResponse, error)
type ChatMessage ¶ added in v1.0.5
type ChatRequest ¶ added in v1.0.5
type ChatRequest struct { Model string `json:"model"` Messages []ChatMessage `json:"messages"` }
type ChatResponse ¶ added in v1.0.5
type CompletionRequest ¶
type CompletionRequest struct { Model string `json:"model"` Prompt string `json:"prompt"` MaxTokens int `json:"max_tokens,omitempty"` Temperature float32 `json:"temperature,omitempty"` TopP float32 `json:"top_p,omitempty"` N int `json:"n,omitempty"` Stream bool `json:"stream,omitempty"` Logprobs int `json:"logprobs,omitempty"` Echo bool `json:"echo,omitempty"` Stop []string `json:"stop,omitempty"` PresencePenalty float32 `json:"presence_penalty,omitempty"` FrequencyPenalty float32 `json:"frequency_penalty,omitempty"` BestOf int `json:"best_of,omitempty"` LogitBias map[string]interface{} `json:"logit_bias,omitempty"` }
type CompletionResponse ¶
type EditRequest ¶ added in v1.0.6
type EditResponse ¶ added in v1.0.6
type EmbeddingsRequest ¶ added in v1.0.7
type EmbeddingsResponse ¶ added in v1.0.7
type EmbeddingsResponse struct {
Data []float32 `json:"data"`
}
type FileResponse ¶ added in v1.0.8
type FileResponse struct { Object string `json:"object"` ID string `json:"id"` Purpose string `json:"purpose"` Bytes int64 `json:"bytes"` CreatedAt string `json:"created_at"` URL string `json:"url"` }
func ListFiles ¶ added in v1.0.8
func ListFiles(apiKey string) ([]FileResponse, error)
type FileUploadResponse ¶ added in v1.0.8
type FileUploadResponse struct { Object string `json:"object"` ID string `json:"id"` Purpose string `json:"purpose"` Bytes int64 `json:"bytes"` CreatedAt string `json:"created_at"` }
func UploadFile ¶ added in v1.0.8
func UploadFile(apiKey string, purpose string, filePath string) (*FileUploadResponse, error)
type FineTune ¶ added in v1.0.8
type FineTune struct { ID string `json:"id"` ModelID string `json:"model"` Status string `json:"status"` TrainingLog string `json:"training_log"` }
func GetFineTune ¶ added in v1.0.8
func ListFineTunes ¶ added in v1.0.8
type FineTuneEvents ¶ added in v1.0.8
type FineTuneEvents struct { Data []struct { Event string `json:"event"` CreatedAt int64 `json:"created_at"` Status string `json:"status"` Percentage int `json:"percentage"` } `json:"data"` }
func GetFineTuneEvents ¶ added in v1.0.8
func GetFineTuneEvents(apiKey string, fineTuneID string) (*FineTuneEvents, error)
type FineTuneList ¶ added in v1.0.8
type FineTuneList struct {
Data []FineTune `json:"data"`
}
type FineTuneResponse ¶ added in v1.0.8
type FineTuneResponse struct {
Data FineTune `json:"data"`
}
type ImageEditRequest ¶ added in v1.0.11
type ImageEditResponse ¶ added in v1.0.11
type ImageEditResponse struct { Data []struct { URL string `json:"url"` } `json:"data"` }
func EditImages ¶ added in v1.0.11
func EditImages(apiKey string, request *ImageEditRequest) (*ImageEditResponse, error)
type ImageGenerationRequest ¶ added in v1.0.10
type ImageGenerationResponse ¶ added in v1.0.10
type ImageGenerationResponse struct { ID string `json:"id"` Object string `json:"object"` CreatedAt int64 `json:"created_at"` Model string `json:"model"` Iterations int `json:"iterations"` Url string `json:"url"` }
func GenerateImages ¶ added in v1.0.10
type ImageVariationResponse ¶ added in v1.0.10
type ImageVariationResponse struct { ID string `json:"id"` Object string `json:"object"` CreatedAt int64 `json:"created_at"` Model string `json:"model"` Iterations int `json:"iterations"` Url string `json:"url"` }
func VariationsImages ¶ added in v1.0.10
type Model ¶ added in v1.0.2
type Model struct { ID string `json:"id"` Object string `json:"object"` CreatedAt int64 `json:"created"` ModelType string `json:"model_type"` Description string `json:"description"` }
func ListModels ¶
type ModelListResponse ¶ added in v1.0.3
type ModelListResponse struct {
Data []Model `json:"data"`
}
type ModerationRequest ¶ added in v1.0.7
type ModerationRequest struct {
Input string `json:"input"`
}
Click to show internal directories.
Click to hide internal directories.