Documentation
¶
Overview ¶
Package openai is the OpenAI llm provider
Index ¶
Constants ¶
View Source
const APIEndpoint = "https://api.openai.com/v1/chat/completions"
APIEndpoint is the endpoint for OpenAI
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OpenAIProvider ¶
type OpenAIProvider struct { // APIKey is the API key for OpenAI APIKey string // Model is the model for OpenAI // eg. "gpt-3.5-turbo-1106", "gpt-4-turbo-preview", "gpt-4-vision-preview", "gpt-4" Model string }
OpenAIProvider is the provider for OpenAI
func NewProvider ¶
func NewProvider(apiKey string, model string) *OpenAIProvider
NewProvider creates a new OpenAIProvider
func (*OpenAIProvider) GetChatCompletions ¶
func (p *OpenAIProvider) GetChatCompletions(userInstruction string, baseSystemMessage string, chainMessage ai.ChainMessage, md metadata.M, withTool bool) (*ai.InvokeResponse, error)
GetChatCompletions get chat completions for ai service
func (*OpenAIProvider) Name ¶
func (p *OpenAIProvider) Name() string
Name returns the name of the provider
Click to show internal directories.
Click to hide internal directories.