tools

package
v1.0.0-rc.7 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: Apache-2.0 Imports: 22 Imported by: 0 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAuthError

func IsAuthError(err error) bool

func NewPersistentRepo

func NewPersistentRepo(
	localTools map[string]taskengine.ToolsRepo,
	dbInstance libdb.DBManager,
	httpClient *http.Client,
	messenger libbus.Messenger,
	tracker libtracker.ActivityTracker,
) taskengine.ToolsRepo

func NewSimpleProvider

func NewSimpleProvider(tools map[string]taskengine.ToolsRepo) taskengine.ToolsRepo

func PerformAuthFlow

func PerformAuthFlow(ctx context.Context, tools *runtimetypes.RemoteTools, client *http.Client) (map[string]ParamArg, error)

Types

type ArgLocation

type ArgLocation int
const (
	ArgLocationQuery ArgLocation = iota
	ArgLocationHeader
	ArgLocationPath
	ArgLocationBody
	ArgLocationArg
)

type AuthError

type AuthError struct {
	StatusCode int
	Body       string
}

func (*AuthError) Error

func (e *AuthError) Error() string

type MockToolsRepo

type MockToolsRepo struct {
	Calls           []ToolsCallRecord
	ResponseMap     map[string]ToolsResponse
	DefaultResponse ToolsResponse
	ErrorSequence   []error
	// contains filtered or unexported fields
}

func NewMockToolsRegistry

func NewMockToolsRegistry() *MockToolsRepo

func (*MockToolsRepo) CallCount

func (m *MockToolsRepo) CallCount() int

func (*MockToolsRepo) Exec

func (m *MockToolsRepo) Exec(
	ctx context.Context,
	startingTime time.Time,
	input any,
	debug bool,
	args *taskengine.ToolsCall,
) (any, taskengine.DataType, error)

func (*MockToolsRepo) GetSchemasForSupportedTools

func (m *MockToolsRepo) GetSchemasForSupportedTools(ctx context.Context) (map[string]*openapi3.T, error)

func (*MockToolsRepo) GetToolsForToolsByName

func (m *MockToolsRepo) GetToolsForToolsByName(ctx context.Context, name string) ([]taskengine.Tool, error)

func (*MockToolsRepo) LastCall

func (m *MockToolsRepo) LastCall() *ToolsCallRecord

func (*MockToolsRepo) Reset

func (m *MockToolsRepo) Reset()

func (*MockToolsRepo) Supports

func (m *MockToolsRepo) Supports(ctx context.Context) ([]string, error)

func (*MockToolsRepo) WithErrorSequence

func (m *MockToolsRepo) WithErrorSequence(errors ...error) *MockToolsRepo

func (*MockToolsRepo) WithResponse

func (m *MockToolsRepo) WithResponse(toolsType string, response ToolsResponse) *MockToolsRepo

type MultiRepo

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

func NewMultiRepo

func NewMultiRepo(repos ...taskengine.ToolsRepo) *MultiRepo

func (*MultiRepo) Exec

func (m *MultiRepo) Exec(ctx context.Context, startingTime time.Time, input any, debug bool, args *taskengine.ToolsCall) (any, taskengine.DataType, error)

func (*MultiRepo) GetSchemasForSupportedTools

func (m *MultiRepo) GetSchemasForSupportedTools(ctx context.Context) (map[string]*openapi3.T, error)

func (*MultiRepo) GetToolsForToolsByName

func (m *MultiRepo) GetToolsForToolsByName(ctx context.Context, name string) ([]taskengine.Tool, error)

func (*MultiRepo) Supports

func (m *MultiRepo) Supports(ctx context.Context) ([]string, error)

type OpenAPIToolProtocol

type OpenAPIToolProtocol struct {
	SpecSource string
}

func (*OpenAPIToolProtocol) ExecuteTool

func (p *OpenAPIToolProtocol) ExecuteTool(
	ctx context.Context,
	endpointURL string,
	httpClient *http.Client,
	injectParams map[string]ParamArg,
	toolCall taskengine.ToolCall,
) (interface{}, taskengine.DataType, error)

func (*OpenAPIToolProtocol) FetchSchema

func (p *OpenAPIToolProtocol) FetchSchema(ctx context.Context, endpointURL string, httpClient *http.Client) (*openapi3.T, error)

func (*OpenAPIToolProtocol) FetchTools

func (p *OpenAPIToolProtocol) FetchTools(ctx context.Context, endpointURL string, injectParams map[string]ParamArg, httpClient *http.Client) ([]taskengine.Tool, error)

type ParamArg

type ParamArg struct {
	Name  string
	Value string
	In    ArgLocation
}

type PersistentRepo

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

func (*PersistentRepo) Exec

func (p *PersistentRepo) Exec(
	ctx context.Context,
	startingTime time.Time,
	input any,
	debug bool,
	args *taskengine.ToolsCall,
) (any, taskengine.DataType, error)

func (*PersistentRepo) GetSchemasForSupportedTools

func (p *PersistentRepo) GetSchemasForSupportedTools(ctx context.Context) (map[string]*openapi3.T, error)

func (*PersistentRepo) GetToolsForToolsByName

func (p *PersistentRepo) GetToolsForToolsByName(ctx context.Context, name string) ([]taskengine.Tool, error)

func (*PersistentRepo) Supports

func (p *PersistentRepo) Supports(ctx context.Context) ([]string, error)

type SimpleRepo

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

func (*SimpleRepo) Exec

func (m *SimpleRepo) Exec(
	ctx context.Context,
	startingTime time.Time,
	input any,
	debug bool,
	args *taskengine.ToolsCall,
) (any, taskengine.DataType, error)

func (*SimpleRepo) GetSchemasForSupportedTools

func (m *SimpleRepo) GetSchemasForSupportedTools(ctx context.Context) (map[string]*openapi3.T, error)

func (*SimpleRepo) GetToolsForToolsByName

func (m *SimpleRepo) GetToolsForToolsByName(ctx context.Context, name string) ([]taskengine.Tool, error)

func (*SimpleRepo) Supports

func (m *SimpleRepo) Supports(ctx context.Context) ([]string, error)

type ToolProtocol

type ToolProtocol interface {
	FetchSchema(ctx context.Context, endpointURL string, httpClient *http.Client) (*openapi3.T, error)
	FetchTools(ctx context.Context, endpointURL string, injectParams map[string]ParamArg, httpClient *http.Client) ([]taskengine.Tool, error)
	ExecuteTool(
		ctx context.Context,
		endpointURL string,
		httpClient *http.Client,
		injectParams map[string]ParamArg,
		toolCall taskengine.ToolCall,
	) (interface{}, taskengine.DataType, error)
}

type ToolsCallRecord

type ToolsCallRecord struct {
	Args  taskengine.ToolsCall
	Input any
}

type ToolsResponse

type ToolsResponse struct {
	Output any
	Schema *openapi3.T
}

Jump to

Keyboard shortcuts

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