refactor: NewXTDriver api, return error if init failed

This commit is contained in:
lilong.129
2025-04-30 14:31:36 +08:00
parent 2ae252b52a
commit 0e9389c796
21 changed files with 146 additions and 146 deletions
+4 -3
View File
@@ -14,6 +14,7 @@ import (
"github.com/getkin/kin-openapi/openapi3gen"
"github.com/httprunner/httprunner/v5/code"
"github.com/httprunner/httprunner/v5/internal/json"
"github.com/httprunner/httprunner/v5/uixt/option"
"github.com/httprunner/httprunner/v5/uixt/types"
"github.com/pkg/errors"
"github.com/rs/zerolog/log"
@@ -57,11 +58,11 @@ func NewAsserter(ctx context.Context) (*Asserter, error) {
return nil, err
}
if strings.Contains(EnvModelUse, string(LLMServiceTypeUITARS)) {
if strings.Contains(EnvModelUse, string(option.LLMServiceTypeUITARS)) {
asserter.systemPrompt += "\n\n" + uiTarsAssertionResponseFormat
} else if strings.Contains(EnvModelUse, string(LLMServiceTypeQwenVL)) {
} else if strings.Contains(EnvModelUse, string(option.LLMServiceTypeQwenVL)) {
asserter.systemPrompt += "\n\n" + defaultAssertionResponseJsonFormat
} else if strings.Contains(EnvModelUse, string(LLMServiceTypeGPT)) {
} else if strings.Contains(EnvModelUse, string(option.LLMServiceTypeGPT)) {
// define output format
type OutputFormat struct {
Thought string `json:"thought"`