Versions in this module Expand all Collapse all v1 v1.0.3 Feb 7, 2025 v1.0.2 Feb 7, 2025 Changes in this version type ChatCompletionMessage + ReasoningContent string type ChatCompletionStreamChoiceDelta + ReasoningContent string v1.0.1 Feb 5, 2025 Changes in this version type APIType + const APITypeOllama v1.0.0 Feb 5, 2025 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 GPT4Turbo + const GPT4Turbo0125 + const GPT4Turbo1106 + const GPT4Turbo20240409 + const GPT4TurboPreview + const GPT4VisionPreview + const GPT4o + const GPT4o20240513 + const GPT4o20240806 + const GPT4o20241120 + const GPT4oLatest + const GPT4oMini + const GPT4oMini20240718 + const ModerationOmni20240926 + const ModerationOmniLatest + const ModerationText001 + const ModerationTextLatest + const ModerationTextStable + const O1 + const O120241217 + const O1Mini + const O1Mini20240912 + const O1Preview + const O1Preview20240912 + const TruncationStrategyAuto + const TruncationStrategyLastMessages + 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 ErrModerationInvalidModel = errors.New(...) + var ErrO1BetaLimitationsLogprobs = errors.New("this model has beta-limitations, logprobs not supported") + var ErrO1BetaLimitationsMessageTypes = errors.New(...) + var ErrO1BetaLimitationsOther = errors.New(...) + var ErrO1BetaLimitationsTools = errors.New(...) + var ErrO1MaxTokensDeprecated = errors.New("this model is not supported MaxTokens, please use MaxCompletionTokens") + var ErrTooManyEmptyStreamMessages = errors.New("stream has sent too many empty messages") + var ErrVectorLengthMismatch = errors.New("vector length mismatch") + var O1SeriesModels = map[string]struct + type APIError struct + Code any + HTTPStatus string + 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 APITypeCloudflareAzure + 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 + ResponseFormat any + Temperature *float32 + ToolResources *AssistantToolResource + Tools []AssistantTool + TopP *float32 + 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 + ResponseFormat any + Temperature *float32 + ToolResources *AssistantToolResource + Tools []AssistantTool + TopP *float32 + func (a AssistantRequest) MarshalJSON() ([]byte, error) + type AssistantTool struct + Function *FunctionDefinition + Type AssistantToolType + type AssistantToolCodeInterpreter struct + FileIDs []string + type AssistantToolFileSearch struct + VectorStoreIDs []string + type AssistantToolResource struct + CodeInterpreter *AssistantToolCodeInterpreter + FileSearch *AssistantToolFileSearch + type AssistantToolType string + const AssistantToolTypeCodeInterpreter + const AssistantToolTypeFileSearch + 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 + TimestampGranularities []TranscriptionTimestampGranularity + func (r AudioRequest) HasJSONResponse() bool + type AudioResponse struct + Duration float64 + Language string + Segments []struct{ ... } + Task string + Text string + Words []struct{ ... } + 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 Batch struct + CancelledAt *int + CancellingAt *int + CompletedAt *int + CompletionWindow string + CreatedAt int + Endpoint BatchEndpoint + ErrorFileID *string + Errors ... + ExpiredAt *int + ExpiresAt *int + FailedAt *int + FinalizingAt *int + ID string + InProgressAt *int + InputFileID string + Metadata map[string]any + Object string + OutputFileID *string + RequestCounts BatchRequestCounts + Status string + type BatchChatCompletionRequest struct + Body ChatCompletionRequest + CustomID string + Method string + URL BatchEndpoint + func (r BatchChatCompletionRequest) MarshalBatchLineItem() []byte + type BatchCompletionRequest struct + Body CompletionRequest + CustomID string + Method string + URL BatchEndpoint + func (r BatchCompletionRequest) MarshalBatchLineItem() []byte + type BatchEmbeddingRequest struct + Body EmbeddingRequest + CustomID string + Method string + URL BatchEndpoint + func (r BatchEmbeddingRequest) MarshalBatchLineItem() []byte + type BatchEndpoint string + const BatchEndpointChatCompletions + const BatchEndpointCompletions + const BatchEndpointEmbeddings + type BatchLineItem interface + MarshalBatchLineItem func() []byte + type BatchRequestCounts struct + Completed int + Failed int + Total int + type BatchResponse struct + func (h *BatchResponse) GetRateLimitHeaders() RateLimitHeaders + func (h *BatchResponse) Header() http.Header + func (h *BatchResponse) SetHeader(header http.Header) + type ChatCompletionChoice struct + ContentFilterResults ContentFilterResults + FinishReason FinishReason + Index int + LogProbs *LogProbs + Message ChatCompletionMessage + type ChatCompletionMessage struct + Content string + FunctionCall *FunctionCall + MultiContent []ChatMessagePart + Name string + Refusal 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 + MaxCompletionTokens int + MaxTokens int + Messages []ChatCompletionMessage + Metadata map[string]string + Model string + N int + ParallelToolCalls any + PresencePenalty float32 + ReasoningEffort string + ResponseFormat *ChatCompletionResponseFormat + Seed *int + Stop []string + Store bool + Stream bool + StreamOptions *StreamOptions + 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 + PromptFilterResults []PromptFilterResult + 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 + JSONSchema *ChatCompletionResponseFormatJSONSchema + Type ChatCompletionResponseFormatType + type ChatCompletionResponseFormatJSONSchema struct + Description string + Name string + Schema json.Marshaler + Strict bool + type ChatCompletionResponseFormatType string + const ChatCompletionResponseFormatTypeJSONObject + const ChatCompletionResponseFormatTypeJSONSchema + const ChatCompletionResponseFormatTypeText + type ChatCompletionStream struct + func (stream ChatCompletionStream) Close() error + func (stream ChatCompletionStream) Recv() (response T, err error) + func (stream ChatCompletionStream) RecvRaw() ([]byte, error) + type ChatCompletionStreamChoice struct + ContentFilterResults ContentFilterResults + Delta ChatCompletionStreamChoiceDelta + FinishReason FinishReason + Index int + Logprobs *ChatCompletionStreamChoiceLogprobs + type ChatCompletionStreamChoiceDelta struct + Content string + FunctionCall *FunctionCall + Refusal string + Role string + ToolCalls []ToolCall + type ChatCompletionStreamChoiceLogprobs struct + Content []ChatCompletionTokenLogprob + Refusal []ChatCompletionTokenLogprob + type ChatCompletionStreamResponse struct + Choices []ChatCompletionStreamChoice + Created int64 + ID string + Model string + Object string + PromptAnnotations []PromptAnnotation + PromptFilterResults []PromptFilterResult + SystemFingerprint string + Usage *Usage + type ChatCompletionTokenLogprob struct + Bytes []int64 + Logprob float64 + Token string + TopLogprobs []ChatCompletionTokenLogprobTopLogprob + type ChatCompletionTokenLogprobTopLogprob struct + Bytes []int64 + Logprob float64 + Token string + type ChatMessageImageURL struct + Detail ImageURLDetail + URL string + type ChatMessagePart struct + ImageURL *ChatMessageImageURL + Text string + Type ChatMessagePartType + type ChatMessagePartType string + const ChatMessagePartTypeImageURL + const ChatMessagePartTypeText + type ChunkingStrategy struct + Static *StaticChunkingStrategy + Type ChunkingStrategyType + type ChunkingStrategyType string + const ChunkingStrategyTypeAuto + const ChunkingStrategyTypeStatic + type Client struct + func NewClient(authToken string) *Client + func NewClientWithConfig(config ClientConfig) *Client + func NewOrgClient(authToken, org string) *Client + func (c *Client) CancelBatch(ctx context.Context, batchID string) (response BatchResponse, err error) + 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) CancelVectorStoreFileBatch(ctx context.Context, vectorStoreID string, batchID string) (response VectorStoreFileBatch, 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) CreateBatch(ctx context.Context, request CreateBatchRequest) (response BatchResponse, err error) + func (c *Client) CreateBatchWithUploadFile(ctx context.Context, request CreateBatchWithUploadFileRequest) (response BatchResponse, 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) CreateSpeech(ctx context.Context, request CreateSpeechRequest) (response RawResponse, 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) 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) CreateVectorStore(ctx context.Context, request VectorStoreRequest) (response VectorStore, err error) + func (c *Client) CreateVectorStoreFile(ctx context.Context, vectorStoreID string, request VectorStoreFileRequest) (response VectorStoreFile, err error) + func (c *Client) CreateVectorStoreFileBatch(ctx context.Context, vectorStoreID string, request VectorStoreFileBatchRequest) (response VectorStoreFileBatch, 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) DeleteMessage(ctx context.Context, threadID, messageID string) (status MessageDeletionStatus, err error) + func (c *Client) DeleteThread(ctx context.Context, threadID string) (response ThreadDeleteResponse, err error) + func (c *Client) DeleteVectorStore(ctx context.Context, vectorStoreID string) (response VectorStoreDeleteResponse, err error) + func (c *Client) DeleteVectorStoreFile(ctx context.Context, vectorStoreID string, fileID string) (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 RawResponse, 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) (response AssistantsList, err error) + func (c *Client) ListBatch(ctx context.Context, after *string, limit *int) (response ListBatchResponse, 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) ListVectorStoreFiles(ctx context.Context, vectorStoreID string, pagination Pagination) (response VectorStoreFilesList, err error) + func (c *Client) ListVectorStoreFilesInBatch(ctx context.Context, vectorStoreID string, batchID string, ...) (response VectorStoreFilesList, err error) + func (c *Client) ListVectorStores(ctx context.Context, pagination Pagination) (response VectorStoresList, 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]string) (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) ModifyVectorStore(ctx context.Context, vectorStoreID string, request VectorStoreRequest) (response VectorStore, 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) RetrieveBatch(ctx context.Context, batchID string) (response BatchResponse, 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) RetrieveVectorStore(ctx context.Context, vectorStoreID string) (response VectorStore, err error) + func (c *Client) RetrieveVectorStoreFile(ctx context.Context, vectorStoreID string, fileID string) (response VectorStoreFile, err error) + func (c *Client) RetrieveVectorStoreFileBatch(ctx context.Context, vectorStoreID string, batchID string) (response VectorStoreFileBatch, err error) + func (c *Client) SubmitToolOutputs(ctx context.Context, threadID string, runID string, ...) (response Run, err error) + func (c *Client) UploadBatchFile(ctx context.Context, request UploadBatchFileRequest) (File, error) + type ClientConfig struct + APIType APIType + APIVersion string + AssistantVersion string + AzureModelMapperFunc func(model string) string + BaseURL string + EmptyMessagesLimit uint + HTTPClient HTTPDoer + 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 CodeInterpreterToolResources struct + FileIDs []string + type CodeInterpreterToolResourcesRequest struct + FileIDs []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 + Metadata map[string]string + Model string + N int + PresencePenalty float32 + Prompt any + Seed *int + Stop []string + Store bool + 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) + func (stream CompletionStream) RecvRaw() ([]byte, error) + type CompletionTokensDetails struct + AudioTokens int + ReasoningTokens int + type ContentFilterResults struct + Hate Hate + JailBreak JailBreak + Profanity Profanity + SelfHarm SelfHarm + Sexual Sexual + Violence Violence + type CreateBatchRequest struct + CompletionWindow string + Endpoint BatchEndpoint + InputFileID string + Metadata map[string]any + type CreateBatchWithUploadFileRequest struct + CompletionWindow string + Endpoint BatchEndpoint + Metadata map[string]any + type CreateSpeechRequest struct + Input string + Model SpeechModel + ResponseFormat SpeechResponseFormat + Speed float64 + Voice SpeechVoice + type CreateThreadAndRunRequest struct + Thread ThreadRequest + 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 FileSearchToolResources struct + VectorStoreIDs []string + type FileSearchToolResourcesRequest struct + VectorStoreIDs []string + VectorStores []VectorStoreToolResources + 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 + Strict bool + type HTTPDoer interface + Do func(req *http.Request) (*http.Response, error) + type Hate struct + Filtered bool + Severity string + type Hyperparameters struct + BatchSize any + Epochs any + LearningRateMultiplier 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 JailBreak struct + Detected bool + Filtered bool + type ListBatchResponse struct + Data []Batch + FirstID string + HasMore bool + LastID string + Object string + func (h *ListBatchResponse) GetRateLimitHeaders() RateLimitHeaders + func (h *ListBatchResponse) Header() http.Header + func (h *ListBatchResponse) SetHeader(header http.Header) + 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 MessageDeletionStatus struct + Deleted bool + ID string + Object string + func (h *MessageDeletionStatus) GetRateLimitHeaders() RateLimitHeaders + func (h *MessageDeletionStatus) Header() http.Header + func (h *MessageDeletionStatus) SetHeader(header http.Header) + 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 + Attachments []ThreadAttachment + 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 + ToolResources *ToolResources + 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 Profanity struct + Detected bool + Filtered bool + type PromptAnnotation struct + ContentFilterResults ContentFilterResults + PromptIndex int + type PromptFilterResult struct + ContentFilterResults ContentFilterResults + Index int + type PromptTokensDetails struct + AudioTokens int + CachedTokens int + type PurposeType string + const PurposeAssistants + const PurposeAssistantsOutput + const PurposeBatch + const PurposeFineTune + const PurposeFineTuneResults + type RateLimitHeaders struct + LimitRequests int + LimitTokens int + RemainingRequests int + RemainingTokens int + ResetRequests ResetTime + ResetTokens ResetTime + type RawResponse struct + func (h *RawResponse) GetRateLimitHeaders() RateLimitHeaders + func (h *RawResponse) Header() http.Header + func (h *RawResponse) SetHeader(header http.Header) + type ReponseFormat struct + Type string + type RequestError struct + Body []byte + Err error + HTTPStatus string + 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 + MaxCompletionTokens int + MaxPromptTokens int + Metadata map[string]any + Model string + Object string + RequiredAction *RunRequiredAction + StartedAt *int64 + Status RunStatus + Temperature *float32 + ThreadID string + Tools []Tool + TruncationStrategy *ThreadTruncationStrategy + 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 + AdditionalMessages []ThreadMessage + AssistantID string + Instructions string + MaxCompletionTokens int + MaxPromptTokens int + Metadata map[string]any + Model string + ParallelToolCalls any + ResponseFormat any + Temperature *float32 + ToolChoice any + Tools []Tool + TopP *float32 + TruncationStrategy *ThreadTruncationStrategy + type RunRequiredAction struct + SubmitToolOutputs *SubmitToolOutputs + Type RequiredActionType + type RunStatus string + const RunStatusCancelled + const RunStatusCancelling + const RunStatusCompleted + const RunStatusExpired + const RunStatusFailed + const RunStatusInProgress + const RunStatusIncomplete + 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 StaticChunkingStrategy struct + ChunkOverlapTokens int + MaxChunkSizeTokens int + type StepDetails struct + MessageCreation *StepDetailsMessageCreation + ToolCalls []ToolCall + Type RunStepType + type StepDetailsMessageCreation struct + MessageID string + type StreamOptions struct + IncludeUsage bool + type SubmitToolOutputs struct + ToolCalls []ToolCall + type SubmitToolOutputsRequest struct + ToolOutputs []ToolOutput + type Thread struct + CreatedAt int64 + ID string + Metadata map[string]any + Object string + ToolResources ToolResources + func (h *Thread) GetRateLimitHeaders() RateLimitHeaders + func (h *Thread) Header() http.Header + func (h *Thread) SetHeader(header http.Header) + type ThreadAttachment struct + FileID string + Tools []ThreadAttachmentTool + type ThreadAttachmentTool struct + Type string + 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 + Attachments []ThreadAttachment + Content string + FileIDs []string + Metadata map[string]any + Role ThreadMessageRole + type ThreadMessageRole string + const ThreadMessageRoleAssistant + const ThreadMessageRoleUser + type ThreadRequest struct + Messages []ThreadMessage + Metadata map[string]any + ToolResources *ToolResourcesRequest + type ThreadTruncationStrategy struct + LastMessages *int + Type TruncationStrategy + 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 ToolResources struct + CodeInterpreter *CodeInterpreterToolResources + FileSearch *FileSearchToolResources + type ToolResourcesRequest struct + CodeInterpreter *CodeInterpreterToolResourcesRequest + FileSearch *FileSearchToolResourcesRequest + type ToolType string + const ToolTypeFunction + type TopLogProbs struct + Bytes []byte + LogProb float64 + Token string + type TranscriptionTimestampGranularity string + const TranscriptionTimestampGranularitySegment + const TranscriptionTimestampGranularityWord + type TruncationStrategy string + type UploadBatchFileRequest struct + FileName string + Lines []BatchLineItem + func (r *UploadBatchFileRequest) AddChatCompletion(customerID string, body ChatCompletionRequest) + func (r *UploadBatchFileRequest) AddCompletion(customerID string, body CompletionRequest) + func (r *UploadBatchFileRequest) AddEmbedding(customerID string, body EmbeddingRequest) + func (r *UploadBatchFileRequest) MarshalJSONL() []byte + type Usage struct + CompletionTokens int + CompletionTokensDetails *CompletionTokensDetails + PromptTokens int + PromptTokensDetails *PromptTokensDetails + TotalTokens int + type VectorStore struct + CreatedAt int64 + ExpiresAfter *VectorStoreExpires + ExpiresAt *int + FileCounts VectorStoreFileCount + ID string + Metadata map[string]any + Name string + Object string + Status string + UsageBytes int + func (h *VectorStore) GetRateLimitHeaders() RateLimitHeaders + func (h *VectorStore) Header() http.Header + func (h *VectorStore) SetHeader(header http.Header) + type VectorStoreDeleteResponse struct + Deleted bool + ID string + Object string + func (h *VectorStoreDeleteResponse) GetRateLimitHeaders() RateLimitHeaders + func (h *VectorStoreDeleteResponse) Header() http.Header + func (h *VectorStoreDeleteResponse) SetHeader(header http.Header) + type VectorStoreExpires struct + Anchor string + Days int + type VectorStoreFile struct + CreatedAt int64 + ID string + Object string + Status string + UsageBytes int + VectorStoreID string + func (h *VectorStoreFile) GetRateLimitHeaders() RateLimitHeaders + func (h *VectorStoreFile) Header() http.Header + func (h *VectorStoreFile) SetHeader(header http.Header) + type VectorStoreFileBatch struct + CreatedAt int64 + FileCounts VectorStoreFileCount + ID string + Object string + Status string + VectorStoreID string + func (h *VectorStoreFileBatch) GetRateLimitHeaders() RateLimitHeaders + func (h *VectorStoreFileBatch) Header() http.Header + func (h *VectorStoreFileBatch) SetHeader(header http.Header) + type VectorStoreFileBatchRequest struct + FileIDs []string + type VectorStoreFileCount struct + Cancelled int + Completed int + Failed int + InProgress int + Total int + type VectorStoreFileRequest struct + FileID string + type VectorStoreFilesList struct + FirstID *string + HasMore bool + LastID *string + VectorStoreFiles []VectorStoreFile + func (h *VectorStoreFilesList) GetRateLimitHeaders() RateLimitHeaders + func (h *VectorStoreFilesList) Header() http.Header + func (h *VectorStoreFilesList) SetHeader(header http.Header) + type VectorStoreRequest struct + ExpiresAfter *VectorStoreExpires + FileIDs []string + Metadata map[string]any + Name string + type VectorStoreToolResources struct + ChunkingStrategy *ChunkingStrategy + FileIDs []string + Metadata map[string]any + type VectorStoresList struct + FirstID *string + HasMore bool + LastID *string + VectorStores []VectorStore + func (h *VectorStoresList) GetRateLimitHeaders() RateLimitHeaders + func (h *VectorStoresList) Header() http.Header + func (h *VectorStoresList) SetHeader(header http.Header) + type Violence struct + Filtered bool + Severity string