@rcrsr/rill-ext-openai 0.18.0 → 0.18.2

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.
Files changed (2) hide show
  1. package/dist/index.js +13 -1
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -1249,7 +1249,19 @@ function createOpenAIExtension(config) {
1249
1249
  if (!choice || typeof choice !== "object" || !("message" in choice)) {
1250
1250
  return null;
1251
1251
  }
1252
- return choice.message;
1252
+ const msg = choice.message;
1253
+ if (!msg || typeof msg !== "object") {
1254
+ return null;
1255
+ }
1256
+ const m = msg;
1257
+ const clean = {
1258
+ role: m["role"],
1259
+ content: m["content"]
1260
+ };
1261
+ if (m["tool_calls"]) {
1262
+ clean["tool_calls"] = m["tool_calls"];
1263
+ }
1264
+ return clean;
1253
1265
  },
1254
1266
  // Format tool results into OpenAI message format
1255
1267
  formatToolResult: (toolResults) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rcrsr/rill-ext-openai",
3
- "version": "0.18.0",
3
+ "version": "0.18.2",
4
4
  "description": "rill extension for OpenAI API integration",
5
5
  "license": "MIT",
6
6
  "author": "Andre Bremer",
@@ -25,7 +25,8 @@
25
25
  "dts-bundle-generator": "^9.5.1",
26
26
  "tsup": "^8.5.1",
27
27
  "undici-types": "^7.22.0",
28
- "@rcrsr/rill-ext-llm-shared": "^0.18.0"
28
+ "@rcrsr/rill-ext-llm-shared": "^0.18.1",
29
+ "@rcrsr/rill-ext-param-shared": "0.18.1"
29
30
  },
30
31
  "files": [
31
32
  "dist"
@@ -43,8 +44,7 @@
43
44
  "access": "public"
44
45
  },
45
46
  "dependencies": {
46
- "openai": "^6.25.0",
47
- "@rcrsr/rill-ext-param-shared": "0.18.0"
47
+ "openai": "^6.25.0"
48
48
  },
49
49
  "scripts": {
50
50
  "build": "tsup && dts-bundle-generator --config dts-bundle-generator.config.cjs",