llm

package
v0.0.0-...-9be93d0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeObject  = "object"
	TypeString  = "string"
	TypeArray   = "array"
	TypeNumber  = "number"
	TypeBoolean = "bool"
)
View Source
const (
	CommonFuncName  = "resolver"
	CommonFuncField = "text"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Callback

type Callback func(reply string, replyType string) (resp string)

type CommonResolverBody

type CommonResolverBody struct {
	Text string `json:"text"`
}

type DescriptionType

type DescriptionType struct {
	Description string `json:"description"`
	Type        string `json:"type"`
}

type Gpt

type Gpt struct {
	Messages         []openai.ChatCompletionMessage
	Functions        []openai.FunctionDefinition
	Stream           bool
	Temperature      float32
	TopP             float32
	PresencePenalty  float32
	FrequencyPenalty float32
	Model            string
	// contains filtered or unexported fields
}

func NewGpt

func NewGpt(config config.Config) *Gpt

func (*Gpt) ChatCompletion

func (g *Gpt) ChatCompletion(remark string) (reply string)

func (*Gpt) Resolve

func (g *Gpt) Resolve(messages []openai.ChatCompletionMessage, functions []openai.FunctionDefinition, callback Callback) *Gpt

type Parameters

type Parameters struct {
	Type       string   `json:"type"`
	Items      any      `json:"items,omitempty"`
	Properties any      `json:"properties,omitempty"`
	Required   []string `json:"required"`
}

Directories

Path Synopsis
Package function @Description: 对接 swagger apifox postman yapi 等文档管理工具,实现读取和更新接口文档
Package function @Description: 对接 swagger apifox postman yapi 等文档管理工具,实现读取和更新接口文档
Package prompt @Description: 文档类的 prompt,包括生成和解析文档两个部分
Package prompt @Description: 文档类的 prompt,包括生成和解析文档两个部分

Jump to

Keyboard shortcuts

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