refactor: add LLMServiceTypeDoubaoVL

This commit is contained in:
lilong.129
2025-05-22 15:34:11 +08:00
parent 269fe2de23
commit c377664518
7 changed files with 20 additions and 9 deletions
+4 -1
View File
@@ -95,13 +95,16 @@ func GetModelConfig(modelType option.LLMServiceType) (*ModelConfig, error) {
"env %s missed", EnvModelName)
}
temperature := float32(0.7)
// https://www.volcengine.com/docs/82379/1536429
temperature := float32(0)
topP := float32(0.7)
modelConfig := &openai.ChatModelConfig{
BaseURL: openaiBaseURL,
APIKey: openaiAPIKey,
Model: modelName,
Timeout: defaultTimeout,
Temperature: &temperature,
TopP: &topP,
}
// log config info
+1 -1
View File
@@ -55,7 +55,7 @@ func NewAsserter(ctx context.Context, modelConfig *ModelConfig) (*Asserter, erro
if modelConfig.ModelType == option.LLMServiceTypeUITARS {
asserter.systemPrompt += "\n\n" + uiTarsAssertionResponseFormat
} else if modelConfig.ModelType == option.LLMServiceTypeGPT {
} else if modelConfig.ModelType == option.LLMServiceTypeDoubaoVL {
// define output format
type OutputFormat struct {
Thought string `json:"thought"`
+1 -1
View File
@@ -27,7 +27,7 @@ func NewLLMContentParser(modelType option.LLMServiceType) LLMContentParser {
return &UITARSContentParser{
systemPrompt: uiTarsPlanningPrompt,
}
case option.LLMServiceTypeGPT:
case option.LLMServiceTypeDoubaoVL:
return &JSONContentParser{
systemPrompt: defaultPlanningResponseJsonFormat,
}
+8 -1
View File
@@ -30,7 +30,14 @@ finished(content='xxx') # Use escape characters \\', \\", and \\n in content par
`
// system prompt for JSONContentParser
const defaultPlanningResponseJsonFormat = `You are a versatile professional in software UI automation.`
const defaultPlanningResponseJsonFormat = `You are a versatile professional in software UI automation.
## Output Format
` + "```" + `
Thought: ...
Action: ...
` + "```" + `
`
const defaultPlanningResponseStringFormat = `
You are a helpful assistant.