@exulu/backend 1.13.0 → 1.14.0

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/dist/index.d.cts CHANGED
@@ -1,10 +1,9 @@
1
1
  import * as bullmq from 'bullmq';
2
2
  import { Queue } from 'bullmq';
3
3
  import { RedisClientType } from 'redis';
4
- import * as ai from 'ai';
5
- import { Tool, LanguageModelV1, Message } from 'ai';
6
4
  import { ZodSchema, z } from 'zod';
7
- import { Express } from 'express';
5
+ import { Tool, LanguageModel, UIMessage } from 'ai';
6
+ import { Response, Request, Express } from 'express';
8
7
  import { Knex } from 'knex';
9
8
  import { Tiktoken } from 'tiktoken/lite';
10
9
  import models from 'tiktoken/model_to_encoding.json';
@@ -22,7 +21,7 @@ type Job = {
22
21
  date_started?: Date;
23
22
  };
24
23
 
25
- type STATISTICS_TYPE = "context.retrieve" | "source.update" | "embedder.upsert" | "embedder.delete" | "workflow.run" | "context.upsert" | "tool.call" | "agent.run";
24
+ type STATISTICS_TYPE = "CONTEXT_RETRIEVE" | "SOURCE_UPDATE" | "EMBEDDER_UPSERT" | "EMBEDDER_GENERATE" | "EMBEDDER_DELETE" | "WORKFLOW_RUN" | "CONTEXT_UPSERT" | "TOOL_CALL" | "AGENT_RUN";
26
25
  declare const STATISTICS_TYPE_ENUM: {
27
26
  CONTEXT_RETRIEVE: string;
28
27
  SOURCE_UPDATE: string;
@@ -35,7 +34,7 @@ declare const STATISTICS_TYPE_ENUM: {
35
34
  AGENT_RUN: string;
36
35
  };
37
36
 
38
- type ExuluFieldTypes = "text" | "longText" | "shortText" | "number" | "boolean" | "code" | "json";
37
+ type ExuluFieldTypes = "text" | "longText" | "shortText" | "number" | "boolean" | "code" | "json" | "enum";
39
38
 
40
39
  interface Item {
41
40
  id?: string;
@@ -94,7 +93,7 @@ type ExuluAgentConfig = {
94
93
  model: {
95
94
  create: ({ apiKey }: {
96
95
  apiKey: string;
97
- }) => LanguageModelV1;
96
+ }) => LanguageModel;
98
97
  };
99
98
  outputSchema?: ZodSchema;
100
99
  custom?: {
@@ -120,7 +119,6 @@ interface ExuluAgentParams {
120
119
  description: string;
121
120
  config?: ExuluAgentConfig | undefined;
122
121
  capabilities?: {
123
- tools: boolean;
124
122
  images: string[];
125
123
  files: string[];
126
124
  audio: string[];
@@ -151,7 +149,7 @@ declare class ExuluAgent {
151
149
  model?: {
152
150
  create: ({ apiKey }: {
153
151
  apiKey: string;
154
- }) => LanguageModelV1;
152
+ }) => LanguageModel;
155
153
  };
156
154
  capabilities: {
157
155
  images: string[];
@@ -163,22 +161,29 @@ declare class ExuluAgent {
163
161
  get providerName(): string;
164
162
  get modelName(): string;
165
163
  tool: () => ExuluTool;
166
- generateSync: ({ messages, prompt, tools, statistics, toolConfigs, providerApiKey }: {
167
- messages?: Message[];
164
+ generateSync: ({ prompt, user, session, message, tools, statistics, toolConfigs, providerApiKey }: {
168
165
  prompt?: string;
166
+ user?: string;
167
+ session?: string;
168
+ message?: UIMessage;
169
169
  tools?: ExuluTool[];
170
170
  statistics?: ExuluStatisticParams;
171
171
  toolConfigs?: ExuluAgentToolConfig[];
172
172
  providerApiKey: string;
173
173
  }) => Promise<string>;
174
- generateStream: ({ messages, prompt, tools, statistics, toolConfigs, providerApiKey }: {
175
- messages?: Message[];
176
- prompt?: string;
174
+ generateStream: ({ express, user, session, message, tools, statistics, toolConfigs, providerApiKey }: {
175
+ express: {
176
+ res: Response;
177
+ req: Request;
178
+ };
179
+ user: string;
180
+ session: string;
181
+ message?: UIMessage;
177
182
  tools?: ExuluTool[];
178
183
  statistics?: ExuluStatisticParams;
179
184
  toolConfigs?: ExuluAgentToolConfig[];
180
185
  providerApiKey: string;
181
- }) => ai.StreamTextResult<Record<string, Tool>, never>;
186
+ }) => Promise<void>;
182
187
  }
183
188
  type VectorOperationResponse = Promise<{
184
189
  count: number;
@@ -306,7 +311,7 @@ declare class ExuluEval {
306
311
  LlmAsAJudge: {
307
312
  niah: ({ label, model, needles, testDocument, contextlengths }: {
308
313
  label: string;
309
- model: LanguageModelV1;
314
+ model: LanguageModel;
310
315
  needles: {
311
316
  question: string;
312
317
  answer: string;
@@ -1444,6 +1449,13 @@ declare const ExuluJobs: {
1444
1449
 
1445
1450
  declare const db: {
1446
1451
  init: () => Promise<void>;
1452
+ api: {
1453
+ key: {
1454
+ generate: (name: string, email: string) => Promise<{
1455
+ key: string;
1456
+ }>;
1457
+ };
1458
+ };
1447
1459
  };
1448
1460
  declare const ExuluChunkers: {
1449
1461
  sentence: typeof SentenceChunker;
package/dist/index.d.ts CHANGED
@@ -1,10 +1,9 @@
1
1
  import * as bullmq from 'bullmq';
2
2
  import { Queue } from 'bullmq';
3
3
  import { RedisClientType } from 'redis';
4
- import * as ai from 'ai';
5
- import { Tool, LanguageModelV1, Message } from 'ai';
6
4
  import { ZodSchema, z } from 'zod';
7
- import { Express } from 'express';
5
+ import { Tool, LanguageModel, UIMessage } from 'ai';
6
+ import { Response, Request, Express } from 'express';
8
7
  import { Knex } from 'knex';
9
8
  import { Tiktoken } from 'tiktoken/lite';
10
9
  import models from 'tiktoken/model_to_encoding.json';
@@ -22,7 +21,7 @@ type Job = {
22
21
  date_started?: Date;
23
22
  };
24
23
 
25
- type STATISTICS_TYPE = "context.retrieve" | "source.update" | "embedder.upsert" | "embedder.delete" | "workflow.run" | "context.upsert" | "tool.call" | "agent.run";
24
+ type STATISTICS_TYPE = "CONTEXT_RETRIEVE" | "SOURCE_UPDATE" | "EMBEDDER_UPSERT" | "EMBEDDER_GENERATE" | "EMBEDDER_DELETE" | "WORKFLOW_RUN" | "CONTEXT_UPSERT" | "TOOL_CALL" | "AGENT_RUN";
26
25
  declare const STATISTICS_TYPE_ENUM: {
27
26
  CONTEXT_RETRIEVE: string;
28
27
  SOURCE_UPDATE: string;
@@ -35,7 +34,7 @@ declare const STATISTICS_TYPE_ENUM: {
35
34
  AGENT_RUN: string;
36
35
  };
37
36
 
38
- type ExuluFieldTypes = "text" | "longText" | "shortText" | "number" | "boolean" | "code" | "json";
37
+ type ExuluFieldTypes = "text" | "longText" | "shortText" | "number" | "boolean" | "code" | "json" | "enum";
39
38
 
40
39
  interface Item {
41
40
  id?: string;
@@ -94,7 +93,7 @@ type ExuluAgentConfig = {
94
93
  model: {
95
94
  create: ({ apiKey }: {
96
95
  apiKey: string;
97
- }) => LanguageModelV1;
96
+ }) => LanguageModel;
98
97
  };
99
98
  outputSchema?: ZodSchema;
100
99
  custom?: {
@@ -120,7 +119,6 @@ interface ExuluAgentParams {
120
119
  description: string;
121
120
  config?: ExuluAgentConfig | undefined;
122
121
  capabilities?: {
123
- tools: boolean;
124
122
  images: string[];
125
123
  files: string[];
126
124
  audio: string[];
@@ -151,7 +149,7 @@ declare class ExuluAgent {
151
149
  model?: {
152
150
  create: ({ apiKey }: {
153
151
  apiKey: string;
154
- }) => LanguageModelV1;
152
+ }) => LanguageModel;
155
153
  };
156
154
  capabilities: {
157
155
  images: string[];
@@ -163,22 +161,29 @@ declare class ExuluAgent {
163
161
  get providerName(): string;
164
162
  get modelName(): string;
165
163
  tool: () => ExuluTool;
166
- generateSync: ({ messages, prompt, tools, statistics, toolConfigs, providerApiKey }: {
167
- messages?: Message[];
164
+ generateSync: ({ prompt, user, session, message, tools, statistics, toolConfigs, providerApiKey }: {
168
165
  prompt?: string;
166
+ user?: string;
167
+ session?: string;
168
+ message?: UIMessage;
169
169
  tools?: ExuluTool[];
170
170
  statistics?: ExuluStatisticParams;
171
171
  toolConfigs?: ExuluAgentToolConfig[];
172
172
  providerApiKey: string;
173
173
  }) => Promise<string>;
174
- generateStream: ({ messages, prompt, tools, statistics, toolConfigs, providerApiKey }: {
175
- messages?: Message[];
176
- prompt?: string;
174
+ generateStream: ({ express, user, session, message, tools, statistics, toolConfigs, providerApiKey }: {
175
+ express: {
176
+ res: Response;
177
+ req: Request;
178
+ };
179
+ user: string;
180
+ session: string;
181
+ message?: UIMessage;
177
182
  tools?: ExuluTool[];
178
183
  statistics?: ExuluStatisticParams;
179
184
  toolConfigs?: ExuluAgentToolConfig[];
180
185
  providerApiKey: string;
181
- }) => ai.StreamTextResult<Record<string, Tool>, never>;
186
+ }) => Promise<void>;
182
187
  }
183
188
  type VectorOperationResponse = Promise<{
184
189
  count: number;
@@ -306,7 +311,7 @@ declare class ExuluEval {
306
311
  LlmAsAJudge: {
307
312
  niah: ({ label, model, needles, testDocument, contextlengths }: {
308
313
  label: string;
309
- model: LanguageModelV1;
314
+ model: LanguageModel;
310
315
  needles: {
311
316
  question: string;
312
317
  answer: string;
@@ -1444,6 +1449,13 @@ declare const ExuluJobs: {
1444
1449
 
1445
1450
  declare const db: {
1446
1451
  init: () => Promise<void>;
1452
+ api: {
1453
+ key: {
1454
+ generate: (name: string, email: string) => Promise<{
1455
+ key: string;
1456
+ }>;
1457
+ };
1458
+ };
1447
1459
  };
1448
1460
  declare const ExuluChunkers: {
1449
1461
  sentence: typeof SentenceChunker;