Documentation
¶
Overview ¶
Package echo is a minimal example of a custom Glue provider.
It implements the glue.Provider interface by echoing the most recent user message back as the assistant's text. There is no model, no network call, and no tool support — just the smallest amount of code that satisfies the interface so a downstream package can be wired into glue.NewAgent without importing providers/gemini.
Use this as a template when adding a new production provider:
- copy the Provider type and Provider.Stream method shape
- replace the body of stream() with your network code
- emit ProviderEventStart, then any number of ProviderEventTextDelta / ProviderEventThinkingDelta / ProviderEventToolCall events, then exactly one ProviderEventDone or ProviderEventError
- remember that the channel must be closed (the loop relies on a closed channel after Done to release the receive goroutine)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct {
// Prefix is prepended to the echoed text. Optional.
Prefix string
}
Provider is a Glue provider that echoes the user's last text back.
func (*Provider) Stream ¶
func (p *Provider) Stream(ctx context.Context, req glue.ProviderRequest) (<-chan glue.ProviderEvent, error)
Stream implements glue.Provider.
Click to show internal directories.
Click to hide internal directories.