chatifai 1.0.15 → 1.0.16

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.ts CHANGED
@@ -229,9 +229,9 @@ export declare const ContextSchema: Schema<any, import("mongoose").Model<any, an
229
229
  created_at?: number | null | undefined;
230
230
  updated_at?: number | null | undefined;
231
231
  organization_id?: string | null | undefined;
232
- file_id?: string | null | undefined;
233
- description?: string | null | undefined;
232
+ ai_description?: string | null | undefined;
234
233
  note?: string | null | undefined;
234
+ file_id?: string | null | undefined;
235
235
  file_url?: string | null | undefined;
236
236
  file_gcs_url?: string | null | undefined;
237
237
  file_name?: string | null | undefined;
@@ -254,9 +254,9 @@ export declare const ContextSchema: Schema<any, import("mongoose").Model<any, an
254
254
  created_at?: number | null | undefined;
255
255
  updated_at?: number | null | undefined;
256
256
  organization_id?: string | null | undefined;
257
- file_id?: string | null | undefined;
258
- description?: string | null | undefined;
257
+ ai_description?: string | null | undefined;
259
258
  note?: string | null | undefined;
259
+ file_id?: string | null | undefined;
260
260
  file_url?: string | null | undefined;
261
261
  file_gcs_url?: string | null | undefined;
262
262
  file_name?: string | null | undefined;
@@ -279,9 +279,9 @@ export declare const ContextSchema: Schema<any, import("mongoose").Model<any, an
279
279
  created_at?: number | null | undefined;
280
280
  updated_at?: number | null | undefined;
281
281
  organization_id?: string | null | undefined;
282
- file_id?: string | null | undefined;
283
- description?: string | null | undefined;
282
+ ai_description?: string | null | undefined;
284
283
  note?: string | null | undefined;
284
+ file_id?: string | null | undefined;
285
285
  file_url?: string | null | undefined;
286
286
  file_gcs_url?: string | null | undefined;
287
287
  file_name?: string | null | undefined;
@@ -312,43 +312,82 @@ export declare const ChunkSchema: Schema<any, import("mongoose").Model<any, any,
312
312
  createdAt: NativeDate;
313
313
  updatedAt: NativeDate;
314
314
  } & {
315
- embedding: number[];
315
+ type: string;
316
+ organization_id: string;
317
+ context_id: string;
318
+ text: string;
319
+ page_start: number;
320
+ page_end: number;
321
+ hierarchy: string[];
322
+ characters_length: number;
323
+ words_length: number;
324
+ embeddings: number[];
316
325
  created_at?: number | null | undefined;
326
+ updated_at?: number | null | undefined;
327
+ embeddings_meta_data?: {
328
+ model: string;
329
+ dimensions: number;
330
+ text_length: number;
331
+ processing_time: number;
332
+ } | null | undefined;
317
333
  metadata?: {
318
- organization_id: string;
319
- file_id: string;
320
- context_id: string;
321
- chunk_index: number;
322
- text_preview: string;
323
- page_number?: number | null | undefined;
334
+ block_id: string;
335
+ level: number;
336
+ has_children: boolean;
324
337
  } | null | undefined;
325
338
  }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
326
339
  createdAt: NativeDate;
327
340
  updatedAt: NativeDate;
