openai

package
v1.4.117 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2024 License: MIT Imports: 9 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*plugins.PluginBase
	ApiKey     *plugins.SetupQuestion
	ApiBaseURL *plugins.SetupQuestion
	ApiClient  *openai.Client
}

func NewClient

func NewClient() (ret *Client)

func NewClientCompatible

func NewClientCompatible(vendorName string, defaultBaseUrl string, configureCustom func() error) (ret *Client)

func (*Client) ListModels

func (o *Client) ListModels() (ret []string, err error)

func (*Client) Send

func (o *Client) Send(ctx context.Context, msgs []*openai.ChatCompletionMessage, opts *common.ChatOptions) (ret string, err error)

func (*Client) SendStream

func (o *Client) SendStream(
	msgs []*openai.ChatCompletionMessage, opts *common.ChatOptions, channel chan string,
) (err error)

Jump to

Keyboard shortcuts

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