Documentation ¶
Index ¶
- func Init(logger *zap.Logger, options ConnectorOptions) base.IConnector
- type AudioTranscriptionInput
- type AudioTranscriptionReq
- type AudioTranscriptionResp
- type Choices
- type Client
- func (c *Client) GenerateAudioTranscriptions(req AudioTranscriptionReq) (result AudioTranscriptionResp, err error)
- func (c *Client) GenerateTextCompletion(req TextCompletionReq) (result TextCompletionResp, err error)
- func (c *Client) GenerateTextEmbeddings(req TextEmbeddingsReq) (result TextEmbeddingsResp, err error)
- func (c *Client) ListModels() (resp ListModelsResponse, err error)
- type Connection
- type Connector
- type ConnectorOptions
- type Data
- type HTTPClient
- type ListModelsResponse
- type Message
- type Model
- type ModelPermission
- type TextCompletionInput
- type TextCompletionOutput
- type TextCompletionReq
- type TextCompletionResp
- type TextEmbeddingsInput
- type TextEmbeddingsOutput
- type TextEmbeddingsReq
- type TextEmbeddingsResp
- type Usage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Init ¶
func Init(logger *zap.Logger, options ConnectorOptions) base.IConnector
Types ¶
type AudioTranscriptionInput ¶
type AudioTranscriptionReq ¶
type AudioTranscriptionResp ¶
type AudioTranscriptionResp struct {
Text string `json:"text"`
}
type Client ¶
type Client struct { APIKey string Org string HTTPClient HTTPClient }
Client represents a OpenAI client
func (*Client) GenerateAudioTranscriptions ¶
func (c *Client) GenerateAudioTranscriptions(req AudioTranscriptionReq) (result AudioTranscriptionResp, err error)
GenerateAudioTranscriptions makes a call to the audio transcriptions API from OpenAI. https://platform.openai.com/docs/api-reference/audio/create-transcription
func (*Client) GenerateTextCompletion ¶
func (c *Client) GenerateTextCompletion(req TextCompletionReq) (result TextCompletionResp, err error)
GenerateTextCompletion makes a call to the completions API from OpenAI. https://platform.openai.com/docs/api-reference/completions
func (*Client) GenerateTextEmbeddings ¶
func (c *Client) GenerateTextEmbeddings(req TextEmbeddingsReq) (result TextEmbeddingsResp, err error)
GenerateTextEmbeddings makes a call to the embeddings API from OpenAI. https://platform.openai.com/docs/api-reference/embeddings
func (*Client) ListModels ¶
func (c *Client) ListModels() (resp ListModelsResponse, err error)
ListModels calls the list models endpoint and returns the available models. https://platform.openai.com/docs/api-reference/models/list
type Connection ¶
type Connection struct { base.BaseExecution // contains filtered or unexported fields }
type Connector ¶
type Connector struct { base.BaseConnector // contains filtered or unexported fields }
func (*Connector) CreateExecution ¶
type ConnectorOptions ¶
type ConnectorOptions struct{}
type HTTPClient ¶
HTTPClient interface
type ListModelsResponse ¶
type Model ¶
type Model struct { ID string `json:"id"` Object string `json:"object"` Created int `json:"created"` OwnedBy string `json:"owned_by"` Permission []ModelPermission `json:"permission"` Root string `json:"root"` }
Model represents a OpenAI Model
type ModelPermission ¶
type ModelPermission struct { ID string `json:"id"` Object string `json:"object"` Created int `json:"created"` AllowCreateEngine bool `json:"allow_create_engine"` AllowSampling bool `json:"allow_sampling"` AllowLogprobs bool `json:"allow_logprobs"` AllowSearchIndices bool `json:"allow_search_indices"` AllowView bool `json:"allow_view"` AllowFineTuning bool `json:"allow_fine_tuning"` Organization string `json:"organization"` IsBlocking bool `json:"is_blocking"` }
type TextCompletionInput ¶
type TextCompletionOutput ¶
type TextCompletionOutput struct {
Texts []string `json:"texts"`
}
type TextCompletionReq ¶
type TextCompletionReq struct { Model string `json:"model"` Messages []Message `json:"messages"` Temperature *float32 `json:"temperature,omitempty"` TopP *float32 `json:"top_p,omitempty"` N *int `json:"n,omitempty"` Stream *bool `json:"stream,omitempty"` Stop *string `json:"stop,omitempty"` MaxTokens *int `json:"max_tokens,omitempty"` PresencePenalty *float32 `json:"presence_penalty,omitempty"` FrequencyPenalty *float32 `json:"frequency_penalty,omitempty"` }
type TextCompletionResp ¶
type TextEmbeddingsInput ¶
type TextEmbeddingsOutput ¶
type TextEmbeddingsOutput struct {
Embedding []float64 `json:"embedding"`
}
type TextEmbeddingsReq ¶
type TextEmbeddingsResp ¶
Click to show internal directories.
Click to hide internal directories.