openai

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModelGPT432K          = "gpt-4-32k"
	ModelGPT4             = "gpt-4"
	ModelGPT3Dot5Turbo16K = "gpt-3.5-turbo-16k"
	ModelGPT3Dot5Turbo    = "gpt-3.5-turbo"
)

Variables

This section is empty.

Functions

func ListModels

func ListModels() []string

Types

type Client

type Client struct {
	*openai.Client
}

func NewClient

func NewClient(cfg openai.ClientConfig) *Client

func (*Client) CreateChatCompletion

func (s *Client) CreateChatCompletion(ctx context.Context, req llm.ChatCompletionRequest) (llm.ChatCompletionResponse, error)

func (*Client) CreateChatCompletionStream

func (s *Client) CreateChatCompletionStream(ctx context.Context, req llm.ChatCompletionRequest, dataChan chan llm.ChatCompletionStreamResponse, errChan chan error)

func (*Client) ListModels

func (s *Client) ListModels() []string

type OpenAI

type OpenAI struct {
	*llm.LLM
}

func New

func New(cfg openai.ClientConfig, dao llm.Dao) *OpenAI

Jump to

Keyboard shortcuts

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