@deepseek-ai/dsh-llm 0.1.0-rc.8 → 0.1.1-rc.1
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/README.i18n.yaml +1 -1
- package/README.zh.md +6 -2
- package/package.json +9 -9
package/README.i18n.yaml
CHANGED
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
# after editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write packages/llm/llm/README.md
|
|
5
5
|
README.md: e6b3c4924ad4e7cf115abdbfb38d22d0f524e377
|
|
6
|
-
README.zh.md:
|
|
6
|
+
README.zh.md: 91f1c6ede2b800671b35a90d02a23a6d79e96e0e
|
package/README.zh.md
CHANGED
|
@@ -63,9 +63,11 @@
|
|
|
63
63
|
|
|
64
64
|
`LlmCallConfig` 记录一个会话的模型请求所使用的提供方、模型、由适配器定义的可选推理强度,以及采样参数(`provider`、`model`、`reasoningEffort`、`temperature`、`maxTokens`、`stop`,分别与同名 `GenerateOptions` 字段一一对应)。它是作为请求标头一部分记录在会话日志中的每会话状态(见 dsh-session `request/header` 事件),绝不是可静默调整的每次调用旋钮:`agent/request` waterfall 会提议替换,`prepareCall()` 在轮次 signal 控制下校验它并填入适配器默认值,loop 随后记录生效值以及标明哪些字段由适配器默认值填入的标记,再使用已准备调用中与注册绑定的流。下一次提议会省略带标记的默认值,使变更后的路由解析自身的值;未带标记的显式字段会保留。`callConfigEquals(a, b)` 是逐字段真实变更检测器;`deepFreeze(value)` 是 loop 使用的请求所有权辅助函数:每个构造完成的请求都会在分发前深度冻结;`llm/stream` 监听器和适配器只能读取,绝不能改写。`markAgentLoopRequest()` 将该精确对象标记为由进程本地 agent loop 创建,`isAgentLoopRequest()` 让观测方可以将其与同样可能冻结并关联会话、但独立记录的辅助调用区分。`GenerateOptions.purpose` 会对已记录的辅助压缩和会话标题调用进行分类,使适配器可以按调用目的应用不同的传输策略,而不改变普通会话请求。
|
|
65
65
|
|
|
66
|
+
<a id="app-attribution-attributionts"></a>
|
|
67
|
+
|
|
66
68
|
### 应用归因(`attribution.ts`)
|
|
67
69
|
|
|
68
|
-
每个产品适配器都会在提供方 HTTP 请求上发送应用身份。`attributionHeaders(identity?)` 构建标准 `User-Agent`,默认为公开 `APP_IDENTITY`;白标部署可以替换它,但不能抑制它。适配器会直接验证 wire 标头,或通过自身库 hook 验证。详见 [归因 Agent Note](../../../.agents/notes/implemented/architecture/2026-06-21-mandatory-app-attribution-headers.md)。
|
|
70
|
+
每个产品适配器都会在提供方 HTTP 请求上发送应用身份。`attributionHeaders(identity?)` 构建标准 `User-Agent`,默认为公开 `APP_IDENTITY`;白标部署可以替换它,但不能抑制它。适配器会直接验证 wire 标头,或通过自身库 hook 验证。详见 [归因 Agent Note](../../../.agents/notes/implemented/architecture/2026-06-21-mandatory-app-attribution-headers.zh.md)。
|
|
69
71
|
|
|
70
72
|
### API 密钥校验(`api-key.ts`)
|
|
71
73
|
|
|
@@ -85,7 +87,7 @@
|
|
|
85
87
|
|
|
86
88
|
### 真实适配器
|
|
87
89
|
|
|
88
|
-
两个适配器使用不同内部机制实现 `LlmAdapter`:[`@deepseek-ai/dsh-llm-deepseek`](../llm-deepseek) 针对 `deepseek-official` 路由使用直接 fetch 加 `eventsource-parser` SSE(Server-Sent Events)分帧,[`@deepseek-ai/dsh-llm-pi-ai`](../llm-pi-ai) 则通过 `@earendil-works/pi-ai` 动态解析已配置提供方/模型对。两者都遵循 `types.ts` 中的 `StreamChunk` 约定:usage 先于 finish,工具参数保持原始字符串。适配器实现在内部可以抛出异常或发出失败 finish;`LlmRuntime` 会将两者都暴露为终止失败 finish。适配器理由见[双 LLM 适配器](../../../.agents/notes/implemented/architecture/2026-06-13-twin-llm-adapters.md),服务边界见[终止失败决策](../../../.agents/notes/implemented/architecture/2026-07-29-terminal-llm-stream-failures.md)。
|
|
90
|
+
两个适配器使用不同内部机制实现 `LlmAdapter`:[`@deepseek-ai/dsh-llm-deepseek`](../llm-deepseek) 针对 `deepseek-official` 路由使用直接 fetch 加 `eventsource-parser` SSE(Server-Sent Events)分帧,[`@deepseek-ai/dsh-llm-pi-ai`](../llm-pi-ai) 则通过 `@earendil-works/pi-ai` 动态解析已配置提供方/模型对。两者都遵循 `types.ts` 中的 `StreamChunk` 约定:usage 先于 finish,工具参数保持原始字符串。适配器实现在内部可以抛出异常或发出失败 finish;`LlmRuntime` 会将两者都暴露为终止失败 finish。适配器理由见[双 LLM 适配器](../../../.agents/notes/implemented/architecture/2026-06-13-twin-llm-adapters.zh.md),服务边界见[终止失败决策](../../../.agents/notes/implemented/architecture/2026-07-29-terminal-llm-stream-failures.zh.md)。
|
|
89
91
|
|
|
90
92
|
## 模型体验
|
|
91
93
|
|
|
@@ -95,6 +97,8 @@
|
|
|
95
97
|
|
|
96
98
|
透传;注册表保留已组装请求前缀,cache 复用与路由边界属于所选适配器和提供方。
|
|
97
99
|
|
|
100
|
+
<a id="known-limitations-and-deferred-work"></a>
|
|
101
|
+
|
|
98
102
|
## 已知限制与暂缓事项
|
|
99
103
|
|
|
100
104
|
- **本服务不执行重试、缓存或速率限制**:提供方注册会存储重试策略,但 `llm/stream` 仍是单次尝试调用包装层。agent loop 会将已验证模型请求失败单独提供给 `agent/request-error`,其默认行为是保留原始失败;`@deepseek-ai/dsh-llm-retry` 是共享示例主干加载的可选执行器。
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-llm",
|
|
3
3
|
"description": "Provider-neutral LLM service interface for the DeepSeek Harness",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.1-rc.1",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -45,20 +45,20 @@
|
|
|
45
45
|
],
|
|
46
46
|
"license": "MIT",
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@deepseek-ai/dsh-attachment": "^0.1.
|
|
49
|
-
"@deepseek-ai/dsh-brand": "^0.1.
|
|
50
|
-
"@deepseek-ai/dsh-invariants": "^0.1.
|
|
51
|
-
"@deepseek-ai/dsh-timeout": "^0.1.
|
|
48
|
+
"@deepseek-ai/dsh-attachment": "^0.1.1-rc.1",
|
|
49
|
+
"@deepseek-ai/dsh-brand": "^0.1.1-rc.1",
|
|
50
|
+
"@deepseek-ai/dsh-invariants": "^0.1.1-rc.1",
|
|
51
|
+
"@deepseek-ai/dsh-timeout": "^0.1.1-rc.1",
|
|
52
52
|
"@deepseek-ai/cordis": "^4.0.1"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@deepseek-ai/schemastery": "^3.18.1"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@deepseek-ai/dsh-attachment": "^0.1.
|
|
59
|
-
"@deepseek-ai/dsh-brand": "^0.1.
|
|
60
|
-
"@deepseek-ai/dsh-invariants": "^0.1.
|
|
61
|
-
"@deepseek-ai/dsh-timeout": "^0.1.
|
|
58
|
+
"@deepseek-ai/dsh-attachment": "^0.1.1-rc.1",
|
|
59
|
+
"@deepseek-ai/dsh-brand": "^0.1.1-rc.1",
|
|
60
|
+
"@deepseek-ai/dsh-invariants": "^0.1.1-rc.1",
|
|
61
|
+
"@deepseek-ai/dsh-timeout": "^0.1.1-rc.1",
|
|
62
62
|
"@deepseek-ai/cordis": "^4.0.1"
|
|
63
63
|
}
|
|
64
64
|
}
|