Documentation
¶
Overview ¶
Package webhook is the namespace of the webhooks' tools, of a webhook server, whose URLs external services call, and which is watched for their calls
Index ¶
- Constants
- type Namespace
- func (*Namespace) Description() string
- func (*Namespace) Name() string
- func (ns *Namespace) Run(ctx context.Context, logger *slog.Logger) error
- func (*Namespace) SystemPrompt() string
- func (ns *Namespace) Tools() []llm.Tool
- func (*Namespace) Type() string
- func (ns *Namespace) Watch(ctx context.Context, ch chan<- eventschema.Change) error
Constants ¶
const Name = "webhook"
Name is the name of the namespace of the webhooks' tools
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Namespace ¶
type Namespace struct {
// contains filtered or unexported fields
}
Namespace is the namespace of the webhooks' tools, of a webhook server
func New ¶
New returns the namespace of the webhook server's API, at the endpoint, such as http://localhost:8087/api, with the client options. The server isn't called until the namespace is run, or a tool is called.
func (*Namespace) Description ¶
Description returns what the namespace's tools are for
func (*Namespace) Run ¶
Run watches the webhook server for the calls of its webhooks, and logs each to the logger, until the context is cancelled, when it returns nil. It says whether the call was accepted, or refused, but not what was sent.
When the server can't be reached, or stops, it tries again, waiting longer each time, and then logs the calls which it missed, after the last which it logged, as it does when it's run again. Those which were received before the first it's told of aren't. Returns ErrConflict when it's running already.
func (*Namespace) SystemPrompt ¶
SystemPrompt returns no system prompt, as the tools' descriptions say how to use them