openai

package
v1.5.51 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2025 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OpenAI added in v1.5.39

type OpenAI struct {
	Client        *openai.Client
	Model         string
	Temperature   float64
	MaxTokens     int64
	SystemMessage string
}

func NewOpenAI added in v1.5.39

func NewOpenAI(model string, temperature float64, maxTokens int64) *OpenAI

func (*OpenAI) CreateChat added in v1.5.39

func (o *OpenAI) CreateChat(messages models.AIChatHistory) (*openai.ChatCompletion, error)

func (*OpenAI) CreateChatStream added in v1.5.39

func (o *OpenAI) CreateChatStream(messages models.AIChatHistory, chunkHandler func(chuck openai.ChatCompletionChunk)) (*openai.ChatCompletion, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL