Documentation
¶
Overview ¶
Package todo provides a context provider that gives agents todo list management tools for tracking work items during long-running complex tasks.
The provider exposes five tools to the agent: todos_add, todos_complete, todos_remove, todos_get_remaining, and todos_get_all.
Todo state is stored in the agent session and persists across invocations.
Index ¶
- type CompleteInput
- type Item
- type ItemInput
- type Options
- type Provider
- func (p *Provider) GetAllItems(opts ...agent.Option) []Item
- func (p *Provider) GetRemainingItems(opts ...agent.Option) []Item
- func (p *Provider) Invoked(ctx context.Context, invoked agent.InvokedContext) error
- func (p *Provider) Invoking(ctx context.Context, invoking agent.InvokingContext) ([]*message.Message, []agent.Option, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CompleteInput ¶
CompleteInput is the input structure for completing a single todo item. It carries the item ID and a reason describing how or why the item was completed.
type Item ¶
type Item struct {
ID int `json:"id"`
Title string `json:"title"`
Description string `json:"description,omitempty"`
IsComplete bool `json:"isComplete"`
}
Item represents a single todo item.
type ItemInput ¶
type ItemInput struct {
Title string `json:"title"`
Description string `json:"description,omitempty"`
}
ItemInput is the input structure for adding a todo item.
type Options ¶
type Options struct {
// Instructions overrides the default instructions provided to the agent.
Instructions *string
// SuppressTodoListMessage, when true, prevents injecting the current todo
// list summary message on each invocation.
SuppressTodoListMessage bool
// TodoListMessageBuilder, if set, is used to format the todo list summary
// message instead of the default formatter.
TodoListMessageBuilder func([]Item) string
}
Options configures the todo provider.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider is an agent context provider that manages todo items. Use New to create. Provider can be used directly in agent configuration.
func New ¶
New creates a new todo provider with the given options. If opts is nil, defaults are used.
func (*Provider) GetAllItems ¶
GetAllItems returns all todo items from the session state.
func (*Provider) GetRemainingItems ¶
GetRemainingItems returns only the incomplete todo items from the session state.