@morlay/dsh-llm-openai-compatible 0.0.9-alpha.7 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@morlay/dsh-llm-openai-compatible",
3
- "version": "0.0.9-alpha.7",
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",
@@ -34,18 +34,18 @@
34
34
  "dependencies": {
35
35
  "@ai-sdk/openai-compatible": "^3.0.32",
36
36
  "@ai-sdk/provider": "^4.0.7",
37
- "@deepseek-ai/dsh-util-values": "0.1.7-alpha.2"
37
+ "@deepseek-ai/dsh-util-values": "0.1.7-rc.1"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "@deepseek-ai/cordis": "4.0.4",
41
- "@deepseek-ai/dsh-anonymous-user-id": "0.1.7-alpha.2",
42
- "@deepseek-ai/dsh-attachment": "0.1.7-alpha.2",
43
- "@deepseek-ai/dsh-credentials": "0.1.7-alpha.2",
44
- "@deepseek-ai/dsh-invariants": "0.1.7-alpha.2",
45
- "@deepseek-ai/dsh-launch-environment": "0.1.7-alpha.2",
46
- "@deepseek-ai/dsh-llm": "0.1.7-alpha.2",
47
- "@deepseek-ai/dsh-settings": "0.1.7-alpha.2",
48
- "@deepseek-ai/dsh-timeout": "0.1.7-alpha.2",
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
49
  "@deepseek-ai/schemastery": "3.18.4"
50
50
  },
51
51
  "dsh": {
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<string, ProviderProfileSource>,
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 (message.content.some((block) => block.type === "tool-addition" || block.type === "tool-removal")) {
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",