prompts

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler func(prompt protocol.Prompt, arguments map[string]string) (*protocol.PromptMessage, error)

Handler is a function that generates a prompt message based on arguments

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry provides a simple way to register individual prompts

func NewRegistry

func NewRegistry() *Registry

NewRegistry creates a new prompt registry

func (*Registry) GetPrompt

func (r *Registry) GetPrompt(_ context.Context, name string, arguments map[string]string) (*protocol.PromptMessage, error)

GetPrompt implements PromptProvider interface

func (*Registry) ListPrompts

func (r *Registry) ListPrompts(_ context.Context, cursor string) ([]protocol.Prompt, string, error)

ListPrompts implements PromptProvider interface

func (*Registry) RegisterPrompt

func (r *Registry) RegisterPrompt(prompt protocol.Prompt)

RegisterPrompt adds a prompt to the registry

func (*Registry) RegisterPromptWithHandler

func (r *Registry) RegisterPromptWithHandler(prompt protocol.Prompt, handler Handler)

RegisterPromptWithHandler adds a prompt with a custom handler to the registry

func (*Registry) UnregisterPrompt

func (r *Registry) UnregisterPrompt(name string)

UnregisterPrompt removes a prompt from the registry

Directories

Path Synopsis
providers

Jump to

Keyboard shortcuts

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