Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CapabilityMigrate ¶ added in v1.0.0
type CapabilityMigrate interface {
// Migrate queries the model to migrate source code.
Migrate(ctx Context) (assessments metrics.Assessments, err error)
}
CapabilityMigrate defines the capability of a model to migrate code.
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 ConfigureAPIRequestHandling ¶ added in v1.1.0
type ConfigureAPIRequestHandling interface {
// SetAPIRequestAttempts sets the number of allowed API requests per LLM query.
SetAPIRequestAttempts(attempts uint)
// SetAPIRequestTimeout sets the timeout for API requests in seconds.
SetAPIRequestTimeout(timeout uint)
}
ConfigureAPIRequestHandling defines a model that can configure how API requests are handled.
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
// HasTestsInSource determines if the tests for this repository are located within the corresponding implementation file.
HasTestsInSource bool
// 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 full identifier, including the provider and attributes.
ID() (id string)
// ModelID returns the unique identifier of this model with its provider.
ModelID() (modelID string)
// ModelIDWithoutProvider returns the unique identifier of this model without its provider.
ModelIDWithoutProvider() (modelID string)
// Attributes returns query attributes.
Attributes() (attributes map[string]string)
// SetAttributes sets the given attributes.
SetAttributes(attributes map[string]string)
// MetaInformation returns the meta information of a model.
MetaInformation() *MetaInformation
// Clone returns a copy of the model.
Clone() (clone Model)
}
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.
Click to show internal directories.
Click to hide internal directories.