@faapi/faapi 4.4.0 → 5.0.0

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/dist/index.d.ts CHANGED
@@ -236,8 +236,9 @@ interface LlmModelConfig {
236
236
  * provider 级字段(`apiKey` / `baseURL`)共享给所有 model;
237
237
  * model 级字段在 `models[modelName]` 里覆盖 provider 级同名字段。
238
238
  *
239
- * `config.agent.llms` 的 key 是 provider 名(如 `'openai'` / `'anthropic'`),
240
- * `config.agent.defaultLlm` 指定默认 provider key(不传时用 `llms` 第一个 key)。
239
+ * `config.agent.llms` 的 key 是 provider 名(如 `'openai'` / `'anthropic'`)。
240
+ * 无全局默认 provider——每次 `agent.run/stream` 调用通过 `options.model`(llms key /
241
+ * `provider/model` / 纯 model 名)或 `options.provider`(外部 provider)显式指定。
241
242
  *
242
243
  * 由 Phase 3.2 的 `@faapi/agent` 插件读取,调 `createProvider` 创建实例存 Map。
243
244
  *
@@ -311,8 +312,11 @@ interface LlmConfig {
311
312
  /**
312
313
  * agent 子系统全局配置(Phase 2.4,Phase 3.5 LLM 配置改为嵌套级联)
313
314
  *
314
- * 提供 agent 子系统的全局默认值,所有字段均可选,未设置时用框架默认值。
315
- * agent 自身 `config.maxTurns` / `config.model` 优先于全局配置。
315
+ * 提供 agent 子系统的全局配置,所有字段均可选。
316
+ * 无全局默认 agent / 默认 provider——`agent.run/stream` 每次调用必须显式传
317
+ * `options.agent`(agent 名)和 `options.model` / `options.provider`(LLM 定位);
318
+ * agent 自身 `config.maxTurns` / `config.model` 优先于全局配置,其中 `config.model`
319
+ * 在调用未传 `options.model` 时作为缺省 key 参与 llms 解析。
316
320
  *
317
321
  * ```ts
318
322
  * import type { FaapiConfig } from '@faapi/faapi';
@@ -325,8 +329,6 @@ interface LlmConfig {
325
329
  * models: { 'gpt-4o': {}, 'gpt-4o-mini': { temperature: 0.5 } },
326
330
  * },
327
331
  * },
328
- * defaultLlm: 'openai',
329
- * defaultAgent: 'researcher',
330
332
  * maxTurns: 10,
331
333
  * maxAgentDepth: 3,
332
334
  * },
@@ -347,24 +349,6 @@ interface AgentConfig {
347
349
  * `agent.run/stream` 需通过 `options.provider` 传入外部 provider 才能调用 LLM。
348
350
  */
349
351
  llms?: Record<string, LlmConfig>;
350
- /**
351
- * 默认 provider key(Phase 3.5)
352
- *
353
- * `agent.run` 不传 `options.model` 时用此 key 对应的 provider 实例。
354
- * 未设置时用 `llms` 的第一个 key(`Object.keys(llms)[0]`)。
355
- */
356
- defaultLlm?: string;
357
- /**
358
- * 默认 agent 名,用于 `agent` 参数注入([injectParams](../injection/injectParams.md) Phase 2.3)
359
- *
360
- * Phase 2.3 的 `agent` 参数注入暂返回 `undefined`,Phase 3.x 的 @faapi/agent 插件
361
- * 读取此值从 [agentRegistry](../injection/agentRegistry.md) 查找对应 agent 元数据,
362
- * 注入 `AgentHandle`(含可调用 `run`)。
363
- *
364
- * 可选——未设时 handler 需通过 `agent.run(input, { agent: 'name' })` 显式指定 agent 名,
365
- * 否则 `agent.run` 抛 `AgentError`。
366
- */
367
- defaultAgent?: string;
368
352
  /**
369
353
  * 默认最大对话轮数(覆盖 agent 自身 `config.maxTurns`,agent 自身配置优先)
370
354
  *
@@ -596,9 +580,11 @@ interface FaapiConfig {
596
580
  /**
597
581
  * agent 子系统全局配置(Phase 2.4)
598
582
  *
599
- * 提供 agent 子系统的全局默认值:LLM 提供方、默认 agent、
600
- * 最大对话轮数、agent 调用 agent 的最大递归深度。
583
+ * 提供 agent 子系统的全局配置:LLM 提供方、最大对话轮数、
584
+ * agent 调用 agent 的最大递归深度。
601
585
  *
586
+ * 无全局默认 agent / 默认 provider——`agent.run/stream` 每次调用显式传
587
+ * `options.agent` + `options.model` / `options.provider`。
602
588
  * agent 自身 `config.maxTurns` / `config.model` 优先于全局配置。
603
589
  * tool 引用列表只在每个 agent 自身的 `config.tools` 里声明(无全局共享 defaultTools)。
604
590
  *
@@ -613,8 +599,6 @@ interface FaapiConfig {
613
599
  * models: { 'gpt-4o': {} },
614
600
  * },
615
601
  * },
616
- * defaultLlm: 'openai',
617
- * defaultAgent: 'researcher',
618
602
  * maxTurns: 10,
619
603
  * maxAgentDepth: 3,
620
604
  * },