Help us shape the future of Go! Take the 2026 Go Developer Survey

ragtool

package
v1.11.13 Latest Latest
Warning

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

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

Documentation

Index

Constants

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

	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."
	DeleteHint = "Delete an entire corpus, or a single file's chunks within a corpus."

	DefaultTopK = 5
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DeleteTool

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

DeleteTool implements the rag_delete tool.

func NewDeleteTool

func NewDeleteTool(svc *rag.Service) *DeleteTool

NewDeleteTool creates a new rag_delete tool backed by the given RAG service.

func (*DeleteTool) BackfillInput

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

func (*DeleteTool) Call

func (*DeleteTool) CheckPermissions

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

func (*DeleteTool) Definition

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

func (*DeleteTool) Description

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

func (*DeleteTool) FormatResult

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

func (*DeleteTool) IsConcurrencySafe

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

func (*DeleteTool) IsEnabled

func (t *DeleteTool) IsEnabled() bool

func (*DeleteTool) IsReadOnly

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

func (*DeleteTool) ValidateInput

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

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