custom-provider-pi 0.1.1 → 0.1.2

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.
@@ -510,7 +510,11 @@ function buildProviderConfig(provider: IProvider): ProviderConfig {
510
510
  name: provider.name,
511
511
  baseUrl: provider.baseUrl,
512
512
  // LB 模式:apiKey 用占位符(SDK 生成 Bearer <placeholder>,before_provider_headers 替换)
513
- apiKey: provider.lbKeys && provider.lbKeys.length > 0 ? "$LB" : (provider.apiKey ?? "local"),
513
+ // LB 模式:apiKey 用第一个 key 的原始值作占位(保证 pi 鉴权检查通过,
514
+ // before_provider_headers 会在发送前替换为轮询到的真实 key)
515
+ apiKey: provider.lbKeys && provider.lbKeys.length > 0
516
+ ? resolveValue(provider.lbKeys[0]) || "lb-pool"
517
+ : (provider.apiKey ?? "local"),
514
518
  models: provider.models.map((m) => prepareModel(m, provider)),
515
519
  };
516
520
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "custom-provider-pi",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "pi 扩展:统一管理第三方模型 Provider。子命令体系 /custom-provider add|remove|refresh|list|test|config|enable|disable|prune,支持交互向导、flags/JSON 非交互添加、双协议混用(OpenAI + Anthropic)、模型关键字过滤与修剪",
5
5
  "keywords": [
6
6
  "pi-package",