@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.
@@ -6,10 +6,9 @@ COPY package*.json ./
6
6
 
7
7
  RUN npm install
8
8
 
9
- ## following 3 lines are for installing ffmepg
10
- RUN apk update
11
- RUN apk add
12
- RUN apk add ffmpeg
9
+ ## installing ffmepg
10
+ RUN apk update && \
11
+ apk add ffmpeg=6.0-r15
13
12
 
14
13
  COPY . .
15
14
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aj-archipelago/cortex",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "description": "Cortex is a GraphQL API for AI. It provides a simple, extensible interface for using AI services from OpenAI, Azure and others.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -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
  }