openai

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: MulanPSL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LLM

type LLM struct {
	// contains filtered or unexported fields
}

func NewLLM

func NewLLM(apiSecret string, model ModelType, opt *Option) (*LLM, error)

func (*LLM) CheckSupport added in v0.0.2

func (llm *LLM) CheckSupport(v llms.LLMSupportType) bool

func (*LLM) Request

func (llm *LLM) Request(ctx context.Context, input llms.Input, tb llms.ToolBox) (*llms.Output, error)

type ModelType

type ModelType string
const (
	ModelTypeGpt3Dot5Turbo ModelType = "gpt-3.5-turbo"
	ModelTypeGpt35Turbo16k ModelType = "gpt-35-turbo-16k"
	ModelTypeGpt4Pro       ModelType = "gpt-4"
	ModelTypeGpt4Pro32K    ModelType = "gpt-4-32k"
)

type Option

type Option struct {
	// contains filtered or unexported fields
}

func NewOption

func NewOption() *Option

func (*Option) SetHttpClient

func (p *Option) SetHttpClient(val *http.Client) *Option

func (*Option) SetMaxTokens

func (p *Option) SetMaxTokens(val int) *Option

func (*Option) SetTemperature

func (p *Option) SetTemperature(val float32) *Option

func (*Option) SetTopP

func (p *Option) SetTopP(val float32) *Option

Jump to

Keyboard shortcuts

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