@dsh-plus/llm-pi 0.1.21 → 0.1.23

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.
package/lib/index.d.ts CHANGED
@@ -84,7 +84,7 @@ declare const Config: z<LlmPiConfig>;
84
84
  //#endregion
85
85
  //#region src/index.d.ts
86
86
  declare const name = "dsh-plus-llm-pi";
87
- declare const inject: readonly ["llm"];
87
+ declare const inject: readonly ["credentials", "llm"];
88
88
  declare function apply(ctx: Context, config: LlmPiConfig): Promise<void>;
89
89
  //#endregion
90
90
  export { Config, type LlmPiConfig, type ModelEntryConfig, type ProviderProfileConfig, SETTINGS_NS, apply, inject, name };
package/lib/index.js CHANGED
@@ -1435,6 +1435,7 @@ function resolveProfilesFallback(providers, deps) {
1435
1435
  if (factory === void 0) invalid(provider, `api ${JSON.stringify(api)} 本插件无法服务(支持:openai-completions/openai-responses/anthropic-messages)`);
1436
1436
  if (source.baseURL === void 0) invalid(provider, "需要 baseURL:官方 schema 无模型级端点,端点只能 route 级表达");
1437
1437
  const configuredMaxTokens = /* @__PURE__ */ new Map();
1438
+ const modelErrors = /* @__PURE__ */ new Map();
1438
1439
  const seen = /* @__PURE__ */ new Set();
1439
1440
  const models = (source.models ?? []).map((entry) => {
1440
1441
  if (entry.id.length === 0) invalid(provider, "存在空 id 的模型条目");
@@ -1474,6 +1475,7 @@ function resolveProfilesFallback(providers, deps) {
1474
1475
  ...rest.headers === void 0 ? {} : { headers: { ...rest.headers } },
1475
1476
  ...rest.thinkingBudgets === void 0 ? {} : { thinkingBudgets: { ...rest.thinkingBudgets } },
1476
1477
  configuredMaxTokens,
1478
+ modelErrors,
1477
1479
  piProvider: deps.createProvider({
1478
1480
  id: provider,
1479
1481
  name: displayName,
@@ -2109,7 +2111,7 @@ async function startRuntime(ctx, rawConfig) {
2109
2111
  //#endregion
2110
2112
  //#region src/index.ts
2111
2113
  const name = "dsh-plus-llm-pi";
2112
- const inject = ["llm"];
2114
+ const inject = ["credentials", "llm"];
2113
2115
  async function apply(ctx, config) {
2114
2116
  const runtime = await startRuntime(ctx, config);
2115
2117
  ctx.inject(["webServer"], (webCtx) => {