webhook

package
v1.7.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 23 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
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

func New(endpoint string, opts ...client.ClientOpt) (*Namespace, error)

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

func (*Namespace) Description() string

Description returns what the namespace's tools are for

func (*Namespace) Name

func (*Namespace) Name() string

func (*Namespace) Run

func (ns *Namespace) Run(ctx context.Context, logger *slog.Logger) error

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

func (*Namespace) SystemPrompt() string

SystemPrompt returns no system prompt, as the tools' descriptions say how to use them

func (*Namespace) Tools

func (ns *Namespace) Tools() []llm.Tool

Tools returns the namespace's tools

func (*Namespace) Type

func (*Namespace) Type() string

Type returns that the namespace's tools are built in

func (*Namespace) Watch

func (ns *Namespace) Watch(ctx context.Context, ch chan<- eventschema.Change) error

Watch sends the namespace's tools, which don't change

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL