Versions in this module Expand all Collapse all v0 v0.0.3 Mar 13, 2025 v0.0.2 Mar 13, 2025 Changes in this version type Client + Embedding *EmbeddingService + func (c *Client) AuthHeader() string + func (c *Client) FormUrl(path string) string + type Dimensions struct + DPI int + Height int + Width int + type DocumentUrlResponse struct + Url string type EmbeddingResponse + Id string + type EmbeddingService struct + func (s *EmbeddingService) Create(request *EmbeddingRequest) (*EmbeddingResponse, error) + type EmbeddingUsage struct + CompletionTokens int + PromptTokens int + TotalTokens int + type FileType string + const FileTypeImage + const FileTypePDF + type FileUploadRequest struct + File *os.File + Purpose string + Type FileType + type FileUploadResponse struct + Bytes int + CreatedAt int64 + Filename string + ID string + NumLines *int + Object string + Purpose string + SampleType string + Source string type FilesService + func (s *FilesService) GetDocumentUrl(id string, expiry int) (*DocumentUrlResponse, error) + func (s *FilesService) GetFiles(getFilesRequest *GetFilesRequest) (*GetFilesResponse, error) + type GetFilesRequest struct + Page int + PageSize int + Purpose string + SampleType []SampleType + Search string + Source string + type GetFilesResponse struct + Data []map[string]interface{} + Object string + Total int + type OCRImage struct + BottomRightX int + BottomRightY int + ID int + ImageBase64 string + TopLeftX int + TopLeftY int + type OCRPage struct + Dimensions Dimensions + Images []OCRImage + Index int + Markdown string type OCRRequest + Document OCRRequestModel + ID string + ImageLimit int + ImageMinSize int + IncludeImageBase64 bool + Pages []int + type OCRRequestModel struct + DocumentName string + DocumentURL string + ImageURL string + Type string type OCRResponse + Pages []OCRPage type OCRService + func (s *OCRService) Process(request *OCRRequest) (*OCRResponse, error) + type OCRUsage struct + DocSizeBytes int + PagesProcessed int + type SampleType string + const SampleTypeBatchError + const SampleTypeBatchRequest + const SampleTypeBatchResult + const SampleTypeInstruct + const SampleTypeOCRInput + const SampleTypePretrain v0.0.1 Mar 13, 2025 Changes in this version + type AgentAction struct + Input map[string]interface{} + Response string + Thought string + Tool string + type AgentFunction struct + Description string + Name string + Parameters map[string]interface{} + type AgentRequest struct + MaxActions *int + MaxTokens *int + Messages []Message + Model string + Stop []string + Stream bool + Temperature *float32 + Tools []AgentTool + TopP *float32 + type AgentResponse struct + Actions []AgentAction + Created int64 + ID string + Messages []Message + Model string + Object string + Usage UsageInfo + type AgentService struct + func (s *AgentService) Create(ctx context.Context, request *AgentRequest) (*AgentResponse, error) + func (s *AgentService) CreateStream(ctx context.Context, request *AgentRequest) (*AgentStream, error) + type AgentStream struct + func (s *AgentStream) Close() error + func (s *AgentStream) Recv() (*AgentResponse, error) + type AgentTool struct + Function AgentFunction + Type string + type BatchOptions struct + ChunkSize int + MaxConcurrency int + RetryConfig *Retry + Timeout int + type BatchRequest struct + Model string + Options BatchOptions + Requests []interface{} + type BatchResponse struct + Created int64 + ID string + Model string + Object string + Results []BatchResult + Summary BatchSummary + type BatchResult struct + Attempts int + Duration int + Error string + Index int + Response interface{} + Status string + type BatchService struct + func (s *BatchService) Cancel(ctx context.Context, batchID string) error + func (s *BatchService) Create(ctx context.Context, request *BatchRequest) (*BatchResponse, error) + func (s *BatchService) CreateChat(ctx context.Context, requests []*ChatCompletionRequest, options *BatchOptions) (*BatchResponse, error) + func (s *BatchService) CreateEmbeddings(ctx context.Context, texts []string, model string, options *BatchOptions) (*BatchResponse, error) + func (s *BatchService) Get(ctx context.Context, batchID string) (*BatchResponse, error) + func (s *BatchService) WaitForCompletion(ctx context.Context, batchID string) (*BatchResponse, error) + type BatchSummary struct + AverageDuration int + Failed int + Succeeded int + TokensUsed int + TotalCost float32 + TotalDuration int + TotalRequests int + type BoundingBox struct + Height float32 + Width float32 + X float32 + Y float32 + type ChatCompletionChoice struct + FinishReason string + Index int + Message Message + type ChatCompletionRequest struct + MaxTokens *int + Messages []Message + Model string + RandomSeed *int + ResponseFormat *string + Stop []string + Stream bool + Temperature *float32 + ToolChoice *string + Tools []Tool + TopP *float32 + type ChatCompletionResponse struct + Choices []ChatCompletionChoice + Created int64 + ID string + Model string + Object string + Usage UsageInfo + type ChatCompletionStream struct + func (s *ChatCompletionStream) Close() error + func (s *ChatCompletionStream) Recv() (*ChatCompletionResponse, error) + type ChatService struct + func (s *ChatService) Create(ctx context.Context, request *ChatCompletionRequest) (*ChatCompletionResponse, error) + func (s *ChatService) CreateStream(ctx context.Context, request *ChatCompletionRequest) (*ChatCompletionStream, error) + type ClassifierRequest struct + Input []string + Labels []string + Model string + MultiLabel bool + Temperature *float32 + type ClassifierResponse struct + Created int64 + ID string + Model string + Object string + Results []ClassifierResult + Usage UsageInfo + type ClassifierResult struct + Confidence float32 + Input string + Labels []string + Scores map[string]float32 + type ClassifiersService struct + func (s *ClassifiersService) Batch(ctx context.Context, texts []string, labels []string, model string) (*ClassifierResponse, error) + func (s *ClassifiersService) Confidence(ctx context.Context, text string, labels []string, model string) (map[string]float32, error) + func (s *ClassifiersService) Create(ctx context.Context, request *ClassifierRequest) (*ClassifierResponse, error) + func (s *ClassifiersService) MultiLabel(ctx context.Context, request *ClassifierRequest) (*ClassifierResponse, error) + type Client struct + Agents *AgentService + Batch *BatchService + Chat *ChatService + Classifiers *ClassifiersService + Embeddings *EmbeddingsService + FIM *FIMService + Files *FilesService + FineTuning *FineTuningService + Models *ModelsService + Moderations *ModerationsService + OCR *OCRService + UserAgent string + func NewClient(apiKey string, opts ...ClientOption) (*Client, error) + type ClientOption func(*Client) error + func WithBaseURL(baseURL string) ClientOption + func WithHTTPClient(httpClient *http.Client) ClientOption + type EmbeddingData struct + Embedding []float32 + Index int + Object string + type EmbeddingMetadata struct + Dimensions int + Similarity string + Truncated []bool + type EmbeddingRequest struct + Input []string + Model string + type EmbeddingResponse struct + Data []EmbeddingData + Model string + Object string + Usage UsageInfo + type EmbeddingsService struct + func (s *EmbeddingsService) Batch(ctx context.Context, texts []string, model string, batchSize int) ([][]float32, error) + func (s *EmbeddingsService) Create(ctx context.Context, request *EmbeddingRequest) (*EmbeddingResponse, error) + func (s *EmbeddingsService) CreateEnhanced(ctx context.Context, request *EnhancedEmbeddingRequest) (*EnhancedEmbeddingResponse, error) + func (s *EmbeddingsService) Similarity(ctx context.Context, text1, text2 string, model string) (float32, error) + type EnhancedEmbeddingRequest struct + EncodingFormat string + Input []string + Model string + Normalize bool + Truncate bool + type EnhancedEmbeddingResponse struct + Data []EmbeddingData + Metadata EmbeddingMetadata + Model string + Object string + Usage UsageInfo + type EnhancedModel struct + Capabilities []ModelCapability + Description string + MaxTokens int + Performance []ModelPerformance + TokenCosts struct{ ... } + Version string + type Error struct + Message string + Response *http.Response + func (e *Error) Error() string + type FIMChoice struct + FinishReason string + Index int + Text string + type FIMRequest struct + MaxTokens *int + Model string + Prefix string + Stop []string + Stream bool + Suffix string + Temperature *float32 + TopP *float32 + type FIMResponse struct + Choices []FIMChoice + Created int64 + ID string + Model string + Object string + Usage UsageInfo + type FIMService struct + func (s *FIMService) Create(ctx context.Context, request *FIMRequest) (*FIMResponse, error) + func (s *FIMService) CreateStream(ctx context.Context, request *FIMRequest) (*FIMStream, error) + type FIMStream struct + func (s *FIMStream) Close() error + func (s *FIMStream) Recv() (*FIMResponse, error) + type File struct + Bytes int64 + CreatedAt time.Time + Filename string + ID string + Object string + Purpose string + type FileList struct + Data []File + Object string + type FilesService struct + func (s *FilesService) Delete(ctx context.Context, fileID string) error + func (s *FilesService) Download(ctx context.Context, fileID string) (io.ReadCloser, error) + func (s *FilesService) Get(ctx context.Context, fileID string) (*File, error) + func (s *FilesService) List(ctx context.Context) (*FileList, error) + func (s *FilesService) Upload(ctx context.Context, filePath string, purpose string) (*File, error) + type FineTuningJob struct + CreatedAt int64 + FinishedAt int64 + Hyperparameters map[string]interface{} + ID string + Model string + ResultFiles []string + Status string + TrainingFiles []string + ValidationFiles []string + type FineTuningJobList struct + Data []FineTuningJob + Object string + type FineTuningService struct + func (s *FineTuningService) Cancel(ctx context.Context, jobID string) (*FineTuningJob, error) + func (s *FineTuningService) Create(ctx context.Context, model string, trainingFiles []string, ...) (*FineTuningJob, error) + func (s *FineTuningService) Get(ctx context.Context, jobID string) (*FineTuningJob, error) + func (s *FineTuningService) List(ctx context.Context) (*FineTuningJobList, error) + type Function struct + Description string + Name string + Parameters map[string]interface{} + type Message struct + Content interface{} + Role string + type Model struct + Created int64 + ID string + Object string + OwnedBy string + Parent string + Permissions []string + Root string + type ModelCapability struct + Available bool + Description string + Name string + type ModelList struct + Data []Model + Object string + type ModelPerformance struct + Metric string + Unit string + Value float32 + type ModelsService struct + func (s *ModelsService) EstimateTokens(ctx context.Context, modelID string, text string) (int, error) + func (s *ModelsService) Get(ctx context.Context, modelID string) (*Model, error) + func (s *ModelsService) GetCapabilities(ctx context.Context, modelID string) ([]ModelCapability, error) + func (s *ModelsService) GetEnhanced(ctx context.Context, modelID string) (*EnhancedModel, error) + func (s *ModelsService) GetPerformance(ctx context.Context, modelID string) ([]ModelPerformance, error) + func (s *ModelsService) List(ctx context.Context) (*ModelList, error) + func (s *ModelsService) ListVersions(ctx context.Context, modelID string) ([]EnhancedModel, error) + type ModerationRequest struct + Input []string + Model string + type ModerationResponse struct + ID string + Model string + Results []ModerationResult + type ModerationResult struct + Categories map[string]bool + CategoryScores map[string]float32 + type ModerationsService struct + func (s *ModerationsService) Create(ctx context.Context, request *ModerationRequest) (*ModerationResponse, error) + func (s *ModerationsService) CreateChat(ctx context.Context, messages []Message, model string) (*ModerationResponse, error) + type OCRBlock struct + BoundingBox BoundingBox + Confidence float32 + Text string + type OCRRequest struct + Files []string + Languages []string + Model string + type OCRResponse struct + Created int64 + ID string + Model string + Object string + Results []OCRResult + Usage UsageInfo + type OCRResult struct + Blocks []OCRBlock + FileID string + Language string + Text string + type OCRService struct + func (s *OCRService) Create(ctx context.Context, request *OCRRequest) (*OCRResponse, error) + func (s *OCRService) CreateAsync(ctx context.Context, request *OCRRequest) (string, error) + func (s *OCRService) GetAsyncResult(ctx context.Context, jobID string) (*OCRResponse, error) + type Retry struct + InitialDelay int + MaxAttempts int + MaxDelay int + type Tool struct + Function Function + Type string + type UsageInfo struct + CompletionTokens int + PromptTokens int + TotalTokens int