@izzai/one-js 1.0.2 → 1.0.5
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/services/chat.js
CHANGED
|
@@ -10,12 +10,15 @@ const qs_1 = require("qs");
|
|
|
10
10
|
const base_1 = require("./base");
|
|
11
11
|
class ChatService extends base_1.BaseService {
|
|
12
12
|
async chat(msg, options, messageMode = 'user-message') {
|
|
13
|
-
const
|
|
13
|
+
const chatOptions = {
|
|
14
14
|
msg,
|
|
15
15
|
...(0, defaults_1.default)(options, {
|
|
16
16
|
datasources: [],
|
|
17
17
|
}),
|
|
18
|
-
}
|
|
18
|
+
};
|
|
19
|
+
chatOptions.tags ||= [];
|
|
20
|
+
chatOptions.tags.push('one-js-sdk');
|
|
21
|
+
const response = await this.sendPost('/v1/chat', chatOptions).then((res) => res.json());
|
|
19
22
|
if (!response.messages?.length) {
|
|
20
23
|
throw new http_errors_1.default.InternalServerError('No messages found in response');
|
|
21
24
|
}
|
package/package.json
CHANGED
/package/{readme.md → README.md}
RENAMED
|
File without changes
|