@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/CHANGELOG.md +2 -2
- package/dist/index.cjs +291 -263
- package/dist/index.d.cts +27 -15
- package/dist/index.d.ts +27 -15
- package/dist/index.js +282 -254
- package/package.json +3 -3
- package/types/enums/field-types.ts +1 -1
- package/types/enums/statistics.ts +10 -10
- package/types/models/agent.ts +0 -1
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 {
|
|
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 = "
|
|
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
|
-
}) =>
|
|
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
|
-
}) =>
|
|
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: ({
|
|
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: ({
|
|
175
|
-
|
|
176
|
-
|
|
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
|
-
}) =>
|
|
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:
|
|
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 {
|
|
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 = "
|
|
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
|
-
}) =>
|
|
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
|
-
}) =>
|
|
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: ({
|
|
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: ({
|
|
175
|
-
|
|
176
|
-
|
|
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
|
-
}) =>
|
|
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:
|
|
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;
|