Documentation ¶
Index ¶
- type OpenAI
- func (o *OpenAI) CreateChat(chatRequest *types.ChatRequest) (types.ChatResponse, error)
- func (o *OpenAI) CreateChatSimple(prompt string, maxTokens int) (types.ChatResponse, error)
- func (o *OpenAI) CreateCompletion(completionRequest *types.CompletionRequest) (types.CompletionResponse, error)
- func (o *OpenAI) CreateCompletionSimple(prompt, model string, maxTokens int) (types.CompletionResponse, error)
- func (o *OpenAI) CreateEdit(editRequest *types.EditRequest) (types.EditResponse, error)
- func (o *OpenAI) CreateImage(imageRequest *types.ImageRequest) (types.ImageResponse, error)
- func (o *OpenAI) CreateTranscription(file []byte, filename string) (types.AudioTranscriptionResponse, error)
- func (o *OpenAI) ListModels() (types.ModelsResponse, error)
- type OpenAIOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OpenAI ¶
func NewOpenAI ¶
func NewOpenAI(options *OpenAIOpts) OpenAI
NewOpenAI creates a new instance of the OpenAI API
func (*OpenAI) CreateChat ¶ added in v0.2.0
func (o *OpenAI) CreateChat(chatRequest *types.ChatRequest) (types.ChatResponse, error)
CreateChat creates a chat
func (*OpenAI) CreateChatSimple ¶ added in v0.2.0
CreateChatSimple creates a chat with a simple interface
func (*OpenAI) CreateCompletion ¶
func (o *OpenAI) CreateCompletion(completionRequest *types.CompletionRequest) (types.CompletionResponse, error)
CreateCompletion creates a completion
func (*OpenAI) CreateCompletionSimple ¶
func (o *OpenAI) CreateCompletionSimple(prompt, model string, maxTokens int) (types.CompletionResponse, error)
CreateCompletionSimple creates a completion with a simple interface
func (*OpenAI) CreateEdit ¶
func (o *OpenAI) CreateEdit(editRequest *types.EditRequest) (types.EditResponse, error)
CreateEdit creates an edit
func (*OpenAI) CreateImage ¶
func (o *OpenAI) CreateImage(imageRequest *types.ImageRequest) (types.ImageResponse, error)
CreateImage creates an image
func (*OpenAI) CreateTranscription ¶ added in v0.3.0
func (*OpenAI) ListModels ¶
func (o *OpenAI) ListModels() (types.ModelsResponse, error)
ListModels returns a list of models
type OpenAIOpts ¶
type OpenAIOpts struct {
APIKey string
}
Click to show internal directories.
Click to hide internal directories.