llm

package
v0.0.0-...-a2946bf Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChatResponse

type ChatResponse struct {
	Content string
}

type LLM

type LLM interface {
	Chat(ctx context.Context, model, prompt string) (*ChatResponse, error)
	Summarize(ctx context.Context, model string, text string) (*ChatResponse, error)
}

func NewOpenAILLM

func NewOpenAILLM(config OpenAIConfig) (LLM, error)

type OpenAIConfig

type OpenAIConfig struct {
	APIKey       string
	Endpoint     string
	Organization string
}

type OpenAILLM

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

func (*OpenAILLM) Chat

func (o *OpenAILLM) Chat(ctx context.Context, model string, prompt string) (*ChatResponse, error)

func (*OpenAILLM) Summarize

func (o *OpenAILLM) Summarize(ctx context.Context, model string, text string) (*ChatResponse, error)

type Provider

type Provider struct{}

func (Provider) Register

func (s Provider) Register(app infra.Binder)

Jump to

Keyboard shortcuts

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