Documentation
¶
Overview ¶
Package live contains the small amount of plumbing shared by the runnable examples.
Index ¶
- Constants
- func ChooseModel(configured string, enabled []string) (string, error)
- func Execute(c Config, scenario Scenario) int
- func Explain(err error, pat string) string
- func HistoryMessage(raw string) (role, text string, err error)
- func Marker() string
- func Name(prefix string) string
- func Pause(ctx context.Context) error
- func ReadEnv(path string) (map[string]string, error)
- func Safe(err error) string
- func Status(status string) string
- type Config
- type MessagePreview
- type PreviewUpdate
- type ProjectMemory
- type Run
- func (r *Run) Log(event, detail string)
- func (r *Run) Message(role, text string)
- func (r *Run) ObserveTurn(result *TurnResult, raw string) error
- func (r *Run) RetainResources()
- func (r *Run) Step(description string)
- func (r *Run) Track(kind, id string, fn func(context.Context) error)
- func (r *Run) Wait(description string) func()
- type Scenario
- type TurnResult
Constants ¶
const ProjectMemoryPath = "projects/release-conventions.md"
Variables ¶
This section is empty.
Functions ¶
func HistoryMessage ¶
HistoryMessage extracts only user and assistant text, excluding tool inputs, results and other event payloads from the conversation transcript.
func ReadEnv ¶
ReadEnv reads assignments as data, never as shell commands. Existing environment variables take precedence; callers can use either separate PATs or one shared PAT.
Types ¶
type Config ¶
type Config struct {
BaseURL, PAT, Model string
Mode, EnvFile, Output string
Timeout time.Duration
}
func (Config) Options ¶
func (c Config) Options() []option.RequestOption
type MessagePreview ¶
type MessagePreview struct {
// contains filtered or unexported fields
}
MessagePreview tracks text by event ID and content-block index. A final agent.message replaces its preview, including when some deltas were missed.
func (*MessagePreview) Observe ¶
func (p *MessagePreview) Observe(raw string) (*PreviewUpdate, error)
type PreviewUpdate ¶
type ProjectMemory ¶
type ProjectMemory struct {
Project, ReleaseTime, Contact, RollbackVersion string
}
ProjectMemory keeps the remembered facts separate from the question. Varying the facts on each run prevents a plausible stock answer from passing.
func NewProjectMemory ¶
func NewProjectMemory() ProjectMemory
func (ProjectMemory) Content ¶
func (m ProjectMemory) Content() string
func (ProjectMemory) Index ¶
func (m ProjectMemory) Index() string
The runtime loads MEMORY.md as an index. Keep the facts in the linked entry so the Agent must actually retrieve the project memory to answer.
func (ProjectMemory) Prompt ¶
func (m ProjectMemory) Prompt() string
func (ProjectMemory) Verify ¶
func (m ProjectMemory) Verify(r *Run, result TurnResult) error
type Run ¶
type Run struct {
Name string
// contains filtered or unexported fields
}
func (*Run) ObserveTurn ¶
func (r *Run) ObserveTurn(result *TurnResult, raw string) error
func (*Run) RetainResources ¶
func (r *Run) RetainResources()
RetainResources transfers cleanup responsibility to the caller after a successful conversation that explicitly requested -keep-session.
type TurnResult ¶
TurnResult only accepts assistant output followed by a terminal idle event. User messages and tool output cannot satisfy the result assertion.
func (*TurnResult) Observe ¶
func (r *TurnResult) Observe(raw string) error