change: AIAssert

This commit is contained in:
lilong.129
2025-03-25 14:33:07 +08:00
parent aeee9c7f7b
commit 7d5fdfe490
5 changed files with 34 additions and 3 deletions
+8
View File
@@ -55,6 +55,14 @@ func (dExt *XTDriver) AIAction(text string, opts ...option.ActionOption) error {
return nil
}
func (dExt *XTDriver) AIQuery(text string, opts ...option.ActionOption) (string, error) {
return "", nil
}
func (dExt *XTDriver) AIAssert(text string, opts ...option.ActionOption) error {
return nil
}
func (dExt *XTDriver) PlanNextAction(text string, opts ...option.ActionOption) (*ai.PlanningResult, error) {
if dExt.LLMService == nil {
return nil, errors.New("LLM service is not initialized")
+6 -1
View File
@@ -185,8 +185,12 @@ func (dExt *XTDriver) DoValidation(check, assert, expected string, message ...st
switch check {
case SelectorOCR:
err = dExt.assertOCR(expected, assert)
// case SelectorAI:
// // TODO
case SelectorForegroundApp:
err = dExt.assertForegroundApp(expected, assert)
default:
return fmt.Errorf("validator %s not implemented", check)
}
if err != nil {
@@ -198,7 +202,8 @@ func (dExt *XTDriver) DoValidation(check, assert, expected string, message ...st
return err
}
log.Info().Str("assert", assert).Str("expect", expected).Msg("validate success")
log.Info().Str("check", check).Str("assert", assert).
Str("expect", expected).Msg("validate success")
return nil
}