Documentation
¶
Index ¶
- func IsAuthError(err error) bool
- func NewPersistentRepo(localTools map[string]taskengine.ToolsRepo, dbInstance libdb.DBManager, ...) taskengine.ToolsRepo
- func NewSimpleProvider(tools map[string]taskengine.ToolsRepo) taskengine.ToolsRepo
- func PerformAuthFlow(ctx context.Context, tools *runtimetypes.RemoteTools, client *http.Client) (map[string]ParamArg, error)
- type ArgLocation
- type AuthError
- type MockToolsRepo
- func (m *MockToolsRepo) CallCount() int
- func (m *MockToolsRepo) Exec(ctx context.Context, startingTime time.Time, input any, debug bool, ...) (any, taskengine.DataType, error)
- func (m *MockToolsRepo) GetSchemasForSupportedTools(ctx context.Context) (map[string]*openapi3.T, error)
- func (m *MockToolsRepo) GetToolsForToolsByName(ctx context.Context, name string) ([]taskengine.Tool, error)
- func (m *MockToolsRepo) LastCall() *ToolsCallRecord
- func (m *MockToolsRepo) Reset()
- func (m *MockToolsRepo) Supports(ctx context.Context) ([]string, error)
- func (m *MockToolsRepo) WithErrorSequence(errors ...error) *MockToolsRepo
- func (m *MockToolsRepo) WithResponse(toolsType string, response ToolsResponse) *MockToolsRepo
- type MultiRepo
- func (m *MultiRepo) Exec(ctx context.Context, startingTime time.Time, input any, debug bool, ...) (any, taskengine.DataType, error)
- func (m *MultiRepo) GetSchemasForSupportedTools(ctx context.Context) (map[string]*openapi3.T, error)
- func (m *MultiRepo) GetToolsForToolsByName(ctx context.Context, name string) ([]taskengine.Tool, error)
- func (m *MultiRepo) Supports(ctx context.Context) ([]string, error)
- type OpenAPIToolProtocol
- func (p *OpenAPIToolProtocol) ExecuteTool(ctx context.Context, endpointURL string, httpClient *http.Client, ...) (interface{}, taskengine.DataType, error)
- func (p *OpenAPIToolProtocol) FetchSchema(ctx context.Context, endpointURL string, httpClient *http.Client) (*openapi3.T, error)
- func (p *OpenAPIToolProtocol) FetchTools(ctx context.Context, endpointURL string, injectParams map[string]ParamArg, ...) ([]taskengine.Tool, error)
- type ParamArg
- type PersistentRepo
- func (p *PersistentRepo) Exec(ctx context.Context, startingTime time.Time, input any, debug bool, ...) (any, taskengine.DataType, error)
- func (p *PersistentRepo) GetSchemasForSupportedTools(ctx context.Context) (map[string]*openapi3.T, error)
- func (p *PersistentRepo) GetToolsForToolsByName(ctx context.Context, name string) ([]taskengine.Tool, error)
- func (p *PersistentRepo) Supports(ctx context.Context) ([]string, error)
- type SimpleRepo
- func (m *SimpleRepo) Exec(ctx context.Context, startingTime time.Time, input any, debug bool, ...) (any, taskengine.DataType, error)
- func (m *SimpleRepo) GetSchemasForSupportedTools(ctx context.Context) (map[string]*openapi3.T, error)
- func (m *SimpleRepo) GetToolsForToolsByName(ctx context.Context, name string) ([]taskengine.Tool, error)
- func (m *SimpleRepo) Supports(ctx context.Context) ([]string, error)
- type ToolProtocol
- type ToolsCallRecord
- type ToolsResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsAuthError ¶
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 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 (*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) GetSchemasForSupportedTools ¶
func (*MultiRepo) GetToolsForToolsByName ¶
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 (*OpenAPIToolProtocol) FetchTools ¶
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 (*PersistentRepo) GetToolsForToolsByName ¶
func (p *PersistentRepo) GetToolsForToolsByName(ctx context.Context, name string) ([]taskengine.Tool, 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 (*SimpleRepo) GetToolsForToolsByName ¶
func (m *SimpleRepo) GetToolsForToolsByName(ctx context.Context, name string) ([]taskengine.Tool, 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 ¶
Click to show internal directories.
Click to hide internal directories.