@cobrowser/chatgpt 0.7.42-beta.1 → 0.7.42-beta.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.
|
@@ -63,7 +63,14 @@ class CopilotService extends BaseService_1.default {
|
|
|
63
63
|
*/
|
|
64
64
|
suggest(conversation, suggestionLanguage) {
|
|
65
65
|
return __awaiter(this, void 0, void 0, function* () {
|
|
66
|
-
logger_1.default.info({
|
|
66
|
+
logger_1.default.info({
|
|
67
|
+
suggestionLanguage,
|
|
68
|
+
conversation,
|
|
69
|
+
model: this.chatGPTModel,
|
|
70
|
+
threadId: this.threadId,
|
|
71
|
+
assistantId: this.assistantId,
|
|
72
|
+
conversationId: this.conversationId,
|
|
73
|
+
}, ':: CopilotServicee.suggest :: Fetching suggestions... ::');
|
|
67
74
|
if (!(conversation === null || conversation === void 0 ? void 0 : conversation.length)) {
|
|
68
75
|
logger_1.default.error('Conversation must be provided');
|
|
69
76
|
return Promise.reject(new Error('Conversation must be provided'));
|
|
@@ -80,10 +87,13 @@ class CopilotService extends BaseService_1.default {
|
|
|
80
87
|
}
|
|
81
88
|
// Route based on id shape: asst_* => Assistant API, prompt_* => Responses API
|
|
82
89
|
if (yield this.isAssistantIdFormat(this.assistantId)) {
|
|
90
|
+
logger_1.default.info(':: CopilotServicee.suggest :: Fetching suggestion through Assistant API ::');
|
|
83
91
|
return yield this.getAssistantSuggestions(conversation, suggestionLanguage);
|
|
84
92
|
}
|
|
93
|
+
logger_1.default.info(':: CopilotServicee.suggest :: Fetching suggestion through Responses API ::');
|
|
85
94
|
return yield this.getPromptSuggestions(conversation, suggestionLanguage);
|
|
86
95
|
}
|
|
96
|
+
logger_1.default.info(':: CopilotServicee.suggest :: Fetching suggestion through Chat Completion API ::');
|
|
87
97
|
return yield this.getChatCompletionSuggestions(conversation, suggestionLanguage);
|
|
88
98
|
}
|
|
89
99
|
catch (e) {
|
|
@@ -35,8 +35,14 @@ class TranslationService extends BaseService_1.default {
|
|
|
35
35
|
logger_1.default.error('Translation text should be provided');
|
|
36
36
|
return Promise.reject(new Error('Text must be provided'));
|
|
37
37
|
}
|
|
38
|
+
logger_1.default.info({
|
|
39
|
+
text,
|
|
40
|
+
toLanguage,
|
|
41
|
+
fromLanguage,
|
|
42
|
+
additionalInstructions,
|
|
43
|
+
}, ':: TranslationServicee.translate :: Translation Data ::');
|
|
38
44
|
const translateText = `
|
|
39
|
-
Translate the following text
|
|
45
|
+
Translate the following text to ${toLanguage} if it's not already in ${toLanguage}: ${text}.
|
|
40
46
|
`;
|
|
41
47
|
const requestBody = {
|
|
42
48
|
model: this.chatGPTModel,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cobrowser/chatgpt",
|
|
3
|
-
"version": "0.7.42-beta.
|
|
3
|
+
"version": "0.7.42-beta.2",
|
|
4
4
|
"description": "chatgpt services to connect our projects with chatgpt api",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"chatgpt",
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"bugs": {
|
|
41
41
|
"url": "https://bitbucket.org/cobrowser/cb_utils/issues"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "6dd7d39c92cfce900cf001c2f8a0dba438dc103e"
|
|
44
44
|
}
|