ragtool

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ToolSearchName = "rag_search"
	ToolIngestName = "rag_ingest"

	SearchHint = "" /* 129-byte string literal not displayed */
	IngestHint = "Ingest a text document into a named corpus for later semantic search. Returns the number of indexed chunks."

	DefaultTopK = 5
)

Variables

This section is empty.

Functions

This section is empty.

Types

type IngestTool

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

IngestTool implements the rag_ingest tool.

func NewIngestTool

func NewIngestTool(svc *rag.Service) *IngestTool

NewIngestTool creates a new rag_ingest tool backed by the given RAG service.

func (*IngestTool) BackfillInput

func (t *IngestTool) BackfillInput(_ context.Context, input map[string]any) map[string]any

func (*IngestTool) Call

func (*IngestTool) CheckPermissions

func (t *IngestTool) CheckPermissions(_ context.Context, input map[string]any, _ tool.ToolUseContext) types.PermissionResult

func (*IngestTool) Definition

func (t *IngestTool) Definition() tool.Definition

func (*IngestTool) Description

func (t *IngestTool) Description(_ context.Context) (string, error)

func (*IngestTool) FormatResult

func (t *IngestTool) FormatResult(data any) string

func (*IngestTool) IsConcurrencySafe

func (t *IngestTool) IsConcurrencySafe(_ map[string]any) bool

func (*IngestTool) IsEnabled

func (t *IngestTool) IsEnabled() bool

func (*IngestTool) IsReadOnly

func (t *IngestTool) IsReadOnly(_ map[string]any) bool

func (*IngestTool) ValidateInput

func (t *IngestTool) ValidateInput(_ context.Context, input map[string]any) (map[string]any, error)

type SearchTool

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

SearchTool implements the rag_search tool.

func NewSearchTool

func NewSearchTool(svc *rag.Service) *SearchTool

NewSearchTool creates a new rag_search tool backed by the given RAG service.

func (*SearchTool) BackfillInput

func (t *SearchTool) BackfillInput(_ context.Context, input map[string]any) map[string]any

func (*SearchTool) Call

func (*SearchTool) CheckPermissions

func (t *SearchTool) CheckPermissions(_ context.Context, input map[string]any, _ tool.ToolUseContext) types.PermissionResult

func (*SearchTool) Definition

func (t *SearchTool) Definition() tool.Definition

func (*SearchTool) Description

func (t *SearchTool) Description(_ context.Context) (string, error)

func (*SearchTool) FormatResult

func (t *SearchTool) FormatResult(data any) string

func (*SearchTool) IsConcurrencySafe

func (t *SearchTool) IsConcurrencySafe(_ map[string]any) bool

func (*SearchTool) IsEnabled

func (t *SearchTool) IsEnabled() bool

func (*SearchTool) IsReadOnly

func (t *SearchTool) IsReadOnly(_ map[string]any) bool

func (*SearchTool) ValidateInput

func (t *SearchTool) ValidateInput(_ context.Context, input map[string]any) (map[string]any, error)

Jump to

Keyboard shortcuts

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