openaillm

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OpenAILLM

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

OpenAILLM 大语言模型,实现chat completion和embed

func NewLLM

func NewLLM(apiKey string, apiBase string, model string) *OpenAILLM

NewLLM 构造

func (*OpenAILLM) Embed

func (l *OpenAILLM) Embed(ctx context.Context, text string) ([]float32, error)

Embed 嵌入

func (*OpenAILLM) QA

func (l *OpenAILLM) QA(ctx context.Context, questionContext, question string) (string, error)

QA 问答

Jump to

Keyboard shortcuts

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