mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-02 14:29:44 +08:00
fix: 修复 StartToGoal 命令无法通过 CTRL+C 中断的问题
- 为 AI 相关方法添加 context.Context 参数支持中断 - 在重试循环中添加上下文取消检查 - 创建可取消的上下文并监听中断信号 - 更新 MCP 工具调用使用带上下文的方法 现在用户可以通过 CTRL+C 正常中断长时间运行的 AI 自动化任务
This commit is contained in:
@@ -130,18 +130,21 @@ func GetModelConfig(modelType option.LLMServiceType) (*ModelConfig, error) {
|
||||
func validateModelType(modelType option.LLMServiceType, modelName string) error {
|
||||
switch modelType {
|
||||
case option.DOUBAO_1_5_UI_TARS_250428:
|
||||
if !strings.Contains(modelName, "ui-tars") {
|
||||
if !strings.Contains(modelName, string(modelType)) {
|
||||
return fmt.Errorf("model name %s is not supported for %s", modelName, modelType)
|
||||
}
|
||||
return nil
|
||||
case option.DOUBAO_1_5_THINKING_VISION_PRO_250428:
|
||||
if !strings.Contains(modelName, "doubao") || !strings.Contains(modelName, "vision") {
|
||||
if !strings.Contains(modelName, string(modelType)) {
|
||||
return fmt.Errorf("model name %s is not supported", modelName)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
return fmt.Errorf("model type %s is not supported", modelType)
|
||||
return fmt.Errorf("model type %s is not supported, supported types: %s, %s",
|
||||
modelType,
|
||||
option.DOUBAO_1_5_UI_TARS_250428,
|
||||
option.DOUBAO_1_5_THINKING_VISION_PRO_250428)
|
||||
}
|
||||
|
||||
// maskAPIKey masks the API key
|
||||
|
||||
Reference in New Issue
Block a user