llm

package
v0.1.253 Latest Latest
Warning

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

Go to latest
Published: May 14, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Blackbox added in v0.1.18

type Blackbox interface {
	contract.Reader
}

WARN: Methods from this interface require black-box testing because they internally call package-level functions (e.g., http.NewRequest) that are not easily mockable or stubbable. While we have access to their implementation, mocking or stubbing these functions is not practical. As a result, these methods are best tested using black-box testing techniques, such as input-based testing, where explicit error scenarios are triggered. Alternatively, these methods can also be tested using function variables.

type Client

type Client interface {
	Blackbox
	contract.Prompter
}

func NewClient

func NewClient(d Dependencies, opts ClientOptions) (Client, error)

type ClientOption added in v0.1.8

type ClientOption func(*ClientOptions)

func WithAPIKey added in v0.1.8

func WithAPIKey(x string) ClientOption

func WithLoaded added in v0.1.164

func WithLoaded(x Loaded) ClientOption

func WithModel added in v0.1.8

func WithModel(x string) ClientOption

func WithURL added in v0.1.8

func WithURL(x string) ClientOption

type ClientOptions added in v0.1.8

type ClientOptions struct {
	Loaded
	URL   string
	Model string
}

func ApplyClientOptions added in v0.1.8

func ApplyClientOptions(opts *ClientOptions, modifiers ...ClientOption) ClientOptions

type DefaultTool added in v0.1.11

type DefaultTool struct {
	T *contract.Tool[Client]
}

func NewTool

func NewTool(c Client, opts contract.ToolOptions[Client]) *DefaultTool

func (*DefaultTool) Prompt added in v0.1.11

func (d *DefaultTool) Prompt(ctx context.Context, opts contract.PrompterOpts) (string, error)

Prompt sends a prompt to the LLM and retrieves the response.

type Dependencies added in v0.1.11

type Loaded added in v0.1.122

type Loaded struct {
	APIKey string
}

type Tool added in v0.1.245

type Tool interface {
	contract.Prompter
}

Jump to

Keyboard shortcuts

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