@cobrowser/chatgpt 0.7.14 → 0.7.16

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.
@@ -15,5 +15,5 @@ export declare class AssistantService extends BaseService {
15
15
  *
16
16
  * @param message
17
17
  */
18
- getReply(message: string): Promise<ChatGptResponse | undefined>;
18
+ getReply(message: string, instructions?: string): Promise<ChatGptResponse | undefined>;
19
19
  }
@@ -51,7 +51,7 @@ class AssistantService extends BaseService_1.default {
51
51
  *
52
52
  * @param message
53
53
  */
54
- getReply(message) {
54
+ getReply(message, instructions) {
55
55
  var _a;
56
56
  return __awaiter(this, void 0, void 0, function* () {
57
57
  if (!this.assistantId || !this.threadId) {
@@ -68,7 +68,7 @@ class AssistantService extends BaseService_1.default {
68
68
  }
69
69
  else {
70
70
  yield openai.beta.threads.messages.create(this.threadId, { role: "user", content: message });
71
- run = yield openai.beta.threads.runs.create(this.threadId, { assistant_id: (_a = this.assistantId) !== null && _a !== void 0 ? _a : '' });
71
+ run = yield openai.beta.threads.runs.create(this.threadId, { assistant_id: (_a = this.assistantId) !== null && _a !== void 0 ? _a : '', additional_instructions: instructions });
72
72
  }
73
73
  while (['queued', 'in_progress', 'cancelling'].includes(run.status)) {
74
74
  yield new Promise(resolve => setTimeout(resolve, 500));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cobrowser/chatgpt",
3
- "version": "0.7.14",
3
+ "version": "0.7.16",
4
4
  "description": "chatgpt services to connect our projects with chatgpt api",
5
5
  "keywords": [
6
6
  "chatgpt",
@@ -21,10 +21,10 @@
21
21
  "precommit": "npm run lint && npm run test && npm run upgrade && npm run security"
22
22
  },
23
23
  "dependencies": {
24
- "@cobrowser/logger": "^1.0.0",
24
+ "@cobrowser/logger": "^2.0.2",
25
25
  "axios": "^1.6.1",
26
26
  "axios-mock-adapter": "^1.22.0",
27
- "openai": "^4.32.0"
27
+ "openai": "^4.52.7"
28
28
  },
29
29
  "directories": {
30
30
  "dist": "dist"
@@ -38,5 +38,6 @@
38
38
  },
39
39
  "bugs": {
40
40
  "url": "https://bitbucket.org/cobrowser/cb_utils/issues"
41
- }
41
+ },
42
+ "gitHead": "23465cb98f9e2332a7ca4c1ad7cc792aca472a1c"
42
43
  }