@molecule/api-ai-zhipu 1.2.0 → 1.2.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.
@@ -1 +1 @@
1
- {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EACV,UAAU,EAQX,MAAM,kBAAkB,CAAA;AASzB,OAAO,cAAc,CAAA;AAErB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AA8oB7C;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,UAAU,CAE/D"}
1
+ {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EACV,UAAU,EAQX,MAAM,kBAAkB,CAAA;AASzB,OAAO,cAAc,CAAA;AAErB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAkpB7C;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,UAAU,CAE/D"}
package/dist/provider.js CHANGED
@@ -303,6 +303,11 @@ class ZhipuAIProvider {
303
303
  for (const tr of toolResults) {
304
304
  formatted.push(tr);
305
305
  }
306
+ // Non-tool parts of the SAME message (an image riding a tool result — the
307
+ // screenshot tool) must not be dropped: Chat Completions accepts a user
308
+ // message after the tool messages, so emit them instead of losing them.
309
+ if (parts.length > 0)
310
+ formatted.push({ role: m.role, content: parts });
306
311
  }
307
312
  else if (toolCalls.length > 0) {
308
313
  // Assistant message with tool calls
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@molecule/api-ai-zhipu",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Zhipu GLM AI provider for molecule.dev",
5
5
  "homepage": "https://www.molecule.dev/packages/api-ai-zhipu",
6
6
  "type": "module",