Versions in this module Expand all Collapse all v0 v0.0.8 Apr 2, 2024 v0.0.7 Apr 1, 2024 v0.0.6 Apr 1, 2024 v0.0.5 Apr 1, 2024 v0.0.4 Apr 1, 2024 v0.0.3 Mar 29, 2024 v0.0.2 Mar 29, 2024 Changes in this version + const AzureAPIKeyHeader + const ChatMessageRoleAssistant + const ChatMessageRoleFunction + const ChatMessageRoleSystem + const ChatMessageRoleTool + const ChatMessageRoleUser + const CodexCodeCushman001 + const CodexCodeDavinci001 + const CodexCodeDavinci002 + const CreateImageModelDallE2 + const CreateImageModelDallE3 + const CreateImageQualityHD + const CreateImageQualityStandard + const CreateImageResponseFormatB64JSON + const CreateImageResponseFormatURL + const CreateImageSize1024x1024 + const CreateImageSize1024x1792 + const CreateImageSize1792x1024 + const CreateImageSize256x256 + const CreateImageSize512x512 + const CreateImageStyleNatural + const CreateImageStyleVivid + const GPT3Ada + const GPT3Ada002 + const GPT3Babbage + const GPT3Babbage002 + const GPT3Curie + const GPT3Curie002 + const GPT3CurieInstructBeta + const GPT3Davinci + const GPT3Davinci002 + const GPT3DavinciInstructBeta + const GPT3Dot5Turbo + const GPT3Dot5Turbo0125 + const GPT3Dot5Turbo0301 + const GPT3Dot5Turbo0613 + const GPT3Dot5Turbo1106 + const GPT3Dot5Turbo16K + const GPT3Dot5Turbo16K0613 + const GPT3Dot5TurboInstruct + const GPT3TextAda001 + const GPT3TextBabbage001 + const GPT3TextCurie001 + const GPT3TextDavinci001 + const GPT3TextDavinci002 + const GPT3TextDavinci003 + const GPT4 + const GPT40314 + const GPT40613 + const GPT432K + const GPT432K0314 + const GPT432K0613 + const GPT4Turbo0125 + const GPT4Turbo1106 + const GPT4TurboPreview + const GPT4VisionPreview + const ModerationText001 + const ModerationTextLatest + const ModerationTextStable + const Whisper1 + var ErrChatCompletionInvalidModel = errors.New(...) + var ErrChatCompletionStreamNotSupported = errors.New(...) + var ErrCompletionRequestPromptTypeNotSupported = errors.New("the type of CompletionRequest.Prompt only supports string and []string") + var ErrCompletionStreamNotSupported = errors.New(...) + var ErrCompletionUnsupportedModel = errors.New(...) + var ErrContentFieldsMisused = errors.New("can't use both Content and MultiContent properties simultaneously") + var ErrInvalidSpeechModel = errors.New("invalid speech model") + var ErrInvalidVoice = errors.New("invalid voice") + var ErrModerationInvalidModel = errors.New(...) + var ErrTooManyEmptyStreamMessages = errors.New("stream has sent too many empty messages") + var ErrVectorLengthMismatch = errors.New("vector length mismatch") + type APIError struct + Code any + HTTPStatusCode int + InnerError *InnerError + Message string + Param *string + Type string + func (e *APIError) Error() string + func (e *APIError) UnmarshalJSON(data []byte) (err error) + type APIType string + const APITypeAzure + const APITypeAzureAD + const APITypeOpenAI + type Assistant struct + CreatedAt int64 + Description *string + FileIDs []string + ID string + Instructions *string + Metadata map[string]any + Model string + Name *string + Object string + Tools []AssistantTool + func (h *Assistant) GetRateLimitHeaders() RateLimitHeaders + func (h *Assistant) Header() http.Header + func (h *Assistant) SetHeader(header http.Header) + type AssistantDeleteResponse struct + Deleted bool + ID string + Object string + func (h *AssistantDeleteResponse) GetRateLimitHeaders() RateLimitHeaders + func (h *AssistantDeleteResponse) Header() http.Header + func (h *AssistantDeleteResponse) SetHeader(header http.Header) + type AssistantFile struct + AssistantID string + CreatedAt int64 + ID string + Object string + func (h *AssistantFile) GetRateLimitHeaders() RateLimitHeaders + func (h *AssistantFile) Header() http.Header + func (h *AssistantFile) SetHeader(header http.Header) + type AssistantFileRequest struct + FileID string + type AssistantFilesList struct + AssistantFiles []AssistantFile + func (h *AssistantFilesList) GetRateLimitHeaders() RateLimitHeaders + func (h *AssistantFilesList) Header() http.Header + func (h *AssistantFilesList) SetHeader(header http.Header) + type AssistantRequest struct + Description *string + FileIDs []string + Instructions *string + Metadata map[string]any + Model string + Name *string + Tools []AssistantTool + type AssistantStream struct + func (stream AssistantStream) Close() error + func (stream AssistantStream) Recv() (response T, err error) + type AssistantStreamEvent struct + AssistantID string + CancelledAt *int64 + CompletedAt *int64 + Content []MessageContent + CreatedAt int64 + Delta StreamMessageDelta + ExpiredAt *int64 + ExpiresAt int64 + FailedAt *int64 + FileIDS []string + ID string + Instructions string + LastError *RunLastError + Metadata map[string]any + Model string + Object string + RequiredAction *RunRequiredAction + Role string + RunID string + StartedAt *int64 + Status RunStatus + StepDetails StepDetails + ThreadID string + Tools []Tool + Type RunStepType + Usage Usage + type AssistantTool struct + Function *FunctionDefinition + Type AssistantToolType + type AssistantToolType string + const AssistantToolTypeCodeInterpreter + const AssistantToolTypeFunction + const AssistantToolTypeRetrieval + type AssistantsList struct + Assistants []Assistant + FirstID *string + HasMore bool + LastID *string + func (h *AssistantsList) GetRateLimitHeaders() RateLimitHeaders + func (h *AssistantsList) Header() http.Header + func (h *AssistantsList) SetHeader(header http.Header) + type AudioRequest struct + FilePath string + Format AudioResponseFormat + Language string + Model string + Prompt string + Reader io.Reader + Temperature float32 + func (r AudioRequest) HasJSONResponse() bool + type AudioResponse struct + Duration float64 + Language string + Segments []struct{ ... } + Task string + Text string + func (h *AudioResponse) GetRateLimitHeaders() RateLimitHeaders + func (h *AudioResponse) Header() http.Header + func (h *AudioResponse) SetHeader(header http.Header) + type AudioResponseFormat string + const AudioResponseFormatJSON + const AudioResponseFormatSRT + const AudioResponseFormatText + const AudioResponseFormatVTT + const AudioResponseFormatVerboseJSON + type Base64Embedding struct + Embedding base64String + Index int + Object string + type ChatCompletionChoice struct + FinishReason FinishReason + Index int + LogProbs *LogProbs + Message ChatCompletionMessage + type ChatCompletionMessage struct + Content string + FunctionCall *FunctionCall + MultiContent []ChatMessagePart + Name string + Role string + ToolCallID string + ToolCalls []ToolCall + func (m *ChatCompletionMessage) UnmarshalJSON(bs []byte) error + func (m ChatCompletionMessage) MarshalJSON() ([]byte, error) + type ChatCompletionRequest struct + FrequencyPenalty float32 + FunctionCall any + Functions []FunctionDefinition + LogProbs bool + LogitBias map[string]int + MaxTokens int + Messages []ChatCompletionMessage + Model string + N int + PresencePenalty float32 + ResponseFormat *ChatCompletionResponseFormat + Seed *int + Stop []string + Stream bool + Temperature float32 + ToolChoice any + Tools []Tool + TopLogProbs int + TopP float32 + User string + type ChatCompletionResponse struct + Choices []ChatCompletionChoice + Created int64 + ID string + Model string + Object string + SystemFingerprint string + Usage Usage + func (h *ChatCompletionResponse) GetRateLimitHeaders() RateLimitHeaders + func (h *ChatCompletionResponse) Header() http.Header + func (h *ChatCompletionResponse) SetHeader(header http.Header) + type ChatCompletionResponseFormat struct + Type ChatCompletionResponseFormatType + type ChatCompletionResponseFormatType string + const ChatCompletionResponseFormatTypeJSONObject + const ChatCompletionResponseFormatTypeText + type ChatCompletionStream struct + func (stream ChatCompletionStream) Close() error + func (stream ChatCompletionStream) Recv() (response T, err error) + type ChatCompletionStreamChoice struct + ContentFilterResults ContentFilterResults + Delta ChatCompletionStreamChoiceDelta + FinishReason FinishReason + Index int + type ChatCompletionStreamChoiceDelta struct + Content string + FunctionCall *FunctionCall + Role string + ToolCalls []ToolCall + type ChatCompletionStreamResponse struct + Choices []ChatCompletionStreamChoice + Created int64 + ID string + Model string + Object string + PromptAnnotations []PromptAnnotation + type ChatMessageImageURL struct + Detail ImageURLDetail + URL string + type ChatMessagePart struct + ImageURL *ChatMessageImageURL + Text string + Type ChatMessagePartType + type ChatMessagePartType string + const ChatMessagePartTypeImageURL + const ChatMessagePartTypeText + type Client struct + func NewClient(authToken string) *Client + func NewClientWithConfig(config ClientConfig) *Client + func NewOrgClient(authToken, org string) *Client + func (c *Client) CancelFineTune(ctx context.Context, fineTuneID string) (response FineTune, err error) + func (c *Client) CancelFineTuningJob(ctx context.Context, fineTuningJobID string) (response FineTuningJob, err error) + func (c *Client) CancelRun(ctx context.Context, threadID string, runID string) (response Run, err error) + func (c *Client) CreateAssistant(ctx context.Context, request AssistantRequest) (response Assistant, err error) + func (c *Client) CreateAssistantFile(ctx context.Context, assistantID string, request AssistantFileRequest) (response AssistantFile, err error) + func (c *Client) CreateChatCompletion(ctx context.Context, request ChatCompletionRequest) (response ChatCompletionResponse, err error) + func (c *Client) CreateChatCompletionStream(ctx context.Context, request ChatCompletionRequest) (stream *ChatCompletionStream, err error) + func (c *Client) CreateCompletion(ctx context.Context, request CompletionRequest) (response CompletionResponse, err error) + func (c *Client) CreateCompletionStream(ctx context.Context, request CompletionRequest) (stream *CompletionStream, err error) + func (c *Client) CreateEditImage(ctx context.Context, request ImageEditRequest) (response ImageResponse, err error) + func (c *Client) CreateEmbeddings(ctx context.Context, conv EmbeddingRequestConverter) (res EmbeddingResponse, err error) + func (c *Client) CreateFile(ctx context.Context, request FileRequest) (file File, err error) + func (c *Client) CreateFileBytes(ctx context.Context, request FileBytesRequest) (file File, err error) + func (c *Client) CreateFineTune(ctx context.Context, request FineTuneRequest) (response FineTune, err error) + func (c *Client) CreateFineTuningJob(ctx context.Context, request FineTuningJobRequest) (response FineTuningJob, err error) + func (c *Client) CreateImage(ctx context.Context, request ImageRequest) (response ImageResponse, err error) + func (c *Client) CreateMessage(ctx context.Context, threadID string, request MessageRequest) (msg Message, err error) + func (c *Client) CreateRun(ctx context.Context, threadID string, request RunRequest) (response Run, err error) + func (c *Client) CreateRunStreaming(ctx context.Context, threadID string, request RunRequest) (stream *AssistantStream, err error) + func (c *Client) CreateSpeech(ctx context.Context, request CreateSpeechRequest) (response io.ReadCloser, err error) + func (c *Client) CreateThread(ctx context.Context, request ThreadRequest) (response Thread, err error) + func (c *Client) CreateThreadAndRun(ctx context.Context, request CreateThreadAndRunRequest) (response Run, err error) + func (c *Client) CreateThreadAndStream(ctx context.Context, request CreateThreadAndRunRequest) (stream *AssistantStream, err error) + func (c *Client) CreateTranscription(ctx context.Context, request AudioRequest) (response AudioResponse, err error) + func (c *Client) CreateTranslation(ctx context.Context, request AudioRequest) (response AudioResponse, err error) + func (c *Client) CreateVariImage(ctx context.Context, request ImageVariRequest) (response ImageResponse, err error) + func (c *Client) DeleteAssistant(ctx context.Context, assistantID string) (response AssistantDeleteResponse, err error) + func (c *Client) DeleteAssistantFile(ctx context.Context, assistantID string, fileID string) (err error) + func (c *Client) DeleteFile(ctx context.Context, fileID string) (err error) + func (c *Client) DeleteFineTune(ctx context.Context, fineTuneID string) (response FineTuneDeleteResponse, err error) + func (c *Client) DeleteFineTuneModel(ctx context.Context, modelID string) (response FineTuneModelDeleteResponse, err error) + func (c *Client) DeleteThread(ctx context.Context, threadID string) (response ThreadDeleteResponse, err error) + func (c *Client) Edits(ctx context.Context, request EditsRequest) (response EditsResponse, err error) + func (c *Client) GetEngine(ctx context.Context, engineID string) (engine Engine, err error) + func (c *Client) GetFile(ctx context.Context, fileID string) (file File, err error) + func (c *Client) GetFileContent(ctx context.Context, fileID string) (content io.ReadCloser, err error) + func (c *Client) GetFineTune(ctx context.Context, fineTuneID string) (response FineTune, err error) + func (c *Client) GetModel(ctx context.Context, modelID string) (model Model, err error) + func (c *Client) ListAssistantFiles(ctx context.Context, assistantID string, limit *int, order *string, ...) (response AssistantFilesList, err error) + func (c *Client) ListAssistants(ctx context.Context, limit *int, order *string, after *string, before *string) (reponse AssistantsList, err error) + func (c *Client) ListEngines(ctx context.Context) (engines EnginesList, err error) + func (c *Client) ListFiles(ctx context.Context) (files FilesList, err error) + func (c *Client) ListFineTuneEvents(ctx context.Context, fineTuneID string) (response FineTuneEventList, err error) + func (c *Client) ListFineTunes(ctx context.Context) (response FineTuneList, err error) + func (c *Client) ListFineTuningJobEvents(ctx context.Context, fineTuningJobID string, ...) (response FineTuningJobEventList, err error) + func (c *Client) ListMessage(ctx context.Context, threadID string, limit *int, order *string, after *string, ...) (messages MessagesList, err error) + func (c *Client) ListMessageFiles(ctx context.Context, threadID, messageID string) (files MessageFilesList, err error) + func (c *Client) ListModels(ctx context.Context) (models ModelsList, err error) + func (c *Client) ListRunSteps(ctx context.Context, threadID string, runID string, pagination Pagination) (response RunStepList, err error) + func (c *Client) ListRuns(ctx context.Context, threadID string, pagination Pagination) (response RunList, err error) + func (c *Client) Moderations(ctx context.Context, request ModerationRequest) (response ModerationResponse, err error) + func (c *Client) ModifyAssistant(ctx context.Context, assistantID string, request AssistantRequest) (response Assistant, err error) + func (c *Client) ModifyMessage(ctx context.Context, threadID, messageID string, metadata map[string]any) (msg Message, err error) + func (c *Client) ModifyRun(ctx context.Context, threadID string, runID string, request RunModifyRequest) (response Run, err error) + func (c *Client) ModifyThread(ctx context.Context, threadID string, request ModifyThreadRequest) (response Thread, err error) + func (c *Client) RetrieveAssistant(ctx context.Context, assistantID string) (response Assistant, err error) + func (c *Client) RetrieveAssistantFile(ctx context.Context, assistantID string, fileID string) (response AssistantFile, err error) + func (c *Client) RetrieveFineTuningJob(ctx context.Context, fineTuningJobID string) (response FineTuningJob, err error) + func (c *Client) RetrieveMessage(ctx context.Context, threadID, messageID string) (msg Message, err error) + func (c *Client) RetrieveMessageFile(ctx context.Context, threadID, messageID, fileID string) (file MessageFile, err error) + func (c *Client) RetrieveRun(ctx context.Context, threadID string, runID string) (response Run, err error) + func (c *Client) RetrieveRunStep(ctx context.Context, threadID string, runID string, stepID string) (response RunStep, err error) + func (c *Client) RetrieveThread(ctx context.Context, threadID string) (response Thread, err error) + func (c *Client) SubmitToolOutputs(ctx context.Context, threadID string, runID string, ...) (response Run, err error) + func (c *Client) SubmitToolOutputsStream(ctx context.Context, threadID string, runID string, ...) (stream *AssistantStream, err error) + type ClientConfig struct + APIType APIType + APIVersion string + AzureModelMapperFunc func(model string) string + BaseURL string + EmptyMessagesLimit uint + HTTPClient *http.Client + OrgID string + func DefaultAzureConfig(apiKey, baseURL string) ClientConfig + func DefaultConfig(authToken string) ClientConfig + func (ClientConfig) String() string + func (c ClientConfig) GetAzureDeploymentByModel(model string) string + 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 any + 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 + func (h *CompletionResponse) GetRateLimitHeaders() RateLimitHeaders + func (h *CompletionResponse) Header() http.Header + func (h *CompletionResponse) SetHeader(header http.Header) + type CompletionStream struct + func (stream CompletionStream) Close() error + func (stream CompletionStream) Recv() (response T, err error) + type ContentFilterResults struct + Hate Hate + SelfHarm SelfHarm + Sexual Sexual + Violence Violence + type CreateSpeechRequest struct + Input string + Model SpeechModel + ResponseFormat SpeechResponseFormat + Speed float64 + Voice SpeechVoice + type CreateThreadAndRunRequest struct + Thread ThreadRequest + type CreateThreadAndStreamRequest struct + Stream bool + 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 + func (h *EditsResponse) GetRateLimitHeaders() RateLimitHeaders + func (h *EditsResponse) Header() http.Header + func (h *EditsResponse) SetHeader(header http.Header) + type Embedding struct + Embedding []float32 + Index int + Object string + func (e *Embedding) DotProduct(other *Embedding) (float32, error) + type EmbeddingEncodingFormat string + const EmbeddingEncodingFormatBase64 + const EmbeddingEncodingFormatFloat + type EmbeddingModel string + const AdaCodeSearchCode + const AdaCodeSearchText + const AdaEmbeddingV2 + const AdaSearchDocument + const AdaSearchQuery + const AdaSimilarity + const BabbageCodeSearchCode + const BabbageCodeSearchText + const BabbageSearchDocument + const BabbageSearchQuery + const BabbageSimilarity + const CurieSearchDocument + const CurieSearchQuery + const CurieSimilarity + const DavinciSearchDocument + const DavinciSearchQuery + const DavinciSimilarity + const LargeEmbedding3 + const SmallEmbedding3 + type EmbeddingRequest struct + Dimensions int + EncodingFormat EmbeddingEncodingFormat + Input any + Model EmbeddingModel + User string + func (r EmbeddingRequest) Convert() EmbeddingRequest + type EmbeddingRequestConverter interface + Convert func() EmbeddingRequest + type EmbeddingRequestStrings struct + Dimensions int + EncodingFormat EmbeddingEncodingFormat + Input []string + Model EmbeddingModel + User string + func (r EmbeddingRequestStrings) Convert() EmbeddingRequest + type EmbeddingRequestTokens struct + Dimensions int + EncodingFormat EmbeddingEncodingFormat + Input [][]int + Model EmbeddingModel + User string + func (r EmbeddingRequestTokens) Convert() EmbeddingRequest + type EmbeddingResponse struct + Data []Embedding + Model EmbeddingModel + Object string + Usage Usage + func (h *EmbeddingResponse) GetRateLimitHeaders() RateLimitHeaders + func (h *EmbeddingResponse) Header() http.Header + func (h *EmbeddingResponse) SetHeader(header http.Header) + type EmbeddingResponseBase64 struct + Data []Base64Embedding + Model EmbeddingModel + Object string + Usage Usage + func (h *EmbeddingResponseBase64) GetRateLimitHeaders() RateLimitHeaders + func (h *EmbeddingResponseBase64) Header() http.Header + func (h *EmbeddingResponseBase64) SetHeader(header http.Header) + func (r *EmbeddingResponseBase64) ToEmbeddingResponse() (EmbeddingResponse, error) + type Engine struct + ID string + Object string + Owner string + Ready bool + func (h *Engine) GetRateLimitHeaders() RateLimitHeaders + func (h *Engine) Header() http.Header + func (h *Engine) SetHeader(header http.Header) + type EnginesList struct + Engines []Engine + func (h *EnginesList) GetRateLimitHeaders() RateLimitHeaders + func (h *EnginesList) Header() http.Header + func (h *EnginesList) SetHeader(header http.Header) + type ErrorResponse struct + Error *APIError + type File struct + Bytes int + CreatedAt int64 + FileName string + ID string + Object string + Purpose string + Status string + StatusDetails string + func (h *File) GetRateLimitHeaders() RateLimitHeaders + func (h *File) Header() http.Header + func (h *File) SetHeader(header http.Header) + type FileBytesRequest struct + Bytes []byte + Name string + Purpose PurposeType + type FileRequest struct + FileName string + FilePath string + Purpose string + type FilesList struct + Files []File + func (h *FilesList) GetRateLimitHeaders() RateLimitHeaders + func (h *FilesList) Header() http.Header + func (h *FilesList) SetHeader(header http.Header) + type FineTune struct + CreatedAt int64 + FineTuneEventList []FineTuneEvent + FineTunedModel string + HyperParams FineTuneHyperParams + ID string + Model string + Object string + OrganizationID string + ResultFiles []File + Status string + TrainingFiles []File + UpdatedAt int64 + ValidationFiles []File + func (h *FineTune) GetRateLimitHeaders() RateLimitHeaders + func (h *FineTune) Header() http.Header + func (h *FineTune) SetHeader(header http.Header) + type FineTuneDeleteResponse struct + Deleted bool + ID string + Object string + func (h *FineTuneDeleteResponse) GetRateLimitHeaders() RateLimitHeaders + func (h *FineTuneDeleteResponse) Header() http.Header + func (h *FineTuneDeleteResponse) SetHeader(header http.Header) + type FineTuneEvent struct + CreatedAt int64 + Level string + Message string + Object string + type FineTuneEventList struct + Data []FineTuneEvent + Object string + func (h *FineTuneEventList) GetRateLimitHeaders() RateLimitHeaders + func (h *FineTuneEventList) Header() http.Header + func (h *FineTuneEventList) SetHeader(header http.Header) + type FineTuneHyperParams struct + BatchSize int + Epochs int + LearningRateMultiplier float64 + PromptLossWeight float64 + type FineTuneList struct + Data []FineTune + Object string + func (h *FineTuneList) GetRateLimitHeaders() RateLimitHeaders + func (h *FineTuneList) Header() http.Header + func (h *FineTuneList) SetHeader(header http.Header) + type FineTuneModelDeleteResponse struct + Deleted bool + ID string + Object string + func (h *FineTuneModelDeleteResponse) GetRateLimitHeaders() RateLimitHeaders + func (h *FineTuneModelDeleteResponse) Header() http.Header + func (h *FineTuneModelDeleteResponse) SetHeader(header http.Header) + type FineTuneRequest struct + BatchSize int + ClassificationBetas []float32 + ClassificationClasses int + ClassificationPositiveClass string + ComputeClassificationMetrics bool + Epochs int + LearningRateMultiplier float32 + Model string + PromptLossRate float32 + Suffix string + TrainingFile string + ValidationFile string + type FineTuningJob struct + CreatedAt int64 + FineTunedModel string + FinishedAt int64 + Hyperparameters Hyperparameters + ID string + Model string + Object string + OrganizationID string + ResultFiles []string + Status string + TrainedTokens int + TrainingFile string + ValidationFile string + func (h *FineTuningJob) GetRateLimitHeaders() RateLimitHeaders + func (h *FineTuningJob) Header() http.Header + func (h *FineTuningJob) SetHeader(header http.Header) + type FineTuningJobEvent struct + CreatedAt int + Data any + ID string + Level string + Message string + Object string + Type string + type FineTuningJobEventList struct + Data []FineTuneEvent + HasMore bool + Object string + func (h *FineTuningJobEventList) GetRateLimitHeaders() RateLimitHeaders + func (h *FineTuningJobEventList) Header() http.Header + func (h *FineTuningJobEventList) SetHeader(header http.Header) + type FineTuningJobRequest struct + Hyperparameters *Hyperparameters + Model string + Suffix string + TrainingFile string + ValidationFile string + type FinishReason string + const FinishReasonContentFilter + const FinishReasonFunctionCall + const FinishReasonLength + const FinishReasonNull + const FinishReasonStop + const FinishReasonToolCalls + func (r FinishReason) MarshalJSON() ([]byte, error) + type FunctionCall struct + Arguments string + Name string + type FunctionDefine = FunctionDefinition + type FunctionDefinition struct + Description string + Name string + Parameters any + type Hate struct + Filtered bool + Severity string + type Hyperparameters struct + Epochs any + type ImageEditRequest struct + Image *os.File + Mask *os.File + Model string + N int + Prompt string + ResponseFormat string + Size string + type ImageFile struct + FileID string + type ImageRequest struct + Model string + N int + Prompt string + Quality string + ResponseFormat string + Size string + Style string + User string + type ImageResponse struct + Created int64 + Data []ImageResponseDataInner + func (h *ImageResponse) GetRateLimitHeaders() RateLimitHeaders + func (h *ImageResponse) Header() http.Header + func (h *ImageResponse) SetHeader(header http.Header) + type ImageResponseDataInner struct + B64JSON string + RevisedPrompt string + URL string + type ImageURLDetail string + const ImageURLDetailAuto + const ImageURLDetailHigh + const ImageURLDetailLow + type ImageVariRequest struct + Image *os.File + Model string + N int + ResponseFormat string + Size string + type InnerError struct + Code string + ContentFilterResults ContentFilterResults + type ListFineTuningJobEventsParameter func(*listFineTuningJobEventsParameters) + func ListFineTuningJobEventsWithAfter(after string) ListFineTuningJobEventsParameter + func ListFineTuningJobEventsWithLimit(limit int) ListFineTuningJobEventsParameter + type LogProb struct + Bytes []byte + LogProb float64 + Token string + TopLogProbs []TopLogProbs + type LogProbs struct + Content []LogProb + type LogprobResult struct + TextOffset []int + TokenLogprobs []float32 + Tokens []string + TopLogprobs []map[string]float32 + type Message struct + AssistantID *string + Content []MessageContent + CreatedAt int + FileIds []string + ID string + Metadata map[string]any + Object string + Role string + RunID *string + ThreadID string + func (h *Message) GetRateLimitHeaders() RateLimitHeaders + func (h *Message) Header() http.Header + func (h *Message) SetHeader(header http.Header) + type MessageContent struct + ImageFile *ImageFile + Text *MessageText + Type string + type MessageFile struct + CreatedAt int + ID string + MessageID string + Object string + func (h *MessageFile) GetRateLimitHeaders() RateLimitHeaders + func (h *MessageFile) Header() http.Header + func (h *MessageFile) SetHeader(header http.Header) + type MessageFilesList struct + MessageFiles []MessageFile + func (h *MessageFilesList) GetRateLimitHeaders() RateLimitHeaders + func (h *MessageFilesList) Header() http.Header + func (h *MessageFilesList) SetHeader(header http.Header) + type MessageRequest struct + Content string + FileIds []string + Metadata map[string]any + Role string + type MessageText struct + Annotations []any + Value string + type MessagesList struct + FirstID *string + HasMore bool + LastID *string + Messages []Message + Object string + func (h *MessagesList) GetRateLimitHeaders() RateLimitHeaders + func (h *MessagesList) Header() http.Header + func (h *MessagesList) SetHeader(header http.Header) + type Model struct + CreatedAt int64 + ID string + Object string + OwnedBy string + Parent string + Permission []Permission + Root string + func (h *Model) GetRateLimitHeaders() RateLimitHeaders + func (h *Model) Header() http.Header + func (h *Model) SetHeader(header http.Header) + type ModelsList struct + Models []Model + func (h *ModelsList) GetRateLimitHeaders() RateLimitHeaders + func (h *ModelsList) Header() http.Header + func (h *ModelsList) SetHeader(header http.Header) + type ModerationRequest struct + Input string + Model string + type ModerationResponse struct + ID string + Model string + Results []Result + func (h *ModerationResponse) GetRateLimitHeaders() RateLimitHeaders + func (h *ModerationResponse) Header() http.Header + func (h *ModerationResponse) SetHeader(header http.Header) + type ModifyThreadRequest struct + Metadata map[string]any + type Pagination struct + After *string + Before *string + Limit *int + Order *string + type Permission struct + AllowCreateEngine bool + AllowFineTuning bool + AllowLogprobs bool + AllowSampling bool + AllowSearchIndices bool + AllowView bool + CreatedAt int64 + Group interface{} + ID string + IsBlocking bool + Object string + Organization string + type PromptAnnotation struct + ContentFilterResults ContentFilterResults + PromptIndex int + type PurposeType string + const PurposeAssistants + const PurposeAssistantsOutput + const PurposeFineTune + const PurposeFineTuneResults + type RateLimitHeaders struct + LimitRequests int + LimitTokens int + RemainingRequests int + RemainingTokens int + ResetRequests ResetTime + ResetTokens ResetTime + type RequestError struct + Err error + HTTPStatusCode int + func (e *RequestError) Error() string + func (e *RequestError) Unwrap() error + type RequiredActionType string + const RequiredActionTypeSubmitToolOutputs + type ResetTime string + func (r ResetTime) String() string + func (r ResetTime) Time() time.Time + type Response interface + SetHeader func(http.Header) + type Result struct + Categories ResultCategories + CategoryScores ResultCategoryScores + Flagged bool + type ResultCategories struct + Harassment bool + HarassmentThreatening bool + Hate bool + HateThreatening bool + SelfHarm bool + SelfHarmInstructions bool + SelfHarmIntent bool + Sexual bool + SexualMinors bool + Violence bool + ViolenceGraphic bool + type ResultCategoryScores struct + Harassment float32 + HarassmentThreatening float32 + Hate float32 + HateThreatening float32 + SelfHarm float32 + SelfHarmInstructions float32 + SelfHarmIntent float32 + Sexual float32 + SexualMinors float32 + Violence float32 + ViolenceGraphic float32 + type Run struct + AssistantID string + CancelledAt *int64 + CompletedAt *int64 + CreatedAt int64 + ExpiresAt int64 + FailedAt *int64 + FileIDS []string + ID string + Instructions string + LastError *RunLastError + Metadata map[string]any + Model string + Object string + RequiredAction *RunRequiredAction + StartedAt *int64 + Status RunStatus + ThreadID string + Tools []Tool + Usage Usage + func (h *Run) GetRateLimitHeaders() RateLimitHeaders + func (h *Run) Header() http.Header + func (h *Run) SetHeader(header http.Header) + type RunError string + const RunErrorRateLimitExceeded + const RunErrorServerError + type RunLastError struct + Code RunError + Message string + type RunList struct + Runs []Run + func (h *RunList) GetRateLimitHeaders() RateLimitHeaders + func (h *RunList) Header() http.Header + func (h *RunList) SetHeader(header http.Header) + type RunModifyRequest struct + Metadata map[string]any + type RunRequest struct + AdditionalInstructions string + AssistantID string + Instructions string + Metadata map[string]any + Model string + Tools []Tool + type RunRequestStreaming struct + Stream bool + type RunRequiredAction struct + SubmitToolOutputs *SubmitToolOutputs + Type RequiredActionType + type RunStatus string + const RunStatusCancelled + const RunStatusCancelling + const RunStatusCompleted + const RunStatusExpired + const RunStatusFailed + const RunStatusInProgress + const RunStatusQueued + const RunStatusRequiresAction + type RunStep struct + AssistantID string + CancelledAt *int64 + CompletedAt *int64 + CreatedAt int64 + ExpiredAt *int64 + FailedAt *int64 + ID string + LastError *RunLastError + Metadata map[string]any + Object string + RunID string + Status RunStepStatus + StepDetails StepDetails + ThreadID string + Type RunStepType + func (h *RunStep) GetRateLimitHeaders() RateLimitHeaders + func (h *RunStep) Header() http.Header + func (h *RunStep) SetHeader(header http.Header) + type RunStepList struct + FirstID string + HasMore bool + LastID string + RunSteps []RunStep + func (h *RunStepList) GetRateLimitHeaders() RateLimitHeaders + func (h *RunStepList) Header() http.Header + func (h *RunStepList) SetHeader(header http.Header) + type RunStepStatus string + const RunStepStatusCancelling + const RunStepStatusCompleted + const RunStepStatusExpired + const RunStepStatusFailed + const RunStepStatusInProgress + type RunStepType string + const RunStepTypeMessageCreation + const RunStepTypeToolCalls + type SelfHarm struct + Filtered bool + Severity string + type Sexual struct + Filtered bool + Severity string + type SpeechModel string + const TTSModel1 + const TTSModel1HD + const TTSModelCanary + type SpeechResponseFormat string + const SpeechResponseFormatAac + const SpeechResponseFormatFlac + const SpeechResponseFormatMp3 + const SpeechResponseFormatOpus + const SpeechResponseFormatPcm + const SpeechResponseFormatWav + type SpeechVoice string + const VoiceAlloy + const VoiceEcho + const VoiceFable + const VoiceNova + const VoiceOnyx + const VoiceShimmer + type StepDetails struct + MessageCreation *StepDetailsMessageCreation + ToolCalls []ToolCall + Type RunStepType + type StepDetailsMessageCreation struct + MessageID string + type StreamMessageDelta struct + Content []MessageContent + FileIDs []string + Role string + type SubmitToolOutputs struct + ToolCalls []ToolCall + type SubmitToolOutputsRequest struct + ToolOutputs []ToolOutput + type SubmitToolOutputsStreamRequest struct + Stream bool + type Thread struct + CreatedAt int64 + ID string + Metadata map[string]any + Object string + func (h *Thread) GetRateLimitHeaders() RateLimitHeaders + func (h *Thread) Header() http.Header + func (h *Thread) SetHeader(header http.Header) + type ThreadDeleteResponse struct + Deleted bool + ID string + Object string + func (h *ThreadDeleteResponse) GetRateLimitHeaders() RateLimitHeaders + func (h *ThreadDeleteResponse) Header() http.Header + func (h *ThreadDeleteResponse) SetHeader(header http.Header) + type ThreadMessage struct + Content string + FileIDs []string + Metadata map[string]any + Role ThreadMessageRole + type ThreadMessageRole string + const ThreadMessageRoleUser + type ThreadRequest struct + Messages []ThreadMessage + Metadata map[string]any + type Tool struct + Function *FunctionDefinition + Type ToolType + type ToolCall struct + Function FunctionCall + ID string + Index *int + Type ToolType + type ToolChoice struct + Function ToolFunction + Type ToolType + type ToolFunction struct + Name string + type ToolOutput struct + Output any + ToolCallID string + type ToolType string + const ToolTypeFunction + type TopLogProbs struct + Bytes []byte + LogProb float64 + Token string + type Usage struct + CompletionTokens int + PromptTokens int + TotalTokens int + type Violence struct + Filtered bool + Severity string