Documentation ¶
Index ¶
- Constants
- func NewOpenAI(logger logger.Logger) bindings.OutputBinding
- type AzOpenAI
- func (p *AzOpenAI) Close() error
- func (p *AzOpenAI) GetComponentMetadata() (metadataInfo metadata.MetadataMap)
- func (p *AzOpenAI) Init(ctx context.Context, meta bindings.Metadata) error
- func (p *AzOpenAI) Invoke(ctx context.Context, req *bindings.InvokeRequest) (resp *bindings.InvokeResponse, err error)
- func (p *AzOpenAI) Operations() []bindings.OperationKind
- type ChatMessages
- type EmbeddingMessage
- type Message
- type Prompt
Constants ¶
View Source
const ( CompletionOperation bindings.OperationKind = "completion" ChatCompletionOperation bindings.OperationKind = "chat-completion" GetEmbeddingOperation bindings.OperationKind = "get-embedding" APIKey = "apiKey" DeploymentID = "deploymentID" Endpoint = "endpoint" MessagesKey = "messages" Temperature = "temperature" MaxTokens = "maxTokens" TopP = "topP" N = "n" Stop = "stop" FrequencyPenalty = "frequencyPenalty" LogitBias = "logitBias" User = "user" )
List of operations.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AzOpenAI ¶
type AzOpenAI struct {
// contains filtered or unexported fields
}
AzOpenAI represents OpenAI output binding.
func (*AzOpenAI) GetComponentMetadata ¶
func (p *AzOpenAI) GetComponentMetadata() (metadataInfo metadata.MetadataMap)
GetComponentMetadata returns the metadata of the component.
func (*AzOpenAI) Invoke ¶
func (p *AzOpenAI) Invoke(ctx context.Context, req *bindings.InvokeRequest) (resp *bindings.InvokeResponse, err error)
Invoke handles all invoke operations.
func (*AzOpenAI) Operations ¶
func (p *AzOpenAI) Operations() []bindings.OperationKind
Operations returns list of operations supported by OpenAI binding.
type ChatMessages ¶
type ChatMessages struct { DeploymentID string `json:"deploymentID"` Messages []Message `json:"messages"` Temperature float32 `json:"temperature"` MaxTokens int32 `json:"maxTokens"` TopP float32 `json:"topP"` N int32 `json:"n"` PresencePenalty float32 `json:"presencePenalty"` FrequencyPenalty float32 `json:"frequencyPenalty"` Stop []string `json:"stop"` }
ChatMessages type for chat completion API.
type EmbeddingMessage ¶
type Prompt ¶
type Prompt struct { DeploymentID string `json:"deploymentID"` Prompt string `json:"prompt"` Temperature float32 `json:"temperature"` MaxTokens int32 `json:"maxTokens"` TopP float32 `json:"topP"` N int32 `json:"n"` PresencePenalty float32 `json:"presencePenalty"` FrequencyPenalty float32 `json:"frequencyPenalty"` Stop []string `json:"stop"` }
Prompt type for completion API.
Click to show internal directories.
Click to hide internal directories.