rag

package
v1.58.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventCallback

type EventCallback func(event ragtypes.Event)

EventCallback is called to forward RAG manager events during initialization.

type Tool

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

Tool provides document querying capabilities for a single RAG source.

func NewRAGTool

func NewRAGTool(manager *rag.Manager, toolName string) *Tool

NewRAGTool creates a new RAG tool for a single RAG manager.

func (*Tool) Instructions

func (t *Tool) Instructions() string

func (*Tool) Name

func (t *Tool) Name() string

Name returns the tool name for this RAG source.

func (*Tool) SetEventCallback

func (t *Tool) SetEventCallback(cb EventCallback)

SetEventCallback sets a callback to receive RAG manager events during initialization. Must be called before Start().

func (*Tool) Start

func (t *Tool) Start(ctx context.Context) error

Start initializes the RAG manager (indexes documents) and starts a file watcher for incremental updates.

func (*Tool) Stop

func (t *Tool) Stop(_ context.Context) error

Stop closes the RAG manager and releases resources.

func (*Tool) Tools

func (t *Tool) Tools(context.Context) ([]tools.Tool, error)

Jump to

Keyboard shortcuts

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