@adobe/spacecat-shared-gpt-client 1.5.21 → 1.6.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ # [@adobe/spacecat-shared-gpt-client-v1.6.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-gpt-client-v1.6.0...@adobe/spacecat-shared-gpt-client-v1.6.1) (2025-09-06)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **deps:** update external fixes ([#920](https://github.com/adobe/spacecat-shared/issues/920)) ([1a6b1e1](https://github.com/adobe/spacecat-shared/commit/1a6b1e1ac9531a41c86406ada4bd4ab903307fdc))
7
+
8
+ # [@adobe/spacecat-shared-gpt-client-v1.6.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-gpt-client-v1.5.21...@adobe/spacecat-shared-gpt-client-v1.6.0) (2025-09-03)
9
+
10
+
11
+ ### Features
12
+
13
+ * **gpt-client:** add optional system prompt to Azure OpenAI client ([#945](https://github.com/adobe/spacecat-shared/issues/945)) ([90f93e5](https://github.com/adobe/spacecat-shared/commit/90f93e5074ad0fd2df464f01b30edc4fe98b94cc))
14
+
1
15
  # [@adobe/spacecat-shared-gpt-client-v1.5.21](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-gpt-client-v1.5.20...@adobe/spacecat-shared-gpt-client-v1.5.21) (2025-08-25)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/spacecat-shared-gpt-client",
3
- "version": "1.5.21",
3
+ "version": "1.6.1",
4
4
  "description": "Shared modules of the Spacecat Services - GPT Client",
5
5
  "type": "module",
6
6
  "engines": {
@@ -40,11 +40,11 @@
40
40
  "@adobe/spacecat-shared-utils": "1.26.4"
41
41
  },
42
42
  "devDependencies": {
43
- "chai": "5.2.1",
44
- "chai-as-promised": "8.0.1",
45
- "nock": "14.0.9",
43
+ "chai": "5.3.3",
44
+ "chai-as-promised": "8.0.2",
45
+ "nock": "14.0.10",
46
46
  "sinon": "20.0.0",
47
- "sinon-chai": "4.0.0",
47
+ "sinon-chai": "4.0.1",
48
48
  "typescript": "5.9.2"
49
49
  }
50
50
  }
@@ -131,6 +131,7 @@ export default class AzureOpenAIClient {
131
131
  const {
132
132
  imageUrls,
133
133
  responseFormat,
134
+ systemPrompt,
134
135
  } = options || {};
135
136
  const hasImageUrls = imageUrls && imageUrls.length > 0;
136
137
 
@@ -164,7 +165,12 @@ export default class AzureOpenAIClient {
164
165
  ],
165
166
  };
166
167
 
167
- if (responseFormat === JSON_OBJECT_RESPONSE_FORMAT) {
168
+ if (systemPrompt) {
169
+ body.messages.unshift({
170
+ role: SYSTEM_ROLE,
171
+ content: systemPrompt,
172
+ });
173
+ } else if (responseFormat === JSON_OBJECT_RESPONSE_FORMAT) {
168
174
  body.response_format = {
169
175
  type: JSON_OBJECT_RESPONSE_FORMAT,
170
176
  };