llmclient

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2026 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContentPart

type ContentPart struct {
	Type      ContentType
	Text      string
	ImageData []byte
	MIMEType  string
}

type ContentType

type ContentType string
const (
	ContentText  ContentType = "text"
	ContentImage ContentType = "image"
)

type Message

type Message struct {
	Role  string
	Parts []ContentPart
}

func SystemMessage

func SystemMessage(text string) Message

func UserTextMessage

func UserTextMessage(text string) Message

type Request

type Request struct {
	Model             string
	Messages          []Message
	SamplerParams     map[string]any
	ResponseContract  ResponseContract
	Timeout           time.Duration
	Task              llmprovider.Task
	RootDir           string
	Env               map[string]string
	ProviderOverrides map[llmprovider.Provider]llmprovider.ProviderOverrides
	Resolve           llmprovider.ResolveOptions
	HTTPClient        *http.Client
	Metrics           metrics.RunContext
}

type Response

type Response struct {
	Text            string
	RawJSON         string
	Model           string
	Provider        llmprovider.Provider
	APIModel        string
	Transport       llmprovider.Transport
	Tool            string
	ToolVersion     string
	ParamAccounting llmprovider.ParamAccounting
}

func Chat

func Chat(ctx context.Context, req Request) (resp Response, err error)

type ResponseContract

type ResponseContract string
const (
	ResponseContractText ResponseContract = "text"
	ResponseContractJSON ResponseContract = "json_prompt_only"
)

Jump to

Keyboard shortcuts

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