Documentation
¶
Overview ¶
Package attention reads stored answers from the attention-controller store.
The store keeps one card per question a worker asked, plus a delivery report per card. A card whose answer exists but was never delivered is an answer the worker never saw; re-surfacing it on the next resume is what lets the task continue instead of asking the same question again.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StoredAnswer ¶
type StoredAnswer struct {
// ItemID identifies the attention item the answer belongs to.
ItemID string
// Answer is the answer text, already formatted for display.
Answer string
}
StoredAnswer is an answer that was stored against a task's session but never delivered to that session.
type StoredAnswerReader ¶
type StoredAnswerReader interface {
FindUnconsumed(ctx context.Context, sessionID string) (*StoredAnswer, error)
}
StoredAnswerReader finds an unconsumed stored answer for a session.
It returns (nil, nil) when the session has no undelivered answered item.
func NewHTTPStoredAnswerReader ¶
func NewHTTPStoredAnswerReader(baseURL string, client *http.Client) StoredAnswerReader
NewHTTPStoredAnswerReader creates a reader backed by the attention store at baseURL. The caller owns client and must supply one with a timeout — a blackholed store must never block a resume forever.