Documentation ¶
Index ¶
- Constants
- Variables
- type OpenAI
- func (s *OpenAI) ChatCompletion(conversation ai.BotConversation, opts ...ai.LanguageModelOption) (*ai.TextStreamResult, error)
- func (s *OpenAI) ChatCompletionNoStream(conversation ai.BotConversation, opts ...ai.LanguageModelOption) (string, error)
- func (s *OpenAI) CountTokens(text string) int
- func (s *OpenAI) GenerateImage(prompt string) (image.Image, error)
- func (s *OpenAI) GetDefaultConfig() ai.LLMConfig
- func (s *OpenAI) TokenLimit() int
- func (s *OpenAI) Transcribe(file io.Reader) (*subtitles.Subtitles, error)
Constants ¶
View Source
const MaxFunctionCalls = 10
View Source
const StreamingTimeoutDefault = 10 * time.Second
Variables ¶
View Source
var ErrStreamingTimeout = errors.New("timeout streaming")
Functions ¶
This section is empty.
Types ¶
type OpenAI ¶
type OpenAI struct {
// contains filtered or unexported fields
}
func New ¶
func New(llmService ai.ServiceConfig) *OpenAI
func NewCompatible ¶
func NewCompatible(llmService ai.ServiceConfig) *OpenAI
func (*OpenAI) ChatCompletion ¶
func (s *OpenAI) ChatCompletion(conversation ai.BotConversation, opts ...ai.LanguageModelOption) (*ai.TextStreamResult, error)
func (*OpenAI) ChatCompletionNoStream ¶
func (s *OpenAI) ChatCompletionNoStream(conversation ai.BotConversation, opts ...ai.LanguageModelOption) (string, error)
func (*OpenAI) CountTokens ¶ added in v0.4.0
func (*OpenAI) GetDefaultConfig ¶
func (*OpenAI) TokenLimit ¶ added in v0.4.0
Click to show internal directories.
Click to hide internal directories.