Documentation
¶
Index ¶
Constants ¶
const ( // Times a streak of replies with nothing in them is asked again while an attempt costs less than the threshold, and once one costs as // much Retries = 3 Costly = 1 // Times a reply of reasoning alone is asked to go on to its answer before it counts as nothing Prefills = 2 )
Variables ¶
var Threshold = big.NewRat(1, 4)
Dollars one attempt must cost for the streak to be asked again once alone, while no setting says
Functions ¶
func Budget ¶
Times a streak whose last reply cost the amount is asked again: Retries, Costly where one attempt costs the threshold or more; Retries while the guard is off or the cost is not known
Types ¶
type Attempt ¶
type Attempt struct {
// Model and provider that answered, and why the model said it stopped
Model, Provider, Finish string
// The reply said what it took, and that it generated no tokens, its reasoning's included
Counted, Nothing bool
// Something of the reply was seen as it came, such as its reasoning, though it ended with nothing
Seen bool
}
One reply in a streak that came back with nothing in it
type Streak ¶
type Streak struct {
// contains filtered or unexported fields
}
The replies with nothing in them of one reply of the agent, in a row, and what they cost
func (*Streak) Cost ¶
What the replies of the streak cost in dollars together, nil where nothing of it is known
func (*Streak) Deterministic ¶
Whether the same request keeps giving the same nothing, so no retry will help: two replies or more, all of one model, provider and finish reason, each saying it generated no tokens, or none saying what it took and nothing of any seen as it came; never while the guard is off
func (*Streak) Record ¶
Records one reply with nothing in it at its cost, nil where it is not known; a streak not asked again yet starts anew
func (*Streak) Reset ¶
func (s *Streak) Reset()
A reply with something in it, or a fallback taking over, ends the streak