@aj-archipelago/cortex 1.0.13 → 1.0.14
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/package.json
CHANGED
|
@@ -55,7 +55,8 @@ class AzureCognitivePlugin extends ModelPlugin {
|
|
|
55
55
|
content: text,
|
|
56
56
|
contentVector: inputVector || (await calculateInputVector()),
|
|
57
57
|
owner: savedContextId,
|
|
58
|
-
docId: docId || uuidv4()
|
|
58
|
+
docId: docId || uuidv4(),
|
|
59
|
+
createdAt: new Date().toISOString()
|
|
59
60
|
}
|
|
60
61
|
// if(!privateData){
|
|
61
62
|
// delete doc.owner;
|
|
@@ -110,7 +111,7 @@ class AzureCognitivePlugin extends ModelPlugin {
|
|
|
110
111
|
|
|
111
112
|
// Execute the request to the Azure Cognitive API
|
|
112
113
|
async execute(text, parameters, prompt, pathwayResolver) {
|
|
113
|
-
const { requestId, pathway, savedContextId } = pathwayResolver;
|
|
114
|
+
const { requestId, pathway, savedContextId, savedContext } = pathwayResolver;
|
|
114
115
|
const mode = this.promptParameters.mode || 'search';
|
|
115
116
|
let url = this.ensureMode(this.requestUrl(text), mode == 'delete' ? 'index' : mode);
|
|
116
117
|
const indexName = parameters.indexName || 'indexcortex';
|
|
@@ -119,6 +120,9 @@ class AzureCognitivePlugin extends ModelPlugin {
|
|
|
119
120
|
|
|
120
121
|
const { data, params } = await this.getRequestParameters(text, parameters, prompt, mode, indexName, savedContextId, {headers, requestId, pathway, url});
|
|
121
122
|
|
|
123
|
+
// update contextid last used
|
|
124
|
+
savedContext["lastUsed"] = new Date().toISOString();
|
|
125
|
+
|
|
122
126
|
if (mode === 'delete' && data.value.length == 0){
|
|
123
127
|
return; // nothing to delete
|
|
124
128
|
}
|