ai-functions 0.2.6 → 0.2.8

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/functions/ai.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  import { ClientOptions, OpenAI, } from 'openai'
2
2
  import { ChatCompletion, ChatCompletionCreateParamsBase } from 'openai/resources/chat/completions'
3
- import { AIDB, AIDBConfig } from '../db/mongo'
3
+ // import { AIDB, AIDBConfig } from '../db/mongo'
4
4
  import { dump } from 'js-yaml'
5
5
  import { generateSchema } from '../utils/schema'
6
6
  import { FromSchema } from 'json-schema-to-ts'
7
7
 
8
8
  export type AIConfig = ClientOptions & {
9
- db?: AIDBConfig
9
+ // db?: AIDBConfig
10
10
  openai?: OpenAI
11
11
  system?: string
12
12
  model?: ChatCompletionCreateParamsBase['model']
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-functions",
3
- "version": "0.2.6",
3
+ "version": "0.2.8",
4
4
  "description": "Library for Developing and Managing AI Functions (including OpenAI GPT4 / GPT3.5)",
5
5
  "main": "index.js",
6
6
  "type": "module",