328
341
  } & {
329
- embedding: number[];
342
+ type: string;
343
+ organization_id: string;
344
+ context_id: string;
345
+ text: string;
346
+ page_start: number;
347
+ page_end: number;
348
+ hierarchy: string[];
349
+ characters_length: number;
350
+ words_length: number;
351
+ embeddings: number[];
330
352
  created_at?: number | null | undefined;
353
+ updated_at?: number | null | undefined;
354
+ embeddings_meta_data?: {
355
+ model: string;
356
+ dimensions: number;
357
+ text_length: number;
358
+ processing_time: number;
359
+ } | null | undefined;
331
360
  metadata?: {
332
- organization_id: string;
333
- file_id: string;
334
- context_id: string;
335
- chunk_index: number;
336
- text_preview: string;
337
- page_number?: number | null | undefined;
361
+ block_id: string;
362
+ level: number;
363
+ has_children: boolean;
338
364
  } | null | undefined;
339
365
  }>, {}> & import("mongoose").FlatRecord<{
340
366
  createdAt: NativeDate;
341
367
  updatedAt: NativeDate;
342
368
  } & {
343
- embedding: number[];
369
+ type: string;
370
+ organization_id: string;
371
+ context_id: string;
372
+ text: string;
373
+ page_start: number;
374
+ page_end: number;
375
+ hierarchy: string[];
376
+ characters_length: number;
377
+ words_length: number;
378
+ embeddings: number[];
344
379
  created_at?: number | null | undefined;
380
+ updated_at?: number | null | undefined;
381
+ embeddings_meta_data?: {
382
+ model: string;
383
+ dimensions: number;
384
+ text_length: number;
385
+ processing_time: number;
386
+ } | null | undefined;
345
387
  metadata?: {
346
- organization_id: string;
347
- file_id: string;
348
- context_id: string;
349
- chunk_index: number;
350
- text_preview: string;
351
- page_number?: number | null | undefined;
388
+ block_id: string;
389
+ level: number;
390
+ has_children: boolean;
352
391
  } | null | undefined;
353
392
  }> & {
354
393
  _id: import("mongoose").Types.ObjectId;
package/dist/index.js CHANGED
@@ -82,10 +82,10 @@ exports.AgentSchema = new mongoose_1.Schema({
82
82
  });
83
83
  exports.ContextSchema = new mongoose_1.Schema({
84
84
  organization_id: { type: String },
85
- file_id: { type: String },
86
85
  title: { type: String, required: true, minlength: 1, maxlength: 100 },
87
- description: { type: String, minlength: 1, maxlength: 500 },
86
+ ai_description: { type: String, minlength: 1, maxlength: 500 },
88
87
  note: { type: String, maxlength: 500 },
88
+ file_id: { type: String },
89
89
  file_url: { type: String },
90
90
  file_gcs_url: { type: String },
91
91
  file_name: { type: String },
@@ -111,16 +111,29 @@ exports.ContextSchema = new mongoose_1.Schema({
111
111
  // encryptionType: 'csfle',
112
112
  });
113
113
  exports.ChunkSchema = new mongoose_1.Schema({
114
- embedding: { type: [Number], required: true },
114
+ organization_id: { type: String, required: true },
115
+ context_id: { type: String, required: true },
116
+ text: { type: String, required: true },
117
+ type: { type: String, required: true },
118
+ page_start: { type: Number, required: true },
119
+ page_end: { type: Number, required: true },
120
+ hierarchy: { type: [String], required: true },
121
+ characters_length: { type: Number, required: true },
122
+ words_length: { type: Number, required: true },
123
+ embeddings: { type: [Number], required: true },
124
+ embeddings_meta_data: {
125
+ model: { type: String, required: true },
126
+ dimensions: { type: Number, required: true },
127
+ text_length: { type: Number, required: true },
128
+ processing_time: { type: Number, required: true },
129
+ },
115
130
  metadata: {
116
- organization_id: { type: String, required: true },
117
- context_id: { type: String, required: true },
118
- file_id: { type: String, required: true },
119
- page_number: { type: Number },
120
- chunk_index: { type: Number, required: true },
121
- text_preview: { type: String, required: true },
131
+ block_id: { type: String, required: true },
132
+ level: { type: Number, required: true },
133
+ has_children: { type: Boolean, required: true },
122
134
  },
123
135
  created_at: { type: Number },
136
+ updated_at: { type: Number },
124
137
  }, {
125
138
  versionKey: false,
126
139
  toJSON: { virtuals: true },
package/dist/types.d.ts CHANGED
@@ -84,10 +84,10 @@ export declare const zodUserSchema: z.ZodObject<{
84
84
  export declare const zodContextSchema: z.ZodObject<{
85
85
  _id: z.ZodOptional<z.ZodString>;
86
86
  organization_id: z.ZodOptional<z.ZodString>;
87
- file_id: z.ZodOptional<z.ZodString>;
88
87
  title: z.ZodString;
89
- description: z.ZodOptional<z.ZodString>;
88
+ ai_description: z.ZodOptional<z.ZodString>;
90
89
  note: z.ZodOptional<z.ZodString>;
90
+ file_id: z.ZodOptional<z.ZodString>;
91
91
  file_url: z.ZodOptional<z.ZodString>;
92
92
  file_gcs_url: z.ZodOptional<z.ZodString>;
93
93
  file_name: z.ZodOptional<z.ZodString>;
@@ -119,9 +119,9 @@ export declare const zodContextSchema: z.ZodObject<{
119
119
  created_at?: number | undefined;
120
120
  updated_at?: number | undefined;
121
121
  organization_id?: string | undefined;
122
- file_id?: string | undefined;
123
- description?: string | undefined;
122
+ ai_description?: string | undefined;
124
123
  note?: string | undefined;
124
+ file_id?: string | undefined;
125
125
  file_url?: string | undefined;
126
126
  file_gcs_url?: string | undefined;
127
127
  file_name?: string | undefined;
@@ -142,9 +142,9 @@ export declare const zodContextSchema: z.ZodObject<{
142
142
  created_at?: number | undefined;
143
143
  updated_at?: number | undefined;
144
144
  organization_id?: string | undefined;
145
- file_id?: string | undefined;
146
- description?: string | undefined;
145
+ ai_description?: string | undefined;
147
146
  note?: string | undefined;
147
+ file_id?: string | undefined;
148
148
  file_url?: string | undefined;
149
149
  file_gcs_url?: string | undefined;
150
150
  file_name?: string | undefined;
@@ -159,57 +159,6 @@ export declare const zodContextSchema: z.ZodObject<{
159
159
  bucket_name?: string | undefined;
160
160
  processing_status?: "pending" | "processing" | "completed" | "failed" | undefined;
161
161
  }>;
162
- export declare const zodChunkSchema: z.ZodObject<{
163
- _id: z.ZodOptional<z.ZodString>;
164
- embedding: z.ZodArray<z.ZodNumber, "many">;
165
- metadata: z.ZodObject<{
166
- organization_id: z.ZodString;
167
- context_id: z.ZodString;
168
- file_id: z.ZodString;
169
- page_number: z.ZodOptional<z.ZodNumber>;
170
- chunk_index: z.ZodNumber;
171
- text_preview: z.ZodString;
172
- }, "strip", z.ZodTypeAny, {
173
- organization_id: string;
174
- file_id: string;
175
- context_id: string;
176
- chunk_index: number;
177
- text_preview: string;
178
- page_number?: number | undefined;
179
- }, {
180
- organization_id: string;
181
- file_id: string;
182
- context_id: string;
183
- chunk_index: number;
184
- text_preview: string;
185
- page_number?: number | undefined;
186
- }>;
187
- created_at: z.ZodOptional<z.ZodNumber>;
188
- }, "strip", z.ZodTypeAny, {
189
- embedding: number[];
190
- metadata: {
191
- organization_id: string;
192
- file_id: string;
193
- context_id: string;
194
- chunk_index: number;
195
- text_preview: string;
196
- page_number?: number | undefined;
197
- };
198
- _id?: string | undefined;
199
- created_at?: number | undefined;
200
- }, {
201
- embedding: number[];
202
- metadata: {
203
- organization_id: string;
204
- file_id: string;
205
- context_id: string;
206
- chunk_index: number;
207
- text_preview: string;
208
- page_number?: number | undefined;
209
- };
210
- _id?: string | undefined;
211
- created_at?: number | undefined;
212
- }>;
213
162
  export declare const zodAgentSchema: z.ZodObject<{
214
163
  _id: z.ZodOptional<z.ZodString>;
215
164
  organization_id: z.ZodOptional<z.ZodString>;
@@ -284,6 +233,116 @@ export declare const zodQuerySchema: z.ZodObject<{
284
233
  context_ids?: string[] | undefined;
285
234
  users_ids?: string[] | undefined;
286
235
  }>;
236
+ export declare const zodChunkSchema: z.ZodObject<{
237
+ _id: z.ZodOptional<z.ZodString>;
238
+ organization_id: z.ZodString;
239
+ context_id: z.ZodString;
240
+ text: z.ZodString;
241
+ type: z.ZodString;
242
+ page_start: z.ZodNumber;
243
+ page_end: z.ZodNumber;
244
+ hierarchy: z.ZodArray<z.ZodString, "many">;
245
+ characters_length: z.ZodNumber;
246
+ words_length: z.ZodNumber;
247
+ embeddings: z.ZodArray<z.ZodNumber, "many">;
248
+ embeddings_meta_data: z.ZodObject<{
249
+ model: z.ZodString;
250
+ dimensions: z.ZodNumber;
251
+ text_length: z.ZodNumber;
252
+ processing_time: z.ZodNumber;
253
+ }, "strip", z.ZodTypeAny, {
254
+ model: string;
255
+ dimensions: number;
256
+ text_length: number;
257
+ processing_time: number;
258
+ }, {
259
+ model: string;
260
+ dimensions: number;
261
+ text_length: number;
262
+ processing_time: number;
263
+ }>;
264
+ metadata: z.ZodObject<{
265
+ block_id: z.ZodString;
266
+ level: z.ZodNumber;
267
+ has_children: z.ZodBoolean;
268
+ }, "strip", z.ZodTypeAny, {
269
+ block_id: string;
270
+ level: number;
271
+ has_children: boolean;
272
+ }, {
273
+ block_id: string;
274
+ level: number;
275
+ has_children: boolean;
276
+ }>;
277
+ created_at: z.ZodOptional<z.ZodNumber>;
278
+ updated_at: z.ZodOptional<z.ZodNumber>;
279
+ }, "strip", z.ZodTypeAny, {
280
+ type: string;
281
+ organization_id: string;
282
+ context_id: string;
283
+ text: string;
284
+ page_start: number;
285
+ page_end: number;
286
+ hierarchy: string[];
287
+ characters_length: number;
288
+ words_length: number;
289
+ embeddings: number[];
290
+ embeddings_meta_data: {
291
+ model: string;
292
+ dimensions: number;
293
+ text_length: number;
294
+ processing_time: number;
295
+ };
296
+ metadata: {
297
+ block_id: string;
298
+ level: number;
299
+ has_children: boolean;
300
+ };
301
+ _id?: string | undefined;
302
+ created_at?: number | undefined;
303
+ updated_at?: number | undefined;
304
+ }, {
305
+ type: string;
306
+ organization_id: string;
307
+ context_id: string;
308
+ text: string;
309
+ page_start: number;
310
+ page_end: number;
311
+ hierarchy: string[];
312
+ characters_length: number;
313
+ words_length: number;
314
+ embeddings: number[];
315
+ embeddings_meta_data: {
316
+ model: string;
317
+ dimensions: number;
318
+ text_length: number;
319
+ processing_time: number;
320
+ };
321
+ metadata: {
322
+ block_id: string;
323
+ level: number;
324
+ has_children: boolean;
325
+ };
326
+ _id?: string | undefined;
327
+ created_at?: number | undefined;
328
+ updated_at?: number | undefined;
329
+ }>;
330
+ export declare const zodFullTextSchema: z.ZodObject<{
331
+ _id: z.ZodOptional<z.ZodString>;
332
+ organization_id: z.ZodString;
333
+ context_id: z.ZodString;
334
+ full_text: z.ZodString;
335
+ }, "strip", z.ZodTypeAny, {
336
+ organization_id: string;
337
+ context_id: string;
338
+ full_text: string;
339
+ _id?: string | undefined;
340
+ }, {
341
+ organization_id: string;
342
+ context_id: string;
343
+ full_text: string;
344
+ _id?: string | undefined;
345
+ }>;
287
346
  export type EventAttributeType = {
288
347
  http_request: {
289
348
  client_ip?: string;
@@ -298,3 +357,10 @@ export type ChunkType = z.infer<typeof zodChunkSchema>;
298
357
  export type QueryType = z.infer<typeof zodQuerySchema>;
299
358
  export type ModelType = (typeof modelsList)[number];
300
359
  export type UserRoleType = (typeof userRoles)[number];
360
+ export declare enum FileType {
361
+ PDF = "application/pdf",
362
+ WORD = "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
363
+ PPTX = "application/vnd.openxmlformats-officedocument.presentationml.presentation",
364
+ XLSX = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
365
+ HTML = "text/html"
366
+ }
package/dist/types.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.zodQuerySchema = exports.zodAgentSchema = exports.zodChunkSchema = exports.zodContextSchema = exports.zodUserSchema = exports.zodOrganizationSchema = exports.userRoles = exports.modelsList = void 0;
3
+ exports.FileType = exports.zodFullTextSchema = exports.zodChunkSchema = exports.zodQuerySchema = exports.zodAgentSchema = exports.zodContextSchema = exports.zodUserSchema = exports.zodOrganizationSchema = exports.userRoles = exports.modelsList = void 0;
4
4
  const zod_1 = require("zod");
5
5
  exports.modelsList = [
6
6
  'gemini-2.5-flash-lite',
@@ -44,10 +44,10 @@ exports.zodUserSchema = zod_1.z.object({
44
44
  exports.zodContextSchema = zod_1.z.object({
45
45
  _id: zod_1.z.string().optional(),
46
46
  organization_id: zod_1.z.string().optional(),
47
- file_id: zod_1.z.string().optional(),
48
47
  title: zod_1.z.string().min(1).max(100),
49
- description: zod_1.z.string().min(1).max(500).optional(),
48
+ ai_description: zod_1.z.string().min(1).max(500).optional(),
50
49
  note: zod_1.z.string().max(500).optional(),
50
+ file_id: zod_1.z.string().optional(),
51
51
  file_url: zod_1.z.string().optional(),
52
52
  file_gcs_url: zod_1.z.string().optional(),
53
53
  file_name: zod_1.z.string().optional(),
@@ -69,19 +69,6 @@ exports.zodContextSchema = zod_1.z.object({
69
69
  .enum(['pending', 'processing', 'completed', 'failed'])
70
70
  .optional(),
71
71
  });
72
- exports.zodChunkSchema = zod_1.z.object({
73
- _id: zod_1.z.string().optional(),
74
- embedding: zod_1.z.array(zod_1.z.number()),
75
- metadata: zod_1.z.object({
76
- organization_id: zod_1.z.string(),
77
- context_id: zod_1.z.string(),
78
- file_id: zod_1.z.string(),
79
- page_number: zod_1.z.number().optional(),
80
- chunk_index: zod_1.z.number(),
81
- text_preview: zod_1.z.string(),
82
- }),
83
- created_at: zod_1.z.number().optional(),
84
- });
85
72
  exports.zodAgentSchema = zod_1.z.object({
86
73
  _id: zod_1.z.string().optional(),
87
74
  organization_id: zod_1.z.string().optional(),
@@ -108,3 +95,43 @@ exports.zodQuerySchema = zod_1.z.object({
108
95
  created_at: zod_1.z.number().optional(),
109
96
  updated_at: zod_1.z.number().optional(),
110
97
  });
98
+ exports.zodChunkSchema = zod_1.z.object({
99
+ _id: zod_1.z.string().optional(),
100
+ organization_id: zod_1.z.string(),
101
+ context_id: zod_1.z.string(),
102
+ text: zod_1.z.string(),
103
+ type: zod_1.z.string(),
104
+ page_start: zod_1.z.number(),
105
+ page_end: zod_1.z.number(),
106
+ hierarchy: zod_1.z.array(zod_1.z.string()),
107
+ characters_length: zod_1.z.number(),
108
+ words_length: zod_1.z.number(),
109
+ embeddings: zod_1.z.array(zod_1.z.number()),
110
+ embeddings_meta_data: zod_1.z.object({
111
+ model: zod_1.z.string(),
112
+ dimensions: zod_1.z.number(),
113
+ text_length: zod_1.z.number(),
114
+ processing_time: zod_1.z.number(),
115
+ }),
116
+ metadata: zod_1.z.object({
117
+ block_id: zod_1.z.string(),
118
+ level: zod_1.z.number(),
119
+ has_children: zod_1.z.boolean(),
120
+ }),
121
+ created_at: zod_1.z.number().optional(),
122
+ updated_at: zod_1.z.number().optional(),
123
+ });
124
+ exports.zodFullTextSchema = zod_1.z.object({
125
+ _id: zod_1.z.string().optional(),
126
+ organization_id: zod_1.z.string(),
127
+ context_id: zod_1.z.string(),
128
+ full_text: zod_1.z.string(),
129
+ });
130
+ var FileType;
131
+ (function (FileType) {
132
+ FileType["PDF"] = "application/pdf";
133
+ FileType["WORD"] = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
134
+ FileType["PPTX"] = "application/vnd.openxmlformats-officedocument.presentationml.presentation";
135
+ FileType["XLSX"] = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
136
+ FileType["HTML"] = "text/html";
137
+ })(FileType = exports.FileType || (exports.FileType = {}));
package/index.ts CHANGED
@@ -80,10 +80,10 @@ export const AgentSchema = new Schema(
80
80
  export const ContextSchema = new Schema(
81
81
  {
82
82
  organization_id: { type: String },
83
- file_id: { type: String },
84
83
  title: { type: String, required: true, minlength: 1, maxlength: 100 },
85
- description: { type: String, minlength: 1, maxlength: 500 },
84
+ ai_description: { type: String, minlength: 1, maxlength: 500 },
86
85
  note: { type: String, maxlength: 500 },
86
+ file_id: { type: String },
87
87
  file_url: { type: String },
88
88
  file_gcs_url: { type: String },
89
89
  file_name: { type: String },
@@ -113,16 +113,29 @@ export const ContextSchema = new Schema(
113
113
 
114
114
  export const ChunkSchema = new Schema(
115
115
  {
116
- embedding: { type: [Number], required: true },
116
+ organization_id: { type: String, required: true },
117
+ context_id: { type: String, required: true },
118
+ text: { type: String, required: true },
119
+ type: { type: String, required: true },
120
+ page_start: { type: Number, required: true },
121
+ page_end: { type: Number, required: true },
122
+ hierarchy: { type: [String], required: true },
123
+ characters_length: { type: Number, required: true },
124
+ words_length: { type: Number, required: true },
125
+ embeddings: { type: [Number], required: true },
126
+ embeddings_meta_data: {
127
+ model: { type: String, required: true },
128
+ dimensions: { type: Number, required: true },
129
+ text_length: { type: Number, required: true },
130
+ processing_time: { type: Number, required: true },
131
+ },
117
132
  metadata: {
118
- organization_id: { type: String, required: true },
119
- context_id: { type: String, required: true },
120
- file_id: { type: String, required: true },
121
- page_number: { type: Number },
122
- chunk_index: { type: Number, required: true },
123
- text_preview: { type: String, required: true },
133
+ block_id: { type: String, required: true },
134
+ level: { type: Number, required: true },
135
+ has_children: { type: Boolean, required: true },
124
136
  },
125
137
  created_at: { type: Number },
138
+ updated_at: { type: Number },
126
139
  },
127
140
  {
128
141
  versionKey: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chatifai",
3
- "version": "1.0.15",
3
+ "version": "1.0.16",
4
4
  "description": "SDK for interacting with the Chatifai API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/types.ts CHANGED
@@ -46,10 +46,10 @@ export const zodUserSchema = z.object({
46
46
  export const zodContextSchema = z.object({
47
47
  _id: z.string().optional(),
48
48
  organization_id: z.string().optional(),
49
- file_id: z.string().optional(),
50
49
  title: z.string().min(1).max(100),
51
- description: z.string().min(1).max(500).optional(),
50
+ ai_description: z.string().min(1).max(500).optional(), // Generated by AI
52
51
  note: z.string().max(500).optional(),
52
+ file_id: z.string().optional(),
53
53
  file_url: z.string().optional(),
54
54
  file_gcs_url: z.string().optional(),
55
55
  file_name: z.string().optional(),
@@ -72,20 +72,6 @@ export const zodContextSchema = z.object({
72
72
  .optional(),
73
73
  });
74
74
 
75
- export const zodChunkSchema = z.object({
76
- _id: z.string().optional(),
77
- embedding: z.array(z.number()),
78
- metadata: z.object({
79
- organization_id: z.string(),
80
- context_id: z.string(),
81
- file_id: z.string(),
82
- page_number: z.number().optional(),
83
- chunk_index: z.number(),
84
- text_preview: z.string(),
85
- }),
86
- created_at: z.number().optional(),
87
- });
88
-
89
75
  export const zodAgentSchema = z.object({
90
76
  _id: z.string().optional(),
91
77
  organization_id: z.string().optional(),
@@ -114,6 +100,40 @@ export const zodQuerySchema = z.object({
114
100
  updated_at: z.number().optional(),
115
101
  });
116
102
 
103
+ export const zodChunkSchema = z.object({
104
+ _id: z.string().optional(),
105
+ organization_id: z.string(),
106
+ context_id: z.string(),
107
+ text: z.string(),
108
+ type: z.string(),
109
+ page_start: z.number(),
110
+ page_end: z.number(),
111
+ hierarchy: z.array(z.string()),
112
+ characters_length: z.number(),
113
+ words_length: z.number(),
114
+ embeddings: z.array(z.number()),
115
+ embeddings_meta_data: z.object({
116
+ model: z.string(),
117
+ dimensions: z.number(),
118
+ text_length: z.number(),
119
+ processing_time: z.number(),
120
+ }),
121
+ metadata: z.object({
122
+ block_id: z.string(),
123
+ level: z.number(),
124
+ has_children: z.boolean(),
125
+ }),
126
+ created_at: z.number().optional(),
127
+ updated_at: z.number().optional(),
128
+ });
129
+
130
+ export const zodFullTextSchema = z.object({
131
+ _id: z.string().optional(),
132
+ organization_id: z.string(),
133
+ context_id: z.string(),
134
+ full_text: z.string(),
135
+ });
136
+
117
137
  export type EventAttributeType = {
118
138
  http_request: {
119
139
  client_ip?: string;
@@ -129,3 +149,11 @@ export type ChunkType = z.infer<typeof zodChunkSchema>;
129
149
  export type QueryType = z.infer<typeof zodQuerySchema>;
130
150
  export type ModelType = (typeof modelsList)[number];
131
151
  export type UserRoleType = (typeof userRoles)[number];
152
+
153
+ export enum FileType {
154
+ PDF = 'application/pdf',
155
+ WORD = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
156
+ PPTX = 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
157
+ XLSX = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
158
+ HTML = 'text/html',
159
+ }