llm

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: MIT Imports: 19 Imported by: 2

Documentation

Overview

Package llm provides a Starlark module that calls OpenAI models.

Index

Constants

View Source
const ModuleName = "llm"

ModuleName defines the expected name for this module when used in Starlark's load() function, e.g., load('llm', 'chat')

Variables

This section is empty.

Functions

func SetLog added in v0.0.2

func SetLog(l *zap.SugaredLogger)

SetLog sets the logger from outside the package.

Types

type Module

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

Module wraps the ConfigurableModule with specific functionality for calling OpenAI models.

func NewModule

func NewModule() *Module

NewModule creates a new instance of Module.

func NewModuleWithConfig

func NewModuleWithConfig(serviceProvider, endpointURL, apiKey, gptModel, dalleModel string) *Module

NewModuleWithConfig creates a new instance of Module with the given configuration values.

func NewModuleWithGetter

func NewModuleWithGetter(serviceProvider, endpointURL, apiKey, gptModel, dalleModel base.ConfigGetter[string]) *Module

NewModuleWithGetter creates a new instance of Module with the given configuration getters.

func (*Module) LoadModule

func (m *Module) LoadModule() starlet.ModuleLoader

LoadModule returns the Starlark module loader with the email-specific functions.

func (*Module) SetClient

func (m *Module) SetClient(cli *oai.Client)

SetClient sets the OpenAI client for this module.

Jump to

Keyboard shortcuts

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