Documentation ¶ Index ¶ type OpenAILLM func NewLLM(apiKey string, apiBase string, model string) *OpenAILLM func (l *OpenAILLM) Embed(ctx context.Context, text string) ([]float32, error) func (l *OpenAILLM) QA(ctx context.Context, questionContext, question string) (string, error) 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 问答 Source Files ¶ View all Source files openai.goprompt.go Click to show internal directories. Click to hide internal directories.