Documentation
¶
Index ¶
- type ActionHandlerCapture
- type ActionTestFramework
- func (f *ActionTestFramework) AssertActionCalled(actionName string)
- func (f *ActionTestFramework) AssertActionFailed(actionName string)
- func (f *ActionTestFramework) AssertActionNotCalled(actionName string)
- func (f *ActionTestFramework) AssertActionSucceeded(actionName string)
- func (f *ActionTestFramework) AssertFeedbackContains(actionName string, substring string)
- func (f *ActionTestFramework) AssertLoopContextInt(key string, expectedValue int)
- func (f *ActionTestFramework) AssertLoopContextValue(key string, expectedValue interface{})
- func (f *ActionTestFramework) ExecuteAction(actionName string, params map[string]interface{}) error
- func (f *ActionTestFramework) GetAICallCount() int
- func (f *ActionTestFramework) GetActionCapture(actionName string) *ActionHandlerCapture
- func (f *ActionTestFramework) GetLoop() *reactloops.ReActLoop
- func (f *ActionTestFramework) GetTask() aicommon.AIStatefulTask
- func (f *ActionTestFramework) RegisterTestAction(actionName string, description string, ...)
- func (f *ActionTestFramework) Reset()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionHandlerCapture ¶
type ActionHandlerCapture struct {
Called bool
Action *aicommon.Action
Operator *reactloops.LoopActionHandlerOperator
FeedbackMsg string
Failed bool
FailedMsg string
Continued bool
Terminated bool
CalledCount int
}
ActionHandlerCapture captures information about action handler execution
type ActionTestFramework ¶
type ActionTestFramework struct {
// contains filtered or unexported fields
}
ActionTestFramework provides utilities for testing ReAct loop actions
func NewActionTestFramework ¶
func NewActionTestFramework(t *testing.T, loopName string, options ...reactloops.ReActLoopOption) *ActionTestFramework
NewActionTestFramework creates a new action testing framework
func NewActionTestFrameworkEx ¶
func NewActionTestFrameworkEx( t *testing.T, loopName string, loopOptions []reactloops.ReActLoopOption, aiConfigOptions []aicommon.ConfigOption, ) *ActionTestFramework
NewActionTestFrameworkEx creates a new action testing framework with extended options It supports both ReActLoop options and AI config options
func (*ActionTestFramework) AssertActionCalled ¶
func (f *ActionTestFramework) AssertActionCalled(actionName string)
AssertActionCalled asserts that an action was called
func (*ActionTestFramework) AssertActionFailed ¶
func (f *ActionTestFramework) AssertActionFailed(actionName string)
AssertActionFailed asserts that an action failed
func (*ActionTestFramework) AssertActionNotCalled ¶
func (f *ActionTestFramework) AssertActionNotCalled(actionName string)
AssertActionNotCalled asserts that an action was not called
func (*ActionTestFramework) AssertActionSucceeded ¶
func (f *ActionTestFramework) AssertActionSucceeded(actionName string)
AssertActionSucceeded asserts that an action succeeded (continued or terminated without failure)
func (*ActionTestFramework) AssertFeedbackContains ¶
func (f *ActionTestFramework) AssertFeedbackContains(actionName string, substring string)
AssertFeedbackContains asserts that the feedback message contains a substring
func (*ActionTestFramework) AssertLoopContextInt ¶
func (f *ActionTestFramework) AssertLoopContextInt(key string, expectedValue int)
AssertLoopContextInt asserts an int value in the loop context
func (*ActionTestFramework) AssertLoopContextValue ¶
func (f *ActionTestFramework) AssertLoopContextValue(key string, expectedValue interface{})
AssertLoopContextValue asserts a value in the loop context
func (*ActionTestFramework) ExecuteAction ¶
func (f *ActionTestFramework) ExecuteAction(actionName string, params map[string]interface{}) error
ExecuteAction executes a specific action with given parameters
func (*ActionTestFramework) GetAICallCount ¶
func (f *ActionTestFramework) GetAICallCount() int
GetAICallCount returns the number of AI calls made
func (*ActionTestFramework) GetActionCapture ¶
func (f *ActionTestFramework) GetActionCapture(actionName string) *ActionHandlerCapture
GetActionCapture returns the capture information for a specific action
func (*ActionTestFramework) GetLoop ¶
func (f *ActionTestFramework) GetLoop() *reactloops.ReActLoop
GetLoop returns the underlying ReActLoop for custom operations
func (*ActionTestFramework) GetTask ¶
func (f *ActionTestFramework) GetTask() aicommon.AIStatefulTask
GetTask returns the captured task
func (*ActionTestFramework) RegisterTestAction ¶
func (f *ActionTestFramework) RegisterTestAction( actionName string, description string, verifier func(loop *reactloops.ReActLoop, action *aicommon.Action) error, handler func(loop *reactloops.ReActLoop, action *aicommon.Action, op *reactloops.LoopActionHandlerOperator), )
RegisterTestAction registers an action for testing and captures its execution
func (*ActionTestFramework) Reset ¶
func (f *ActionTestFramework) Reset()
Reset resets all captured state (useful for multiple test cases)