Documentation
¶
Index ¶
- type MockLLMClient
- func (m *MockLLMClient) Chat(ctx context.Context, messages []llm.Message) (*llm.CompletionResponse, error)
- func (m *MockLLMClient) Complete(ctx context.Context, req *llm.CompletionRequest) (*llm.CompletionResponse, error)
- func (m *MockLLMClient) GetRequestHistory() []llm.CompletionRequest
- func (m *MockLLMClient) IsAvailable() bool
- func (m *MockLLMClient) Provider() constants.Provider
- func (m *MockLLMClient) Reset()
- func (m *MockLLMClient) SetError(shouldError bool, message string)
- func (m *MockLLMClient) SetFunctionCallMode(enabled bool)
- func (m *MockLLMClient) SetFunctionResponse(functionName string, response interface{})
- func (m *MockLLMClient) SetResponses(responses ...llm.CompletionResponse)
- type MockState
- func (m *MockState) Clear()
- func (m *MockState) Clone() state.State
- func (m *MockState) Delete(key string)
- func (m *MockState) Get(key string) (interface{}, bool)
- func (m *MockState) GetBool(key string) (bool, bool)
- func (m *MockState) GetFloat64(key string) (float64, bool)
- func (m *MockState) GetInt(key string) (int, bool)
- func (m *MockState) GetStats() (getCount, setCount int)
- func (m *MockState) GetString(key string) (string, bool)
- func (m *MockState) GetTime(key string) (time.Time, bool)
- func (m *MockState) Keys() []string
- func (m *MockState) Restore(snapshot map[string]interface{})
- func (m *MockState) Set(key string, value interface{})
- func (m *MockState) SetUpdateFunc(fn func(key string, value interface{}) error)
- func (m *MockState) Size() int
- func (m *MockState) Snapshot() map[string]interface{}
- func (m *MockState) Update(updates map[string]interface{})
- type MockStore
- func (s *MockStore) Clear(ctx context.Context, namespace []string) error
- func (s *MockStore) Delete(ctx context.Context, namespace []string, key string) error
- func (s *MockStore) Get(ctx context.Context, namespace []string, key string) (*store.Value, error)
- func (s *MockStore) GetStats() (putCount, getCount int)
- func (s *MockStore) List(ctx context.Context, namespace []string) ([]string, error)
- func (s *MockStore) Namespaces() []string
- func (s *MockStore) Put(ctx context.Context, namespace []string, key string, value interface{}) error
- func (s *MockStore) Search(ctx context.Context, namespace []string, filter map[string]interface{}) ([]*store.Value, error)
- func (s *MockStore) SetError(shouldError bool, message string)
- func (s *MockStore) Size() int
- type MockStreamingLLMClient
- type MockTool
- func (m *MockTool) Description() string
- func (m *MockTool) GetInvokeCount() int
- func (m *MockTool) GetLastInput() *interfaces.ToolInput
- func (m *MockTool) Invoke(ctx context.Context, input *interfaces.ToolInput) (*interfaces.ToolOutput, error)
- func (m *MockTool) Name() string
- func (m *MockTool) Reset()
- func (m *MockTool) Schema() string
- func (m *MockTool) SetError(shouldError bool, message string)
- func (m *MockTool) SetInvokeFunc(...)
- type MockToolExecutor
- func (e *MockToolExecutor) ExecuteParallel(ctx context.Context, toolList []interfaces.Tool, ...) ([]interface{}, error)
- func (e *MockToolExecutor) GetExecuteCalls() int
- func (e *MockToolExecutor) Reset()
- func (e *MockToolExecutor) SetError(shouldError bool, message string)
- func (e *MockToolExecutor) SetExecuteFunc(...)
- func (e *MockToolExecutor) SetParallelResults(results ...interface{})
- type MockToolRegistry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockLLMClient ¶
type MockLLMClient struct {
// contains filtered or unexported fields
}
MockLLMClient provides a mock implementation of the LLM client for testing
func NewMockLLMClient ¶
func NewMockLLMClient() *MockLLMClient
NewMockLLMClient creates a new mock LLM client
func (*MockLLMClient) Chat ¶
func (m *MockLLMClient) Chat(ctx context.Context, messages []llm.Message) (*llm.CompletionResponse, error)
Chat implements the chat method
func (*MockLLMClient) Complete ¶
func (m *MockLLMClient) Complete(ctx context.Context, req *llm.CompletionRequest) (*llm.CompletionResponse, error)
Complete implements the LLM completion method
func (*MockLLMClient) GetRequestHistory ¶
func (m *MockLLMClient) GetRequestHistory() []llm.CompletionRequest
GetRequestHistory returns the history of requests made
func (*MockLLMClient) IsAvailable ¶
func (m *MockLLMClient) IsAvailable() bool
IsAvailable returns whether the client is available
func (*MockLLMClient) Provider ¶
func (m *MockLLMClient) Provider() constants.Provider
Provider returns the provider type
func (*MockLLMClient) SetError ¶
func (m *MockLLMClient) SetError(shouldError bool, message string)
SetError configures the client to return an error
func (*MockLLMClient) SetFunctionCallMode ¶
func (m *MockLLMClient) SetFunctionCallMode(enabled bool)
SetFunctionCallMode enables function calling mode
func (*MockLLMClient) SetFunctionResponse ¶
func (m *MockLLMClient) SetFunctionResponse(functionName string, response interface{})
SetFunctionResponse sets a response for a specific function
func (*MockLLMClient) SetResponses ¶
func (m *MockLLMClient) SetResponses(responses ...llm.CompletionResponse)
SetResponses sets the predefined responses to return
type MockState ¶
type MockState struct {
// contains filtered or unexported fields
}
MockState provides a mock implementation of the State interface
func (*MockState) GetFloat64 ¶
GetFloat64 gets a float64 value
func (*MockState) SetUpdateFunc ¶
SetUpdateFunc sets a function to call on updates
type MockStore ¶
type MockStore struct {
// contains filtered or unexported fields
}
MockStore provides a mock implementation of the Store interface
func (*MockStore) Namespaces ¶
Namespaces returns all namespaces
func (*MockStore) Put ¶
func (s *MockStore) Put(ctx context.Context, namespace []string, key string, value interface{}) error
Put stores an item
func (*MockStore) Search ¶
func (s *MockStore) Search(ctx context.Context, namespace []string, filter map[string]interface{}) ([]*store.Value, error)
Search searches for items
type MockStreamingLLMClient ¶
type MockStreamingLLMClient struct {
*MockLLMClient
// contains filtered or unexported fields
}
MockStreamingLLMClient provides streaming capabilities
func NewMockStreamingLLMClient ¶
func NewMockStreamingLLMClient() *MockStreamingLLMClient
NewMockStreamingLLMClient creates a new streaming mock client
func (*MockStreamingLLMClient) SetStreamChunks ¶
func (m *MockStreamingLLMClient) SetStreamChunks(chunks ...string)
SetStreamChunks sets the chunks to stream
func (*MockStreamingLLMClient) Stream ¶
func (m *MockStreamingLLMClient) Stream(ctx context.Context, req *llm.CompletionRequest) (<-chan llm.StreamChunk, error)
Stream implements streaming completion
type MockTool ¶
type MockTool struct {
// contains filtered or unexported fields
}
MockTool provides a mock implementation of the Tool interface
func NewMockTool ¶
NewMockTool creates a new mock tool
func (*MockTool) Description ¶
Description returns the tool description
func (*MockTool) GetInvokeCount ¶
GetInvokeCount returns the number of times the tool was invoked
func (*MockTool) GetLastInput ¶
func (m *MockTool) GetLastInput() *interfaces.ToolInput
GetLastInput returns the last input passed to the tool
func (*MockTool) Invoke ¶
func (m *MockTool) Invoke(ctx context.Context, input *interfaces.ToolInput) (*interfaces.ToolOutput, error)
Invoke executes the tool
func (*MockTool) SetInvokeFunc ¶
func (m *MockTool) SetInvokeFunc(fn func(ctx context.Context, input *interfaces.ToolInput) (*interfaces.ToolOutput, error))
SetInvokeFunc sets a custom invoke function
type MockToolExecutor ¶
type MockToolExecutor struct {
// contains filtered or unexported fields
}
MockToolExecutor provides a mock tool executor
func NewMockToolExecutor ¶
func NewMockToolExecutor() *MockToolExecutor
NewMockToolExecutor creates a new mock tool executor
func (*MockToolExecutor) ExecuteParallel ¶
func (e *MockToolExecutor) ExecuteParallel(ctx context.Context, toolList []interfaces.Tool, inputs []map[string]interface{}) ([]interface{}, error)
ExecuteParallel executes tools in parallel
func (*MockToolExecutor) GetExecuteCalls ¶
func (e *MockToolExecutor) GetExecuteCalls() int
GetExecuteCalls returns the number of execute calls
func (*MockToolExecutor) SetError ¶
func (e *MockToolExecutor) SetError(shouldError bool, message string)
SetError configures the executor to return an error
func (*MockToolExecutor) SetExecuteFunc ¶
func (e *MockToolExecutor) SetExecuteFunc(fn func(ctx context.Context, tools []interfaces.Tool, inputs []map[string]interface{}) ([]interface{}, error))
SetExecuteFunc sets a custom execute function
func (*MockToolExecutor) SetParallelResults ¶
func (e *MockToolExecutor) SetParallelResults(results ...interface{})
SetParallelResults sets the results to return
type MockToolRegistry ¶
type MockToolRegistry struct {
// contains filtered or unexported fields
}
MockToolRegistry provides a mock tool registry
func NewMockToolRegistry ¶
func NewMockToolRegistry() *MockToolRegistry
NewMockToolRegistry creates a new mock tool registry
func (*MockToolRegistry) Get ¶
func (r *MockToolRegistry) Get(name string) (interfaces.Tool, bool)
Get retrieves a tool by name
func (*MockToolRegistry) List ¶
func (r *MockToolRegistry) List() []interfaces.Tool
List lists all registered tools
func (*MockToolRegistry) Register ¶
func (r *MockToolRegistry) Register(tool interfaces.Tool) error
Register registers a tool