larkin 0.2.89 → 0.2.90

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -600,7 +600,11 @@ export async function main() {
600
600
  }
601
601
  if (!setupApiKey)
602
602
  throw new Error("builtin-pi 需要 --api-key;或改用 --runtime external-pi 使用已有 pi 登录");
603
- const presetId = setupProvider ?? "custom";
603
+ // 自定义网关(--base-url)走 custom 预设:pi 会把 baseUrl 作为 provider 端点写入配置,
604
+ // 而不是用预设厂商目录(否则会打到预设默认地址,如 api.openai.com)。
605
+ const presetId = setupBaseUrl ? "custom" : (setupProvider ?? "custom");
606
+ if (presetId === "custom" && !setupModel)
607
+ throw new Error("custom base-url 需要 --model <模型名>");
604
608
  const presetDef = PI_PROVIDER_PRESETS.find((p) => p.id === presetId);
605
609
  if (!presetDef && !setupBaseUrl)
606
610
  throw new Error(`未知 provider \`${presetId}\`;可选:${PI_PROVIDER_PRESETS.map((p) => p.id).join(" | ")} | custom`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "larkin",
3
- "version": "0.2.89",
3
+ "version": "0.2.90",
4
4
  "private": false,
5
5
  "larkinPackageRole": "npm-published",
6
6
  "files": [