ai-functions 0.2.7 → 0.2.9

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/db/mongo.ts CHANGED
@@ -42,11 +42,11 @@ export const AIDB = (args: AIDBConfig | MongoClient) => {
42
42
  typeof config.events === 'string' ? db.collection(config.events) : config.events ?? db.collection('ai-events')
43
43
  // queue = typeof config.queue === 'string' ? db.collection(config.queue) : config.queue ?? db.collection('ai-queue')
44
44
  // actors = typeof config.queue === 'string' ? db.collection(config.queue) : config.queue ?? db.collection('ai-actors')
45
- return { client, db, cache, actors, events, queue, log, send } as AIDB
45
+ return { client, db, cache, actors, events, queue, log } as AIDB // , send } as AIDB
46
46
  }
47
47
 
48
- const send = (input: QueueInput | QueueInput[]) =>
49
- Array.isArray(input) ? queue.insertMany(input) : queue.insertOne(input)
48
+ // const send = (input: QueueInput | QueueInput[]) =>
49
+ // Array.isArray(input) ? queue.insertMany(input) : queue.insertOne(input)
50
50
 
51
51
  const log = (prompt: ChatCompletionCreateParamsNonStreaming, completion: ChatCompletion) => {
52
52
  const system = prompt.messages.find((message) => message.role === 'system')?.content
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-functions",
3
- "version": "0.2.7",
3
+ "version": "0.2.9",
4
4
  "description": "Library for Developing and Managing AI Functions (including OpenAI GPT4 / GPT3.5)",
5
5
  "main": "index.js",
6
6
  "type": "module",
package/queue/mongo.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { BSON, ObjectId } from 'bson'
1
+ // import { BSON, ObjectId } from 'bson'
2
2
  import { AIDB } from '../db/mongo'
3
3
  import PQueue from 'p-queue'
4
4
  import { chatCompletion, CompletionInput } from '../utils/completion'
5
5
  import { createMachine, createActor } from 'xstate'
6
- import { ChangeStreamInsertDocument, InsertOneResult, UpdateOneModel, UpdateResult } from 'mongodb'
6
+ import { BSON, ObjectId, ChangeStreamInsertDocument, InsertOneResult, UpdateOneModel, UpdateResult } from 'mongodb'
7
7
 
8
8
  let localQueue
9
9