@tiledesk/tiledesk-tybot-connector 0.2.81 → 0.2.83
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
|
@@ -5,6 +5,12 @@
|
|
|
5
5
|
available on:
|
|
6
6
|
▶️ https://www.npmjs.com/package/@tiledesk/tiledesk-tybot-connector
|
|
7
7
|
|
|
8
|
+
# v0.2.83
|
|
9
|
+
- Added support for advanced context in AskGPTv2
|
|
10
|
+
|
|
11
|
+
# v0.2.82
|
|
12
|
+
- Added {context} in 'system_context' in AskGPTv2
|
|
13
|
+
|
|
8
14
|
# v0.2.81
|
|
9
15
|
- Changed from 'context' to 'system_context' in AskGPTv2
|
|
10
16
|
|
package/package.json
CHANGED
|
@@ -62,6 +62,7 @@ class DirAskGPTV2 {
|
|
|
62
62
|
let temperature;
|
|
63
63
|
let max_tokens;
|
|
64
64
|
let top_k;
|
|
65
|
+
let default_context = "Answer if and ONLY if the answer is contained in the context provided. If the answer is not contained in the context provided ALWAYS answer with <NOANS>\n{context}"
|
|
65
66
|
|
|
66
67
|
let source = null;
|
|
67
68
|
|
|
@@ -145,6 +146,7 @@ class DirAskGPTV2 {
|
|
|
145
146
|
}
|
|
146
147
|
}
|
|
147
148
|
|
|
149
|
+
|
|
148
150
|
let json = {
|
|
149
151
|
question: filled_question,
|
|
150
152
|
gptkey: key,
|
|
@@ -160,9 +162,17 @@ class DirAskGPTV2 {
|
|
|
160
162
|
if (max_tokens) {
|
|
161
163
|
json.max_tokens = max_tokens;
|
|
162
164
|
}
|
|
163
|
-
|
|
165
|
+
|
|
166
|
+
if (!action.advancedPrompt) {
|
|
167
|
+
if (filled_context) {
|
|
168
|
+
json.system_context = filled_context + "\n" + default_context;
|
|
169
|
+
} else {
|
|
170
|
+
json.system_context = default_context;
|
|
171
|
+
}
|
|
172
|
+
} else {
|
|
164
173
|
json.system_context = filled_context;
|
|
165
174
|
}
|
|
175
|
+
|
|
166
176
|
if (this.log) { console.log("DirAskGPT json:", json); }
|
|
167
177
|
|
|
168
178
|
const HTTPREQUEST = {
|