@exulu/backend 1.27.2 → 1.28.1
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/.github/workflows/{release.yml → release-backend.yml} +2 -2
- package/.nvmrc +1 -1
- package/CHANGELOG.md +2 -2
- package/dist/index.cjs +1490 -572
- package/dist/index.d.cts +161 -28
- package/dist/index.d.ts +161 -28
- package/dist/index.js +1486 -569
- package/package.json +3 -3
- package/types/models/eval-run.ts +37 -0
- package/types/models/test-case.ts +25 -0
package/dist/index.d.cts
CHANGED
|
@@ -2,9 +2,10 @@ import * as _opentelemetry_sdk_node from '@opentelemetry/sdk-node';
|
|
|
2
2
|
import * as bullmq from 'bullmq';
|
|
3
3
|
import { Queue } from 'bullmq';
|
|
4
4
|
import { RedisClientType } from 'redis';
|
|
5
|
+
import * as ai from 'ai';
|
|
6
|
+
import { UIMessage, Tool, LanguageModel } from 'ai';
|
|
5
7
|
import { z } from 'zod';
|
|
6
|
-
import {
|
|
7
|
-
import { Express, Response, Request } from 'express';
|
|
8
|
+
import { Express } from 'express';
|
|
8
9
|
import { transport } from 'winston';
|
|
9
10
|
import { Knex } from 'knex';
|
|
10
11
|
import { Tiktoken } from 'tiktoken/lite';
|
|
@@ -74,7 +75,7 @@ type ExuluConfig = {
|
|
|
74
75
|
MCP: {
|
|
75
76
|
enabled: boolean;
|
|
76
77
|
};
|
|
77
|
-
fileUploads
|
|
78
|
+
fileUploads?: {
|
|
78
79
|
s3region: string;
|
|
79
80
|
s3key: string;
|
|
80
81
|
s3secret: string;
|
|
@@ -86,15 +87,17 @@ type ExuluConfig = {
|
|
|
86
87
|
declare class ExuluApp {
|
|
87
88
|
private _agents;
|
|
88
89
|
private _config?;
|
|
90
|
+
private _evals;
|
|
89
91
|
private _queues;
|
|
90
92
|
private _contexts?;
|
|
91
93
|
private _tools;
|
|
92
94
|
private _expressApp;
|
|
93
95
|
constructor();
|
|
94
|
-
create: ({ contexts, agents, config, tools }: {
|
|
96
|
+
create: ({ contexts, agents, config, tools, evals }: {
|
|
95
97
|
contexts?: Record<string, ExuluContext>;
|
|
96
98
|
config: ExuluConfig;
|
|
97
99
|
agents?: ExuluAgent[];
|
|
100
|
+
evals?: ExuluEval[];
|
|
98
101
|
tools?: ExuluTool[];
|
|
99
102
|
}) => Promise<ExuluApp>;
|
|
100
103
|
express: {
|
|
@@ -127,7 +130,7 @@ declare class ExuluApp {
|
|
|
127
130
|
};
|
|
128
131
|
bullmq: {
|
|
129
132
|
workers: {
|
|
130
|
-
create: () => Promise<bullmq.Worker<any, any, string>[]>;
|
|
133
|
+
create: (queues?: string[] | undefined) => Promise<bullmq.Worker<any, any, string>[]>;
|
|
131
134
|
};
|
|
132
135
|
};
|
|
133
136
|
private server;
|
|
@@ -152,6 +155,85 @@ type User = {
|
|
|
152
155
|
};
|
|
153
156
|
};
|
|
154
157
|
|
|
158
|
+
interface Agent {
|
|
159
|
+
id: string;
|
|
160
|
+
modelName?: string;
|
|
161
|
+
providerName?: string;
|
|
162
|
+
backend: string;
|
|
163
|
+
type: "agent";
|
|
164
|
+
name: string;
|
|
165
|
+
image?: string;
|
|
166
|
+
providerapikey?: string;
|
|
167
|
+
firewall?: {
|
|
168
|
+
enabled: boolean;
|
|
169
|
+
scanners?: {
|
|
170
|
+
promptGuard: boolean;
|
|
171
|
+
codeShield: boolean;
|
|
172
|
+
agentAlignment: boolean;
|
|
173
|
+
hiddenAscii: boolean;
|
|
174
|
+
piiDetection: boolean;
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
active?: boolean;
|
|
178
|
+
description?: string;
|
|
179
|
+
instructions?: string;
|
|
180
|
+
slug?: string;
|
|
181
|
+
tools?: {
|
|
182
|
+
id: string;
|
|
183
|
+
type: string;
|
|
184
|
+
config: {
|
|
185
|
+
name: string;
|
|
186
|
+
variable: string;
|
|
187
|
+
}[];
|
|
188
|
+
name: string;
|
|
189
|
+
description: string;
|
|
190
|
+
}[];
|
|
191
|
+
maxContextLength?: number;
|
|
192
|
+
capabilities?: {
|
|
193
|
+
text: boolean;
|
|
194
|
+
images: imageTypes$1[];
|
|
195
|
+
files: fileTypes$1[];
|
|
196
|
+
audio: audioTypes$1[];
|
|
197
|
+
video: videoTypes$1[];
|
|
198
|
+
};
|
|
199
|
+
rights_mode?: 'private' | 'users' | 'roles' | 'public' | 'projects';
|
|
200
|
+
created_by?: string;
|
|
201
|
+
RBAC?: {
|
|
202
|
+
type?: string;
|
|
203
|
+
users?: Array<{
|
|
204
|
+
id: number;
|
|
205
|
+
rights: 'read' | 'write';
|
|
206
|
+
}>;
|
|
207
|
+
roles?: Array<{
|
|
208
|
+
id: string;
|
|
209
|
+
rights: 'read' | 'write';
|
|
210
|
+
}>;
|
|
211
|
+
projects?: Array<{
|
|
212
|
+
id: string;
|
|
213
|
+
rights: 'read' | 'write';
|
|
214
|
+
}>;
|
|
215
|
+
};
|
|
216
|
+
createdAt?: string;
|
|
217
|
+
updatedAt?: string;
|
|
218
|
+
}
|
|
219
|
+
type imageTypes$1 = '.png' | '.jpg' | '.jpeg' | '.gif' | '.webp';
|
|
220
|
+
type fileTypes$1 = '.pdf' | '.docx' | '.xlsx' | '.xls' | '.csv' | '.pptx' | '.ppt';
|
|
221
|
+
type audioTypes$1 = '.mp3' | '.wav' | '.m4a' | '.mp4' | '.mpeg';
|
|
222
|
+
type videoTypes$1 = '.mp4' | '.m4a' | '.mp3' | '.mpeg' | '.wav';
|
|
223
|
+
|
|
224
|
+
interface TestCase {
|
|
225
|
+
id: string;
|
|
226
|
+
name: string;
|
|
227
|
+
description?: string;
|
|
228
|
+
inputs: UIMessage[];
|
|
229
|
+
expected_output: string;
|
|
230
|
+
expected_tools?: string[];
|
|
231
|
+
expected_knowledge_sources?: string[];
|
|
232
|
+
expected_agent_tools?: string[];
|
|
233
|
+
createdAt: string;
|
|
234
|
+
updatedAt: string;
|
|
235
|
+
}
|
|
236
|
+
|
|
155
237
|
interface RateLimiterRule {
|
|
156
238
|
name?: string;
|
|
157
239
|
rate_limit: {
|
|
@@ -192,6 +274,7 @@ interface ExuluAgentParams {
|
|
|
192
274
|
type: "agent";
|
|
193
275
|
description: string;
|
|
194
276
|
config?: ExuluAgentConfig | undefined;
|
|
277
|
+
queue?: ExuluQueueConfig;
|
|
195
278
|
maxContextLength?: number;
|
|
196
279
|
provider: string;
|
|
197
280
|
capabilities?: {
|
|
@@ -203,7 +286,6 @@ interface ExuluAgentParams {
|
|
|
203
286
|
};
|
|
204
287
|
outputSchema?: z.ZodType;
|
|
205
288
|
rateLimit?: RateLimiterRule;
|
|
206
|
-
evals?: ExuluEval[];
|
|
207
289
|
}
|
|
208
290
|
interface ExuluAgentToolConfig {
|
|
209
291
|
id: string;
|
|
@@ -217,7 +299,13 @@ interface ExuluAgentToolConfig {
|
|
|
217
299
|
type ExuluQueueConfig = {
|
|
218
300
|
queue: Queue;
|
|
219
301
|
ratelimit: number;
|
|
302
|
+
timeoutInSeconds?: number;
|
|
220
303
|
concurrency: number;
|
|
304
|
+
retries?: number;
|
|
305
|
+
backoff?: {
|
|
306
|
+
type: 'exponential' | 'linear';
|
|
307
|
+
delay: number;
|
|
308
|
+
};
|
|
221
309
|
};
|
|
222
310
|
type ExuluEvalTokenMetadata = {
|
|
223
311
|
totalTokens?: number;
|
|
@@ -234,29 +322,33 @@ interface ExuluEvalParams {
|
|
|
234
322
|
id: string;
|
|
235
323
|
name: string;
|
|
236
324
|
description: string;
|
|
325
|
+
llm: boolean;
|
|
237
326
|
execute: (params: {
|
|
327
|
+
agent: Agent;
|
|
328
|
+
backend: ExuluAgent;
|
|
238
329
|
messages: UIMessage[];
|
|
239
|
-
|
|
330
|
+
testCase: TestCase;
|
|
240
331
|
config?: Record<string, any>;
|
|
241
332
|
}) => Promise<number>;
|
|
242
333
|
config?: {
|
|
243
334
|
name: string;
|
|
244
335
|
description: string;
|
|
245
336
|
}[];
|
|
246
|
-
queue: ExuluQueueConfig
|
|
337
|
+
queue: Promise<ExuluQueueConfig>;
|
|
247
338
|
}
|
|
248
339
|
declare class ExuluEval {
|
|
249
340
|
id: string;
|
|
250
341
|
name: string;
|
|
251
342
|
description: string;
|
|
343
|
+
llm: boolean;
|
|
252
344
|
private execute;
|
|
253
345
|
config?: {
|
|
254
346
|
name: string;
|
|
255
347
|
description: string;
|
|
256
348
|
}[];
|
|
257
|
-
queue
|
|
258
|
-
constructor({ id, name, description, execute, config, queue }: ExuluEvalParams);
|
|
259
|
-
run(messages: UIMessage[],
|
|
349
|
+
queue?: Promise<ExuluQueueConfig>;
|
|
350
|
+
constructor({ id, name, description, execute, config, queue, llm }: ExuluEvalParams);
|
|
351
|
+
run(agent: Agent, backend: ExuluAgent, testCase: TestCase, messages: UIMessage[], config?: Record<string, any>): Promise<number>;
|
|
260
352
|
}
|
|
261
353
|
declare class ExuluAgent {
|
|
262
354
|
id: string;
|
|
@@ -267,9 +359,9 @@ declare class ExuluAgent {
|
|
|
267
359
|
type: "agent";
|
|
268
360
|
streaming: boolean;
|
|
269
361
|
maxContextLength?: number;
|
|
362
|
+
queue?: ExuluQueueConfig;
|
|
270
363
|
rateLimit?: RateLimiterRule;
|
|
271
364
|
config?: ExuluAgentConfig | undefined;
|
|
272
|
-
evals?: ExuluEval[];
|
|
273
365
|
model?: {
|
|
274
366
|
create: ({ apiKey }: {
|
|
275
367
|
apiKey: string;
|
|
@@ -282,15 +374,15 @@ declare class ExuluAgent {
|
|
|
282
374
|
audio: string[];
|
|
283
375
|
video: string[];
|
|
284
376
|
};
|
|
285
|
-
constructor({ id, name, description, config, rateLimit, capabilities, type, maxContextLength,
|
|
377
|
+
constructor({ id, name, description, config, rateLimit, capabilities, type, maxContextLength, provider, queue }: ExuluAgentParams);
|
|
286
378
|
get providerName(): string;
|
|
287
379
|
get modelName(): string;
|
|
288
380
|
tool: (instance: string, agents: ExuluAgent[]) => Promise<ExuluTool | null>;
|
|
289
|
-
generateSync: ({ prompt, user, session,
|
|
381
|
+
generateSync: ({ prompt, user, session, inputMessages, currentTools, allExuluTools, statistics, toolConfigs, providerapikey, contexts, exuluConfig, outputSchema, instructions }: {
|
|
290
382
|
prompt?: string;
|
|
291
383
|
user?: User;
|
|
292
384
|
session?: string;
|
|
293
|
-
|
|
385
|
+
inputMessages?: UIMessage[];
|
|
294
386
|
currentTools?: ExuluTool[];
|
|
295
387
|
allExuluTools?: ExuluTool[];
|
|
296
388
|
statistics?: ExuluStatisticParams;
|
|
@@ -301,23 +393,23 @@ declare class ExuluAgent {
|
|
|
301
393
|
instructions?: string;
|
|
302
394
|
outputSchema?: z.ZodType;
|
|
303
395
|
}) => Promise<string | any>;
|
|
304
|
-
generateStream: ({
|
|
305
|
-
express: {
|
|
306
|
-
res: Response;
|
|
307
|
-
req: Request;
|
|
308
|
-
};
|
|
396
|
+
generateStream: ({ user, session, message, previousMessages, currentTools, allExuluTools, toolConfigs, providerapikey, contexts, exuluConfig, instructions, }: {
|
|
309
397
|
user: User;
|
|
310
|
-
session
|
|
398
|
+
session?: string;
|
|
311
399
|
message?: UIMessage;
|
|
400
|
+
previousMessages?: UIMessage[];
|
|
312
401
|
currentTools?: ExuluTool[];
|
|
313
402
|
allExuluTools?: ExuluTool[];
|
|
314
|
-
statistics?: ExuluStatisticParams;
|
|
315
403
|
toolConfigs?: ExuluAgentToolConfig[];
|
|
316
404
|
providerapikey: string;
|
|
317
405
|
contexts?: ExuluContext[] | undefined;
|
|
318
406
|
exuluConfig?: ExuluConfig;
|
|
319
407
|
instructions?: string;
|
|
320
|
-
}) => Promise<
|
|
408
|
+
}) => Promise<{
|
|
409
|
+
stream: ai.StreamTextResult<Record<string, Tool>, never>;
|
|
410
|
+
originalMessages: UIMessage<unknown, ai.UIDataTypes, ai.UITools>[];
|
|
411
|
+
previousMessages: UIMessage<unknown, ai.UIDataTypes, ai.UITools>[];
|
|
412
|
+
}>;
|
|
321
413
|
}
|
|
322
414
|
type VectorOperationResponse = Promise<{
|
|
323
415
|
count: number;
|
|
@@ -425,6 +517,7 @@ type ExuluContextFieldProcessor = {
|
|
|
425
517
|
}) => Promise<string>;
|
|
426
518
|
config?: {
|
|
427
519
|
queue?: Promise<ExuluQueueConfig>;
|
|
520
|
+
timeoutInSeconds?: number;
|
|
428
521
|
trigger: "manual" | "onUpdate" | "onCreate" | "always";
|
|
429
522
|
};
|
|
430
523
|
};
|
|
@@ -494,9 +587,18 @@ declare class ExuluContext {
|
|
|
494
587
|
chunks?: number;
|
|
495
588
|
job?: string;
|
|
496
589
|
}>;
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
590
|
+
createItem: (item: Item, config: ExuluConfig, user?: number, role?: string, upsert?: boolean) => Promise<{
|
|
591
|
+
item: Item;
|
|
592
|
+
job?: string;
|
|
593
|
+
}>;
|
|
594
|
+
updateItem: (item: Item, config: ExuluConfig, user?: number, role?: string) => Promise<{
|
|
595
|
+
item: Item;
|
|
596
|
+
job?: string;
|
|
597
|
+
}>;
|
|
598
|
+
deleteItem: (item: Item, user?: number, role?: string) => Promise<{
|
|
599
|
+
id: string;
|
|
600
|
+
job?: string;
|
|
601
|
+
}>;
|
|
500
602
|
embeddings: {
|
|
501
603
|
generate: {
|
|
502
604
|
one: ({ item, user, role, trigger, config }: {
|
|
@@ -549,15 +651,46 @@ declare class ExuluQueues {
|
|
|
549
651
|
concurrency: number;
|
|
550
652
|
}[];
|
|
551
653
|
constructor();
|
|
654
|
+
list: Map<string, {
|
|
655
|
+
name: string;
|
|
656
|
+
concurrency: number;
|
|
657
|
+
ratelimit: number;
|
|
658
|
+
use: () => Promise<ExuluQueueConfig>;
|
|
659
|
+
}>;
|
|
552
660
|
queue(name: string): {
|
|
553
661
|
queue: Queue;
|
|
554
662
|
ratelimit: number;
|
|
555
663
|
concurrency: number;
|
|
556
664
|
} | undefined;
|
|
557
|
-
|
|
665
|
+
register: (name: string, concurrency?: number, ratelimit?: number) => {
|
|
666
|
+
use: () => Promise<ExuluQueueConfig>;
|
|
667
|
+
};
|
|
558
668
|
}
|
|
559
669
|
declare const queues: ExuluQueues;
|
|
560
670
|
|
|
671
|
+
/**
|
|
672
|
+
* Create metadata for console logging that will be used by S3 transport
|
|
673
|
+
* to group logs by ID and store them in S3 with the ID as prefix
|
|
674
|
+
*
|
|
675
|
+
* @param id - The ID to group logs by (e.g., job ID, request ID, etc.)
|
|
676
|
+
* @param additionalMetadata - Any additional metadata to include with the log
|
|
677
|
+
* @returns Metadata object to pass as the last argument to console methods
|
|
678
|
+
*
|
|
679
|
+
* @example
|
|
680
|
+
* ```typescript
|
|
681
|
+
* import { logMetadata } from './registry/log-metadata';
|
|
682
|
+
*
|
|
683
|
+
* const jobId = 'job-123';
|
|
684
|
+
* console.log('Starting job', logMetadata(jobId));
|
|
685
|
+
* console.log('Processing...', logMetadata(jobId, { step: 'validation' }));
|
|
686
|
+
* console.error('Job failed', logMetadata(jobId, { error: 'timeout' }));
|
|
687
|
+
* ```
|
|
688
|
+
*/
|
|
689
|
+
declare function logMetadata(id: string, additionalMetadata?: Record<string, any>): {
|
|
690
|
+
__logMetadata: boolean;
|
|
691
|
+
id: string;
|
|
692
|
+
};
|
|
693
|
+
|
|
561
694
|
/**
|
|
562
695
|
* Represents the data structure for a chunk object.
|
|
563
696
|
*
|
|
@@ -1500,4 +1633,4 @@ declare const ExuluChunkers: {
|
|
|
1500
1633
|
};
|
|
1501
1634
|
};
|
|
1502
1635
|
|
|
1503
|
-
export { type JOB_STATUS as EXULU_JOB_STATUS, JOB_STATUS_ENUM as EXULU_JOB_STATUS_ENUM, type STATISTICS_TYPE as EXULU_STATISTICS_TYPE, STATISTICS_TYPE_ENUM as EXULU_STATISTICS_TYPE_ENUM, ExuluAgent, ExuluApp, authentication as ExuluAuthentication, ExuluChunkers, ExuluContext, ExuluDefaultAgents, ExuluDefaultContexts, ExuluEmbedder, ExuluEval, type ExuluEvalMetadata, type ExuluEvalTokenMetadata, ExuluJobs, ExuluOtel, type ExuluQueueConfig, queues as ExuluQueues, ExuluTool, ExuluUtils, ExuluVariables, db };
|
|
1636
|
+
export { type JOB_STATUS as EXULU_JOB_STATUS, JOB_STATUS_ENUM as EXULU_JOB_STATUS_ENUM, type STATISTICS_TYPE as EXULU_STATISTICS_TYPE, STATISTICS_TYPE_ENUM as EXULU_STATISTICS_TYPE_ENUM, ExuluAgent, ExuluApp, authentication as ExuluAuthentication, ExuluChunkers, ExuluContext, ExuluDefaultAgents, ExuluDefaultContexts, ExuluEmbedder, ExuluEval, type ExuluEvalMetadata, type ExuluEvalTokenMetadata, ExuluJobs, ExuluOtel, type ExuluQueueConfig, queues as ExuluQueues, ExuluTool, ExuluUtils, ExuluVariables, db, logMetadata };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,9 +2,10 @@ import * as _opentelemetry_sdk_node from '@opentelemetry/sdk-node';
|
|
|
2
2
|
import * as bullmq from 'bullmq';
|
|
3
3
|
import { Queue } from 'bullmq';
|
|
4
4
|
import { RedisClientType } from 'redis';
|
|
5
|
+
import * as ai from 'ai';
|
|
6
|
+
import { UIMessage, Tool, LanguageModel } from 'ai';
|
|
5
7
|
import { z } from 'zod';
|
|
6
|
-
import {
|
|
7
|
-
import { Express, Response, Request } from 'express';
|
|
8
|
+
import { Express } from 'express';
|
|
8
9
|
import { transport } from 'winston';
|
|
9
10
|
import { Knex } from 'knex';
|
|
10
11
|
import { Tiktoken } from 'tiktoken/lite';
|
|
@@ -74,7 +75,7 @@ type ExuluConfig = {
|
|
|
74
75
|
MCP: {
|
|
75
76
|
enabled: boolean;
|
|
76
77
|
};
|
|
77
|
-
fileUploads
|
|
78
|
+
fileUploads?: {
|
|
78
79
|
s3region: string;
|
|
79
80
|
s3key: string;
|
|
80
81
|
s3secret: string;
|
|
@@ -86,15 +87,17 @@ type ExuluConfig = {
|
|
|
86
87
|
declare class ExuluApp {
|
|
87
88
|
private _agents;
|
|
88
89
|
private _config?;
|
|
90
|
+
private _evals;
|
|
89
91
|
private _queues;
|
|
90
92
|
private _contexts?;
|
|
91
93
|
private _tools;
|
|
92
94
|
private _expressApp;
|
|
93
95
|
constructor();
|
|
94
|
-
create: ({ contexts, agents, config, tools }: {
|
|
96
|
+
create: ({ contexts, agents, config, tools, evals }: {
|
|
95
97
|
contexts?: Record<string, ExuluContext>;
|
|
96
98
|
config: ExuluConfig;
|
|
97
99
|
agents?: ExuluAgent[];
|
|
100
|
+
evals?: ExuluEval[];
|
|
98
101
|
tools?: ExuluTool[];
|
|
99
102
|
}) => Promise<ExuluApp>;
|
|
100
103
|
express: {
|
|
@@ -127,7 +130,7 @@ declare class ExuluApp {
|
|
|
127
130
|
};
|
|
128
131
|
bullmq: {
|
|
129
132
|
workers: {
|
|
130
|
-
create: () => Promise<bullmq.Worker<any, any, string>[]>;
|
|
133
|
+
create: (queues?: string[] | undefined) => Promise<bullmq.Worker<any, any, string>[]>;
|
|
131
134
|
};
|
|
132
135
|
};
|
|
133
136
|
private server;
|
|
@@ -152,6 +155,85 @@ type User = {
|
|
|
152
155
|
};
|
|
153
156
|
};
|
|
154
157
|
|
|
158
|
+
interface Agent {
|
|
159
|
+
id: string;
|
|
160
|
+
modelName?: string;
|
|
161
|
+
providerName?: string;
|
|
162
|
+
backend: string;
|
|
163
|
+
type: "agent";
|
|
164
|
+
name: string;
|
|
165
|
+
image?: string;
|
|
166
|
+
providerapikey?: string;
|
|
167
|
+
firewall?: {
|
|
168
|
+
enabled: boolean;
|
|
169
|
+
scanners?: {
|
|
170
|
+
promptGuard: boolean;
|
|
171
|
+
codeShield: boolean;
|
|
172
|
+
agentAlignment: boolean;
|
|
173
|
+
hiddenAscii: boolean;
|
|
174
|
+
piiDetection: boolean;
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
active?: boolean;
|
|
178
|
+
description?: string;
|
|
179
|
+
instructions?: string;
|
|
180
|
+
slug?: string;
|
|
181
|
+
tools?: {
|
|
182
|
+
id: string;
|
|
183
|
+
type: string;
|
|
184
|
+
config: {
|
|
185
|
+
name: string;
|
|
186
|
+
variable: string;
|
|
187
|
+
}[];
|
|
188
|
+
name: string;
|
|
189
|
+
description: string;
|
|
190
|
+
}[];
|
|
191
|
+
maxContextLength?: number;
|
|
192
|
+
capabilities?: {
|
|
193
|
+
text: boolean;
|
|
194
|
+
images: imageTypes$1[];
|
|
195
|
+
files: fileTypes$1[];
|
|
196
|
+
audio: audioTypes$1[];
|
|
197
|
+
video: videoTypes$1[];
|
|
198
|
+
};
|
|
199
|
+
rights_mode?: 'private' | 'users' | 'roles' | 'public' | 'projects';
|
|
200
|
+
created_by?: string;
|
|
201
|
+
RBAC?: {
|
|
202
|
+
type?: string;
|
|
203
|
+
users?: Array<{
|
|
204
|
+
id: number;
|
|
205
|
+
rights: 'read' | 'write';
|
|
206
|
+
}>;
|
|
207
|
+
roles?: Array<{
|
|
208
|
+
id: string;
|
|
209
|
+
rights: 'read' | 'write';
|
|
210
|
+
}>;
|
|
211
|
+
projects?: Array<{
|
|
212
|
+
id: string;
|
|
213
|
+
rights: 'read' | 'write';
|
|
214
|
+
}>;
|
|
215
|
+
};
|
|
216
|
+
createdAt?: string;
|
|
217
|
+
updatedAt?: string;
|
|
218
|
+
}
|
|
219
|
+
type imageTypes$1 = '.png' | '.jpg' | '.jpeg' | '.gif' | '.webp';
|
|
220
|
+
type fileTypes$1 = '.pdf' | '.docx' | '.xlsx' | '.xls' | '.csv' | '.pptx' | '.ppt';
|
|
221
|
+
type audioTypes$1 = '.mp3' | '.wav' | '.m4a' | '.mp4' | '.mpeg';
|
|
222
|
+
type videoTypes$1 = '.mp4' | '.m4a' | '.mp3' | '.mpeg' | '.wav';
|
|
223
|
+
|
|
224
|
+
interface TestCase {
|
|
225
|
+
id: string;
|
|
226
|
+
name: string;
|
|
227
|
+
description?: string;
|
|
228
|
+
inputs: UIMessage[];
|
|
229
|
+
expected_output: string;
|
|
230
|
+
expected_tools?: string[];
|
|
231
|
+
expected_knowledge_sources?: string[];
|
|
232
|
+
expected_agent_tools?: string[];
|
|
233
|
+
createdAt: string;
|
|
234
|
+
updatedAt: string;
|
|
235
|
+
}
|
|
236
|
+
|
|
155
237
|
interface RateLimiterRule {
|
|
156
238
|
name?: string;
|
|
157
239
|
rate_limit: {
|
|
@@ -192,6 +274,7 @@ interface ExuluAgentParams {
|
|
|
192
274
|
type: "agent";
|
|
193
275
|
description: string;
|
|
194
276
|
config?: ExuluAgentConfig | undefined;
|
|
277
|
+
queue?: ExuluQueueConfig;
|
|
195
278
|
maxContextLength?: number;
|
|
196
279
|
provider: string;
|
|
197
280
|
capabilities?: {
|
|
@@ -203,7 +286,6 @@ interface ExuluAgentParams {
|
|
|
203
286
|
};
|
|
204
287
|
outputSchema?: z.ZodType;
|
|
205
288
|
rateLimit?: RateLimiterRule;
|
|
206
|
-
evals?: ExuluEval[];
|
|
207
289
|
}
|
|
208
290
|
interface ExuluAgentToolConfig {
|
|
209
291
|
id: string;
|
|
@@ -217,7 +299,13 @@ interface ExuluAgentToolConfig {
|
|
|
217
299
|
type ExuluQueueConfig = {
|
|
218
300
|
queue: Queue;
|
|
219
301
|
ratelimit: number;
|
|
302
|
+
timeoutInSeconds?: number;
|
|
220
303
|
concurrency: number;
|
|
304
|
+
retries?: number;
|
|
305
|
+
backoff?: {
|
|
306
|
+
type: 'exponential' | 'linear';
|
|
307
|
+
delay: number;
|
|
308
|
+
};
|
|
221
309
|
};
|
|
222
310
|
type ExuluEvalTokenMetadata = {
|
|
223
311
|
totalTokens?: number;
|
|
@@ -234,29 +322,33 @@ interface ExuluEvalParams {
|
|
|
234
322
|
id: string;
|
|
235
323
|
name: string;
|
|
236
324
|
description: string;
|
|
325
|
+
llm: boolean;
|
|
237
326
|
execute: (params: {
|
|
327
|
+
agent: Agent;
|
|
328
|
+
backend: ExuluAgent;
|
|
238
329
|
messages: UIMessage[];
|
|
239
|
-
|
|
330
|
+
testCase: TestCase;
|
|
240
331
|
config?: Record<string, any>;
|
|
241
332
|
}) => Promise<number>;
|
|
242
333
|
config?: {
|
|
243
334
|
name: string;
|
|
244
335
|
description: string;
|
|
245
336
|
}[];
|
|
246
|
-
queue: ExuluQueueConfig
|
|
337
|
+
queue: Promise<ExuluQueueConfig>;
|
|
247
338
|
}
|
|
248
339
|
declare class ExuluEval {
|
|
249
340
|
id: string;
|
|
250
341
|
name: string;
|
|
251
342
|
description: string;
|
|
343
|
+
llm: boolean;
|
|
252
344
|
private execute;
|
|
253
345
|
config?: {
|
|
254
346
|
name: string;
|
|
255
347
|
description: string;
|
|
256
348
|
}[];
|
|
257
|
-
queue
|
|
258
|
-
constructor({ id, name, description, execute, config, queue }: ExuluEvalParams);
|
|
259
|
-
run(messages: UIMessage[],
|
|
349
|
+
queue?: Promise<ExuluQueueConfig>;
|
|
350
|
+
constructor({ id, name, description, execute, config, queue, llm }: ExuluEvalParams);
|
|
351
|
+
run(agent: Agent, backend: ExuluAgent, testCase: TestCase, messages: UIMessage[], config?: Record<string, any>): Promise<number>;
|
|
260
352
|
}
|
|
261
353
|
declare class ExuluAgent {
|
|
262
354
|
id: string;
|
|
@@ -267,9 +359,9 @@ declare class ExuluAgent {
|
|
|
267
359
|
type: "agent";
|
|
268
360
|
streaming: boolean;
|
|
269
361
|
maxContextLength?: number;
|
|
362
|
+
queue?: ExuluQueueConfig;
|
|
270
363
|
rateLimit?: RateLimiterRule;
|
|
271
364
|
config?: ExuluAgentConfig | undefined;
|
|
272
|
-
evals?: ExuluEval[];
|
|
273
365
|
model?: {
|
|
274
366
|
create: ({ apiKey }: {
|
|
275
367
|
apiKey: string;
|
|
@@ -282,15 +374,15 @@ declare class ExuluAgent {
|
|
|
282
374
|
audio: string[];
|
|
283
375
|
video: string[];
|
|
284
376
|
};
|
|
285
|
-
constructor({ id, name, description, config, rateLimit, capabilities, type, maxContextLength,
|
|
377
|
+
constructor({ id, name, description, config, rateLimit, capabilities, type, maxContextLength, provider, queue }: ExuluAgentParams);
|
|
286
378
|
get providerName(): string;
|
|
287
379
|
get modelName(): string;
|
|
288
380
|
tool: (instance: string, agents: ExuluAgent[]) => Promise<ExuluTool | null>;
|
|
289
|
-
generateSync: ({ prompt, user, session,
|
|
381
|
+
generateSync: ({ prompt, user, session, inputMessages, currentTools, allExuluTools, statistics, toolConfigs, providerapikey, contexts, exuluConfig, outputSchema, instructions }: {
|
|
290
382
|
prompt?: string;
|
|
291
383
|
user?: User;
|
|
292
384
|
session?: string;
|
|
293
|
-
|
|
385
|
+
inputMessages?: UIMessage[];
|
|
294
386
|
currentTools?: ExuluTool[];
|
|
295
387
|
allExuluTools?: ExuluTool[];
|
|
296
388
|
statistics?: ExuluStatisticParams;
|
|
@@ -301,23 +393,23 @@ declare class ExuluAgent {
|
|
|
301
393
|
instructions?: string;
|
|
302
394
|
outputSchema?: z.ZodType;
|
|
303
395
|
}) => Promise<string | any>;
|
|
304
|
-
generateStream: ({
|
|
305
|
-
express: {
|
|
306
|
-
res: Response;
|
|
307
|
-
req: Request;
|
|
308
|
-
};
|
|
396
|
+
generateStream: ({ user, session, message, previousMessages, currentTools, allExuluTools, toolConfigs, providerapikey, contexts, exuluConfig, instructions, }: {
|
|
309
397
|
user: User;
|
|
310
|
-
session
|
|
398
|
+
session?: string;
|
|
311
399
|
message?: UIMessage;
|
|
400
|
+
previousMessages?: UIMessage[];
|
|
312
401
|
currentTools?: ExuluTool[];
|
|
313
402
|
allExuluTools?: ExuluTool[];
|
|
314
|
-
statistics?: ExuluStatisticParams;
|
|
315
403
|
toolConfigs?: ExuluAgentToolConfig[];
|
|
316
404
|
providerapikey: string;
|
|
317
405
|
contexts?: ExuluContext[] | undefined;
|
|
318
406
|
exuluConfig?: ExuluConfig;
|
|
319
407
|
instructions?: string;
|
|
320
|
-
}) => Promise<
|
|
408
|
+
}) => Promise<{
|
|
409
|
+
stream: ai.StreamTextResult<Record<string, Tool>, never>;
|
|
410
|
+
originalMessages: UIMessage<unknown, ai.UIDataTypes, ai.UITools>[];
|
|
411
|
+
previousMessages: UIMessage<unknown, ai.UIDataTypes, ai.UITools>[];
|
|
412
|
+
}>;
|
|
321
413
|
}
|
|
322
414
|
type VectorOperationResponse = Promise<{
|
|
323
415
|
count: number;
|
|
@@ -425,6 +517,7 @@ type ExuluContextFieldProcessor = {
|
|
|
425
517
|
}) => Promise<string>;
|
|
426
518
|
config?: {
|
|
427
519
|
queue?: Promise<ExuluQueueConfig>;
|
|
520
|
+
timeoutInSeconds?: number;
|
|
428
521
|
trigger: "manual" | "onUpdate" | "onCreate" | "always";
|
|
429
522
|
};
|
|
430
523
|
};
|
|
@@ -494,9 +587,18 @@ declare class ExuluContext {
|
|
|
494
587
|
chunks?: number;
|
|
495
588
|
job?: string;
|
|
496
589
|
}>;
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
590
|
+
createItem: (item: Item, config: ExuluConfig, user?: number, role?: string, upsert?: boolean) => Promise<{
|
|
591
|
+
item: Item;
|
|
592
|
+
job?: string;
|
|
593
|
+
}>;
|
|
594
|
+
updateItem: (item: Item, config: ExuluConfig, user?: number, role?: string) => Promise<{
|
|
595
|
+
item: Item;
|
|
596
|
+
job?: string;
|
|
597
|
+
}>;
|
|
598
|
+
deleteItem: (item: Item, user?: number, role?: string) => Promise<{
|
|
599
|
+
id: string;
|
|
600
|
+
job?: string;
|
|
601
|
+
}>;
|
|
500
602
|
embeddings: {
|
|
501
603
|
generate: {
|
|
502
604
|
one: ({ item, user, role, trigger, config }: {
|
|
@@ -549,15 +651,46 @@ declare class ExuluQueues {
|
|
|
549
651
|
concurrency: number;
|
|
550
652
|
}[];
|
|
551
653
|
constructor();
|
|
654
|
+
list: Map<string, {
|
|
655
|
+
name: string;
|
|
656
|
+
concurrency: number;
|
|
657
|
+
ratelimit: number;
|
|
658
|
+
use: () => Promise<ExuluQueueConfig>;
|
|
659
|
+
}>;
|
|
552
660
|
queue(name: string): {
|
|
553
661
|
queue: Queue;
|
|
554
662
|
ratelimit: number;
|
|
555
663
|
concurrency: number;
|
|
556
664
|
} | undefined;
|
|
557
|
-
|
|
665
|
+
register: (name: string, concurrency?: number, ratelimit?: number) => {
|
|
666
|
+
use: () => Promise<ExuluQueueConfig>;
|
|
667
|
+
};
|
|
558
668
|
}
|
|
559
669
|
declare const queues: ExuluQueues;
|
|
560
670
|
|
|
671
|
+
/**
|
|
672
|
+
* Create metadata for console logging that will be used by S3 transport
|
|
673
|
+
* to group logs by ID and store them in S3 with the ID as prefix
|
|
674
|
+
*
|
|
675
|
+
* @param id - The ID to group logs by (e.g., job ID, request ID, etc.)
|
|
676
|
+
* @param additionalMetadata - Any additional metadata to include with the log
|
|
677
|
+
* @returns Metadata object to pass as the last argument to console methods
|
|
678
|
+
*
|
|
679
|
+
* @example
|
|
680
|
+
* ```typescript
|
|
681
|
+
* import { logMetadata } from './registry/log-metadata';
|
|
682
|
+
*
|
|
683
|
+
* const jobId = 'job-123';
|
|
684
|
+
* console.log('Starting job', logMetadata(jobId));
|
|
685
|
+
* console.log('Processing...', logMetadata(jobId, { step: 'validation' }));
|
|
686
|
+
* console.error('Job failed', logMetadata(jobId, { error: 'timeout' }));
|
|
687
|
+
* ```
|
|
688
|
+
*/
|
|
689
|
+
declare function logMetadata(id: string, additionalMetadata?: Record<string, any>): {
|
|
690
|
+
__logMetadata: boolean;
|
|
691
|
+
id: string;
|
|
692
|
+
};
|
|
693
|
+
|
|
561
694
|
/**
|
|
562
695
|
* Represents the data structure for a chunk object.
|
|
563
696
|
*
|
|
@@ -1500,4 +1633,4 @@ declare const ExuluChunkers: {
|
|
|
1500
1633
|
};
|
|
1501
1634
|
};
|
|
1502
1635
|
|
|
1503
|
-
export { type JOB_STATUS as EXULU_JOB_STATUS, JOB_STATUS_ENUM as EXULU_JOB_STATUS_ENUM, type STATISTICS_TYPE as EXULU_STATISTICS_TYPE, STATISTICS_TYPE_ENUM as EXULU_STATISTICS_TYPE_ENUM, ExuluAgent, ExuluApp, authentication as ExuluAuthentication, ExuluChunkers, ExuluContext, ExuluDefaultAgents, ExuluDefaultContexts, ExuluEmbedder, ExuluEval, type ExuluEvalMetadata, type ExuluEvalTokenMetadata, ExuluJobs, ExuluOtel, type ExuluQueueConfig, queues as ExuluQueues, ExuluTool, ExuluUtils, ExuluVariables, db };
|
|
1636
|
+
export { type JOB_STATUS as EXULU_JOB_STATUS, JOB_STATUS_ENUM as EXULU_JOB_STATUS_ENUM, type STATISTICS_TYPE as EXULU_STATISTICS_TYPE, STATISTICS_TYPE_ENUM as EXULU_STATISTICS_TYPE_ENUM, ExuluAgent, ExuluApp, authentication as ExuluAuthentication, ExuluChunkers, ExuluContext, ExuluDefaultAgents, ExuluDefaultContexts, ExuluEmbedder, ExuluEval, type ExuluEvalMetadata, type ExuluEvalTokenMetadata, ExuluJobs, ExuluOtel, type ExuluQueueConfig, queues as ExuluQueues, ExuluTool, ExuluUtils, ExuluVariables, db, logMetadata };
|