Documentation
¶
Index ¶
- Variables
- type BackendResolver
- type CapacityError
- type OutputRepairer
- type PreparedExecution
- type RepairRequest
- type RunAdmitter
- type Runner
- func (r *Runner) InspectProfile(ctx context.Context, profileID string) (*domain.ProfileInspection, error)
- func (r *Runner) InspectPrompt(ctx context.Context, promptID string, promptVersion string) (*domain.PromptInspection, error)
- func (r *Runner) Prepare(ctx context.Context, req domain.RunRequest) (*domain.PreparedRun, error)
- func (r *Runner) PrepareExecution(ctx context.Context, req domain.RunRequest) (*PreparedExecution, error)
- func (r *Runner) Run(ctx context.Context, req domain.RunRequest) (*domain.RunResult, error)
- func (r *Runner) RunPrepared(ctx context.Context, prepared *PreparedExecution) (*domain.RunResult, error)
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidRequest = errors.New("invalid run request") ErrProfileRequired = errors.New("profile selection is required") ErrAPIKeyEnvMissing = errors.New("api_key_env points to an unset environment variable") ErrAPIKeyRequired = errors.New("api key is required") ErrPromptLoad = errors.New("failed to load prompt definition") ErrProfileLoad = errors.New("failed to load execution profile") ErrArtifactLoad = errors.New("failed to load artifact") ErrPromptRender = errors.New("failed to render prompt") ErrLLMGenerate = errors.New("failed to generate output") ErrValidation = errors.New("failed to validate output") )
Functions ¶
This section is empty.
Types ¶
type BackendResolver ¶ added in v0.2.0
BackendResolver resolves one normalized backend ID.
type CapacityError ¶ added in v0.4.0
type CapacityError struct {
BackendID string
}
CapacityError identifies bounded admission rejected for one selected backend.
func (*CapacityError) Error ¶ added in v0.4.0
func (e *CapacityError) Error() string
func (*CapacityError) Unwrap ¶ added in v0.4.0
func (e *CapacityError) Unwrap() error
type OutputRepairer ¶
type OutputRepairer interface {
Repair(ctx context.Context, req RepairRequest) (*domain.GenerateResponse, error)
}
func NewDefaultOutputRepairer ¶
func NewDefaultOutputRepairer(llmClient llm.Client) OutputRepairer
type PreparedExecution ¶ added in v0.4.0
type PreparedExecution struct {
// contains filtered or unexported fields
}
PreparedExecution owns one frozen, single-use runner execution.
func (*PreparedExecution) Details ¶ added in v0.4.0
func (p *PreparedExecution) Details() *domain.PreparedRun
Details returns a fresh credential-redacted copy of the prepared run.
func (*PreparedExecution) Discard ¶ added in v0.4.0
func (p *PreparedExecution) Discard()
Discard invalidates an unclaimed execution and drops its private payload.
type RepairRequest ¶
type RepairRequest struct {
PreviousOutput string
ValidationErrors []string
SessionID string
Target domain.ExecutionTarget
TargetPresence domain.ExecutionTargetPresence
StructuredOutput *domain.StructuredOutputSpec
Attempt int
MaxAttempts int
Mode domain.ValidationMode
}
type RunAdmitter ¶ added in v0.2.0
RunAdmitter reserves capacity for one resolved backend run.
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner executes the Promptkit core use case.
func NewRunner ¶
func NewRunner( promptDefs promptdef.Repository, profiles profile.Repository, backends BackendResolver, artifacts artifact.Reader, renderer prompt.Renderer, llmClient llm.Client, validator validate.Validator, admitter RunAdmitter, ) *Runner
func NewRunnerWithRepairer ¶
func NewRunnerWithRepairer( promptDefs promptdef.Repository, profiles profile.Repository, backends BackendResolver, artifacts artifact.Reader, renderer prompt.Renderer, llmClient llm.Client, validator validate.Validator, repairer OutputRepairer, admitter RunAdmitter, ) *Runner
func (*Runner) InspectProfile ¶ added in v0.4.0
func (r *Runner) InspectProfile( ctx context.Context, profileID string, ) (*domain.ProfileInspection, error)
InspectProfile resolves one explicit profile without prompt or execution work.
func (*Runner) InspectPrompt ¶ added in v0.4.0
func (r *Runner) InspectPrompt( ctx context.Context, promptID string, promptVersion string, ) (*domain.PromptInspection, error)
InspectPrompt resolves one explicit prompt without execution work.
func (*Runner) Prepare ¶
func (r *Runner) Prepare(ctx context.Context, req domain.RunRequest) (*domain.PreparedRun, error)
func (*Runner) PrepareExecution ¶ added in v0.4.0
func (r *Runner) PrepareExecution(ctx context.Context, req domain.RunRequest) (*PreparedExecution, error)
PrepareExecution completes preparation without generation or admission and returns a runner-bound, single-use execution.
func (*Runner) RunPrepared ¶ added in v0.4.0
func (r *Runner) RunPrepared(ctx context.Context, prepared *PreparedExecution) (*domain.RunResult, error)
RunPrepared claims and executes one prepared execution owned by this runner.