Documentation ¶
Index ¶
- Constants
- type BatchJob
- type BatchJobMethod
- type BatchJobStatus
- type Endpoint
- func (p *Endpoint) GenerateBatchChatCompletion(ctx context.Context, openaiRequest *openai.ChatCompletionRequest) (*openai.ChatCompletionResponse, error)
- func (p *Endpoint) GenerateChatCompletion(ctx context.Context, openaiRequest *openai.ChatCompletionRequest) (*openai.ChatCompletionResponse, error)
- func (p *Endpoint) Ping(ctx context.Context) (time.Duration, error)
- func (p *Endpoint) Provider() string
- func (p *Endpoint) Region() string
- func (p *Endpoint) Shutdown() error
Constants ¶
View Source
const REGION = "openai"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchJob ¶
type BatchJob struct { Id string `json:"custom_id"` Method BatchJobMethod `json:"method"` Url string `json:"url"` Body *openai.ChatCompletionRequest `json:"body"` Status BatchJobStatus `json:"-"` Result *openai.ChatCompletionResponse `json:"-"` Error error `json:"-"` Waiters []chan struct{} `json:"-"` BatchId string `json:"-"` InputFileId string `json:"-"` OutputFileId string `json:"-"` }
type BatchJobMethod ¶
type BatchJobMethod string
const (
ChatCompletionMethod BatchJobMethod = "POST"
)
type BatchJobStatus ¶
type BatchJobStatus string
const ( BatchJobStatusPending BatchJobStatus = "pending" BatchJobStatusCompleted BatchJobStatus = "completed" BatchJobStatusFailed BatchJobStatus = "failed" )
type Endpoint ¶
type Endpoint struct {
// contains filtered or unexported fields
}
func NewEndpoint ¶
func (*Endpoint) GenerateBatchChatCompletion ¶
func (p *Endpoint) GenerateBatchChatCompletion(ctx context.Context, openaiRequest *openai.ChatCompletionRequest) (*openai.ChatCompletionResponse, error)
func (*Endpoint) GenerateChatCompletion ¶
func (p *Endpoint) GenerateChatCompletion(ctx context.Context, openaiRequest *openai.ChatCompletionRequest) (*openai.ChatCompletionResponse, error)
Click to show internal directories.
Click to hide internal directories.