Documentation
¶
Overview ¶
Package mock provides configurable mock implementations of interfaces for use in tests across the go-llm module.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockTool ¶
type MockTool struct {
tool.DefaultTool
Name_ string
Description_ string
InputSchema_ *jsonschema.Schema
InputSchemaErr_ error
Result_ any
RunFn func(ctx context.Context, input json.RawMessage) (any, error)
}
MockTool is a configurable implementation of llm.Tool for use in tests. Set Name_, Description_, and Result_ before registering it on a server. RunFn, if set, overrides Result_ and is called with the raw JSON input. InputSchemaErr_, if set, makes InputSchema() return that error.
func (*MockTool) Description ¶
func (*MockTool) InputSchema ¶
func (m *MockTool) InputSchema() (*jsonschema.Schema, error)
Click to show internal directories.
Click to hide internal directories.