Documentation ¶
Index ¶
Constants ¶
View Source
const ( OpenAIApiUrl = "https://api.openai.com/v1/chat/completions" CloudflareGatewayUrl = "https://gateway.ai.cloudflare.com/v1/%s/openai/chat/completions" Model = "gpt-3.5-turbo" User = "user" System = "system" )
View Source
const ( MinArticleLength = 500 MaxArticleLength = 12000 MaxTokens = 600 SystemPrompt = "" /* 175-byte string literal not displayed */ )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApiMessage ¶
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
func New ¶
func New(credentialService model.CredentialService) *Plugin
type Request ¶
type Request struct { Model string `json:"model"` Messages []ApiMessage `json:"messages"` PresencePenalty float32 `json:"presence_penalty"` MaxTokens int `json:"max_tokens"` Temperature float32 `json:"temperature"` }
type Response ¶
type Response struct { Choices []struct { Message ApiMessage `json:"message"` } `json:"choices"` Error struct { Message string `json:"message"` Type string `json:"type"` } `json:"error"` }
Click to show internal directories.
Click to hide internal directories.