@morlay/dsh-llm-openai-compatible 0.0.9-alpha.6 → 0.0.9-alpha.8
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/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +15 -13
- package/src/index.ts +4 -1
- package/src/serialize.ts +6 -6
package/locale/en.json
ADDED
package/locale/zh.json
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@morlay/dsh-llm-openai-compatible",
|
|
3
|
-
"version": "0.0.9-alpha.
|
|
3
|
+
"version": "0.0.9-alpha.8",
|
|
4
4
|
"description": "OpenAI-compatible LLM adapter plugin for DeepSeek Harness with configurable default sampling parameters (temperature / topP / topK / penalties / seed) over a providers dict.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dsh",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"url": "https://github.com/morlay/dsh-plugin.git"
|
|
17
17
|
},
|
|
18
18
|
"files": [
|
|
19
|
+
"locale/*.json",
|
|
19
20
|
"dist",
|
|
20
21
|
"src",
|
|
21
22
|
"cordis.patch.yml",
|
|
@@ -27,24 +28,25 @@
|
|
|
27
28
|
"./invariant": "./dist/invariant.mjs",
|
|
28
29
|
"./wire": "./dist/wire.mjs",
|
|
29
30
|
"./package.json": "./package.json",
|
|
30
|
-
"./cordis.patch.yml": "./cordis.patch.yml"
|
|
31
|
+
"./cordis.patch.yml": "./cordis.patch.yml",
|
|
32
|
+
"./locale/*.json": "./locale/*.json"
|
|
31
33
|
},
|
|
32
34
|
"dependencies": {
|
|
33
35
|
"@ai-sdk/openai-compatible": "^3.0.32",
|
|
34
36
|
"@ai-sdk/provider": "^4.0.7",
|
|
35
|
-
"@deepseek-ai/dsh-util-values": "0.1.7-
|
|
37
|
+
"@deepseek-ai/dsh-util-values": "0.1.7-rc.1"
|
|
36
38
|
},
|
|
37
39
|
"peerDependencies": {
|
|
38
|
-
"@deepseek-ai/cordis": "4.0.
|
|
39
|
-
"@deepseek-ai/dsh-anonymous-user-id": "0.1.7-
|
|
40
|
-
"@deepseek-ai/dsh-attachment": "0.1.7-
|
|
41
|
-
"@deepseek-ai/dsh-credentials": "0.1.7-
|
|
42
|
-
"@deepseek-ai/dsh-invariants": "0.1.7-
|
|
43
|
-
"@deepseek-ai/dsh-launch-environment": "0.1.7-
|
|
44
|
-
"@deepseek-ai/dsh-llm": "0.1.7-
|
|
45
|
-
"@deepseek-ai/dsh-settings": "0.1.7-
|
|
46
|
-
"@deepseek-ai/dsh-timeout": "0.1.7-
|
|
47
|
-
"@deepseek-ai/schemastery": "3.18.
|
|
40
|
+
"@deepseek-ai/cordis": "4.0.4",
|
|
41
|
+
"@deepseek-ai/dsh-anonymous-user-id": "0.1.7-rc.1",
|
|
42
|
+
"@deepseek-ai/dsh-attachment": "0.1.7-rc.1",
|
|
43
|
+
"@deepseek-ai/dsh-credentials": "0.1.7-rc.1",
|
|
44
|
+
"@deepseek-ai/dsh-invariants": "0.1.7-rc.1",
|
|
45
|
+
"@deepseek-ai/dsh-launch-environment": "0.1.7-rc.1",
|
|
46
|
+
"@deepseek-ai/dsh-llm": "0.1.7-rc.1",
|
|
47
|
+
"@deepseek-ai/dsh-settings": "0.1.7-rc.1",
|
|
48
|
+
"@deepseek-ai/dsh-timeout": "0.1.7-rc.1",
|
|
49
|
+
"@deepseek-ai/schemastery": "3.18.4"
|
|
48
50
|
},
|
|
49
51
|
"dsh": {
|
|
50
52
|
"bundle": {
|
package/src/index.ts
CHANGED
|
@@ -510,7 +510,10 @@ export function apply(ctx: Context, config: Config): void {
|
|
|
510
510
|
if (this !== ctx.fiber) return raw;
|
|
511
511
|
const candidate = Config(raw as Options);
|
|
512
512
|
assertServiceable({
|
|
513
|
-
providers: structuredClone(candidate.providers.get()) as Record<
|
|
513
|
+
providers: structuredClone(candidate.providers.get()) as Record<
|
|
514
|
+
string,
|
|
515
|
+
ProviderProfileSource
|
|
516
|
+
>,
|
|
514
517
|
});
|
|
515
518
|
return raw;
|
|
516
519
|
});
|
package/src/serialize.ts
CHANGED
|
@@ -86,11 +86,7 @@ function assertTextOnly(blocks: readonly ContentBlock[]): void {
|
|
|
86
86
|
function assertSupportedImageRoles(messages: readonly RequestMessage[]): void {
|
|
87
87
|
for (const message of messages) {
|
|
88
88
|
// 图片只出现在 user 与 tool 消息里;tool 结果的图片由 serializePrompt 聚成一条 user 消息发出。
|
|
89
|
-
if (
|
|
90
|
-
message.role !== "user" &&
|
|
91
|
-
message.role !== "tool" &&
|
|
92
|
-
contentHasImage(message.content)
|
|
93
|
-
) {
|
|
89
|
+
if (message.role !== "user" && message.role !== "tool" && contentHasImage(message.content)) {
|
|
94
90
|
throw new LlmError(
|
|
95
91
|
`The OpenAI-compatible chat-completions adapter cannot represent image content in a ${message.role} message.`,
|
|
96
92
|
"UNSUPPORTED_CONTENT",
|
|
@@ -240,7 +236,11 @@ async function serializePrompt(
|
|
|
240
236
|
"UNSUPPORTED_CONTENT",
|
|
241
237
|
);
|
|
242
238
|
}
|
|
243
|
-
if (
|
|
239
|
+
if (
|
|
240
|
+
message.content.some(
|
|
241
|
+
(block) => block.type === "tool-addition" || block.type === "tool-removal",
|
|
242
|
+
)
|
|
243
|
+
) {
|
|
244
244
|
throw new LlmError(
|
|
245
245
|
"The OpenAI-compatible chat-completions adapter cannot serialize tool-change blocks outside developer messages.",
|
|
246
246
|
"UNSUPPORTED_CONTENT",
|