@premai/api-sdk 1.0.45 → 1.0.47

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/dist/index.cjs CHANGED
@@ -2017,6 +2017,10 @@ function anthropicMessagesCreateToOpenAI(body) {
2017
2017
  messages.push(...systemToOpenAiMessages(body.system));
2018
2018
  }
2019
2019
  for (const m of body.messages) {
2020
+ if (m.role === "system") {
2021
+ messages.push(...systemToOpenAiMessages(m.content));
2022
+ continue;
2023
+ }
2020
2024
  if (m.role !== "user" && m.role !== "assistant") {
2021
2025
  throw new AnthropicRequestValidationError(`Invalid message role "${m.role}".`);
2022
2026
  }
package/dist/index.mjs CHANGED
@@ -1932,6 +1932,10 @@ function anthropicMessagesCreateToOpenAI(body) {
1932
1932
  messages.push(...systemToOpenAiMessages(body.system));
1933
1933
  }
1934
1934
  for (const m of body.messages) {
1935
+ if (m.role === "system") {
1936
+ messages.push(...systemToOpenAiMessages(m.content));
1937
+ continue;
1938
+ }
1935
1939
  if (m.role !== "user" && m.role !== "assistant") {
1936
1940
  throw new AnthropicRequestValidationError(`Invalid message role "${m.role}".`);
1937
1941
  }
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  },
5
5
  "homepage": "https://github.com/premai-io/api-sdk-ts",
6
6
  "name": "@premai/api-sdk",
7
- "version": "1.0.45",
7
+ "version": "1.0.47",
8
8
  "main": "./dist/index.cjs",
9
9
  "bin": {
10
10
  "confidential-proxy": "./dist/cli.mjs",
@@ -79,6 +79,7 @@
79
79
  "bare-fs": "^4.7.1",
80
80
  "bare-process": "^4.4.1",
81
81
  "bare-url": "^2.4.3",
82
+ "commander": "^15.0.0",
82
83
  "date-fns": "^4.1.0",
83
84
  "dotenv": "^17.2.3",
84
85
  "env-paths": "^4.0.0",