flipped-aurora/gin-vue-admin · error

请先前往插件市场个人中心获取 AiPath 并填写到 config.yaml 中

Error message

请先前往插件市场个人中心获取 AiPath 并填写到 config.yaml 中

What it means

buildLLMAutoPath() builds the endpoint path used by LLMAuto/LLMAutoStream from config AutoCode.AiPath, substituting {FUNC} with the requested mode. If AiPath is empty in config.yaml, it returns '请先前往插件市场个人中心获取 AiPath 并填写到 config.yaml 中', instructing the user to configure the AI path obtained from the plugin marketplace personal center.

Source

Thrown at server/service/system/auto_code_llm.go:93

		http.MethodPost,
		map[string]string{
			"Accept":          "text/event-stream",
			"Accept-Encoding": "identity", // 禁止 gzip,避免 SSE 流被压缩导致缓冲卡住
			"Cache-Control":   "no-cache",
		},
		nil,
		payload,
		-1, // 不设置 client.Timeout,SSE 流的生命周期由 ctx 控制
	)
	if err != nil {
		return nil, fmt.Errorf("调用上游大模型流式服务失败: %w", err)
	}
	return res, nil
}

func buildLLMAutoPath(llm common.JSONMap) (string, error) {
	if global.GVA_CONFIG.AutoCode.AiPath == "" {
		return "", errors.New("请先前往插件市场个人中心获取 AiPath 并填写到 config.yaml 中")
	}

	mode := strings.TrimSpace(fmt.Sprintf("%v", llm["mode"]))
	if mode == "" {
		return "", errors.New("llmAuto 缺少 mode 参数")
	}

	return strings.ReplaceAll(global.GVA_CONFIG.AutoCode.AiPath, "{FUNC}", mode), nil
}

func cloneLLMAutoJSONMap(src common.JSONMap) common.JSONMap {
	dst := make(common.JSONMap, len(src))
	for key, value := range src {
		dst[key] = value
	}
	return dst
}

View on GitHub (pinned to 3136500ef3)

Solutions

  1. Log into the plugin marketplace personal center and copy your personal AiPath.
  2. Paste it into config.yaml under the auto-code section (AutoCode.AiPath) and restart the server.
  3. Verify the YAML key matches the config struct tag so it actually binds to GVA_CONFIG.AutoCode.AiPath.
  4. After upgrading, re-apply the AiPath if config.yaml was regenerated.

Example fix

# before: config.yaml missing the AI path
auto-code:
  ai-path: ""
# after
auto-code:
  ai-path: "https://plugin.gin-vue-admin.com/api/aiAuto/{FUNC}?token=xxxx"
Defensive patterns

Strategy: validation

Validate before calling

// check before invoking LLMAuto endpoints
const cfg = readGvaConfig()
if (!cfg['auto-code'] || !cfg['auto-code']['ai-path']) {
  throw new Error('set auto-code.ai-path in config.yaml (get it from plugin marketplace personal center)')
}

Try / catch

try {
  path, err := buildLLMAutoPath(llm)
  _ = path
} catch (err) {
  if (strings.Contains(err.Error(), "AiPath")) {
    // prompt admin to configure GVA_CONFIG.AutoCode.AiPath
  } else {
    panic(err)
  }
}

Prevention

When it happens

Trigger: Calling LLMAuto or LLMAutoStream (auto-code AI generation endpoints) while system.auto-code.ai-path (the AutoCode.AiPath config key) is unset or empty in config.yaml.

Common situations: Fresh gin-vue-admin deployment where config.yaml was never customized; user has a marketplace account but never copied the AiPath into config; config was overwritten during an upgrade; typo in the config key so the value doesn't bind to the struct.

Related errors


AI-assisted analysis of flipped-aurora/gin-vue-admin@3136500ef3 (2026-08-31). Data as JSON: /api/errors/be56d425d9a60112. Report an issue: GitHub.