diff --git a/internal/version/VERSION b/internal/version/VERSION index 7909f472..7ee1aa30 100644 --- a/internal/version/VERSION +++ b/internal/version/VERSION @@ -1 +1 @@ -v5.0.0-beta-2505182155 +v5.0.0-beta-2505191151 diff --git a/uixt/ai/ai.go b/uixt/ai/ai.go index 8e146a7d..a4bca54e 100644 --- a/uixt/ai/ai.go +++ b/uixt/ai/ai.go @@ -16,7 +16,7 @@ import ( // ILLMService 定义了 LLM 服务接口,包括规划和断言功能 type ILLMService interface { Call(ctx context.Context, opts *PlanningOptions) (*PlanningResult, error) - Assert(ctx context.Context, opts *AssertOptions) (*AssertionResponse, error) + Assert(ctx context.Context, opts *AssertOptions) (*AssertionResult, error) } func NewLLMService(modelType option.LLMServiceType) (ILLMService, error) { @@ -53,7 +53,7 @@ func (c *combinedLLMService) Call(ctx context.Context, opts *PlanningOptions) (* } // Assert 执行断言功能 -func (c *combinedLLMService) Assert(ctx context.Context, opts *AssertOptions) (*AssertionResponse, error) { +func (c *combinedLLMService) Assert(ctx context.Context, opts *AssertOptions) (*AssertionResult, error) { return c.asserter.Assert(ctx, opts) } diff --git a/uixt/ai/asserter.go b/uixt/ai/asserter.go index 0f31d5ec..0a3a4f11 100644 --- a/uixt/ai/asserter.go +++ b/uixt/ai/asserter.go @@ -22,7 +22,7 @@ import ( // IAsserter interface defines the contract for assertion operations type IAsserter interface { - Assert(ctx context.Context, opts *AssertOptions) (*AssertionResponse, error) + Assert(ctx context.Context, opts *AssertOptions) (*AssertionResult, error) } // AssertOptions represents the input options for assertion @@ -32,8 +32,8 @@ type AssertOptions struct { Size types.Size `json:"size"` // Screen dimensions } -// AssertionResponse represents the response from an AI assertion -type AssertionResponse struct { +// AssertionResult represents the response from an AI assertion +type AssertionResult struct { Pass bool `json:"pass"` Thought string `json:"thought"` } @@ -91,7 +91,7 @@ func NewAsserter(ctx context.Context, modelConfig *ModelConfig) (*Asserter, erro } // Assert performs the assertion check on the screenshot -func (a *Asserter) Assert(ctx context.Context, opts *AssertOptions) (*AssertionResponse, error) { +func (a *Asserter) Assert(ctx context.Context, opts *AssertOptions) (*AssertionResult, error) { // Validate input parameters if err := validateAssertionInput(opts); err != nil { return nil, errors.Wrap(err, "validate assertion parameters failed") @@ -169,7 +169,7 @@ func validateAssertionInput(opts *AssertOptions) error { } // parseAssertionResult parses the model response into AssertionResponse -func parseAssertionResult(content string) (*AssertionResponse, error) { +func parseAssertionResult(content string) (*AssertionResult, error) { // Extract JSON content from response jsonContent := extractJSON(content) if jsonContent == "" { @@ -177,7 +177,7 @@ func parseAssertionResult(content string) (*AssertionResponse, error) { } // Parse JSON response - var result AssertionResponse + var result AssertionResult if err := json.Unmarshal([]byte(jsonContent), &result); err != nil { return nil, errors.Wrap(code.LLMParseAssertionResponseError, err.Error()) }