model

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CapabilityRepairCode added in v0.6.0

type CapabilityRepairCode interface {
	// RepairCode queries the model to repair a source code with compilation error.
	RepairCode(ctx Context) (assessments metrics.Assessments, err error)
}

CapabilityRepairCode defines the capability of a model to repair code.

type CapabilityTranspile added in v0.6.0

type CapabilityTranspile interface {
	// Transpile queries the model to transpile source code to another language.
	Transpile(ctx Context) (assessments metrics.Assessments, err error)
}

CapabilityTranspile defines the capability of a model to transpile code.

type CapabilityWriteTests added in v0.6.0

type CapabilityWriteTests interface {
	// WriteTests generates test files for the given implementation file in a repository.
	WriteTests(ctx Context) (assessments metrics.Assessments, err error)
}

CapabilityWriteTests defines the capability of a model to generate tests.

type Context added in v0.6.0

type Context struct {
	// Language holds the language for which the task should be evaluated.
	Language language.Language

	// RepositoryPath holds the absolute path to the repository.
	RepositoryPath string
	// FilePath holds the path to the file the model should act on.
	FilePath string

	// Arguments holds extra data that can be used in a query prompt.
	Arguments any

	// Logger is used for logging during evaluation.
	Logger *log.Logger
}

Context holds the data needed by a model for running a task.

type MetaInformation added in v0.6.1

type MetaInformation struct {
	// ID holds the model id.
	ID string `json:"id"`
	// Name holds the model name.
	Name string `json:"name"`

	// Pricing holds the pricing information of a model.
	Pricing Pricing `json:"pricing"`
}

MetaInformation holds a model.

type Model

type Model interface {
	// ID returns the unique ID of this model.
	ID() (id string)

	// MetaInformation returns the meta information of a model.
	MetaInformation() *MetaInformation
}

Model defines a model that can be queried for generations.

type Pricing added in v0.6.1

type Pricing struct {
	// Prompt holds the price for a prompt in dollars per token.
	Prompt float64 `json:"prompt,string"`
	// Completion holds the price for a completion in dollars per token.
	Completion float64 `json:"completion,string"`
	// Request holds the price for a request in dollars per request.
	Request float64 `json:"request,string"`
	// Image holds the price for an image in dollars per token.
	Image float64 `json:"image,string"`
}

Pricing holds the pricing information of a model.

type SetQueryAttempts added in v0.5.0

type SetQueryAttempts interface {
	// SetQueryAttempts sets the number of query attempts to perform when a model request errors in the process of solving a task.
	SetQueryAttempts(attempts uint)
}

SetQueryAttempts defines a model that can set the number of query attempts when a model request errors in the process of solving a task.

Directories

Path Synopsis
llm

Jump to

Keyboard shortcuts

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