chatifai 1.0.26 → 1.0.27
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 +6 -3
- package/dist/index.js +2 -1
- package/dist/types.d.ts +37 -3
- package/dist/types.js +9 -1
- package/index.ts +2 -1
- package/package.json +1 -1
- package/types.ts +13 -6
package/dist/index.d.ts
CHANGED
|
@@ -543,6 +543,7 @@ export declare const PreDefinedQuerySchema: Schema<any, import("mongoose").Model
|
|
|
543
543
|
getOwnPropertyDescriptors?: {} | null | undefined;
|
|
544
544
|
fromEntries?: {} | null | undefined;
|
|
545
545
|
}>;
|
|
546
|
+
full_document_search: boolean;
|
|
546
547
|
users: import("mongoose").Types.DocumentArray<{
|
|
547
548
|
entries?: {} | null | undefined;
|
|
548
549
|
keys?: {} | null | undefined;
|
|
@@ -670,13 +671,13 @@ export declare const PreDefinedQuerySchema: Schema<any, import("mongoose").Model
|
|
|
670
671
|
getOwnPropertyDescriptors?: {} | null | undefined;
|
|
671
672
|
fromEntries?: {} | null | undefined;
|
|
672
673
|
}>;
|
|
674
|
+
click_count: number;
|
|
673
675
|
created_at?: number | null | undefined;
|
|
674
676
|
updated_at?: number | null | undefined;
|
|
675
677
|
organization_id?: string | null | undefined;
|
|
676
678
|
instructions?: string | null | undefined;
|
|
677
679
|
query_name?: string | null | undefined;
|
|
678
680
|
query_hint?: string | null | undefined;
|
|
679
|
-
click_count?: number | null | undefined;
|
|
680
681
|
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
681
682
|
createdAt: NativeDate;
|
|
682
683
|
updatedAt: NativeDate;
|
|
@@ -810,6 +811,7 @@ export declare const PreDefinedQuerySchema: Schema<any, import("mongoose").Model
|
|
|
810
811
|
getOwnPropertyDescriptors?: {} | null | undefined;
|
|
811
812
|
fromEntries?: {} | null | undefined;
|
|
812
813
|
}>;
|
|
814
|
+
full_document_search: boolean;
|
|
813
815
|
users: import("mongoose").Types.DocumentArray<{
|
|
814
816
|
entries?: {} | null | undefined;
|
|
815
817
|
keys?: {} | null | undefined;
|
|
@@ -937,13 +939,13 @@ export declare const PreDefinedQuerySchema: Schema<any, import("mongoose").Model
|
|
|
937
939
|
getOwnPropertyDescriptors?: {} | null | undefined;
|
|
938
940
|
fromEntries?: {} | null | undefined;
|
|
939
941
|
}>;
|
|
942
|
+
click_count: number;
|
|
940
943
|
created_at?: number | null | undefined;
|
|
941
944
|
updated_at?: number | null | undefined;
|
|
942
945
|
organization_id?: string | null | undefined;
|
|
943
946
|
instructions?: string | null | undefined;
|
|
944
947
|
query_name?: string | null | undefined;
|
|
945
948
|
query_hint?: string | null | undefined;
|
|
946
|
-
click_count?: number | null | undefined;
|
|
947
949
|
}>, {}> & import("mongoose").FlatRecord<{
|
|
948
950
|
createdAt: NativeDate;
|
|
949
951
|
updatedAt: NativeDate;
|
|
@@ -1077,6 +1079,7 @@ export declare const PreDefinedQuerySchema: Schema<any, import("mongoose").Model
|
|
|
1077
1079
|
getOwnPropertyDescriptors?: {} | null | undefined;
|
|
1078
1080
|
fromEntries?: {} | null | undefined;
|
|
1079
1081
|
}>;
|
|
1082
|
+
full_document_search: boolean;
|
|
1080
1083
|
users: import("mongoose").Types.DocumentArray<{
|
|
1081
1084
|
entries?: {} | null | undefined;
|
|
1082
1085
|
keys?: {} | null | undefined;
|
|
@@ -1204,13 +1207,13 @@ export declare const PreDefinedQuerySchema: Schema<any, import("mongoose").Model
|
|
|
1204
1207
|
getOwnPropertyDescriptors?: {} | null | undefined;
|
|
1205
1208
|
fromEntries?: {} | null | undefined;
|
|
1206
1209
|
}>;
|
|
1210
|
+
click_count: number;
|
|
1207
1211
|
created_at?: number | null | undefined;
|
|
1208
1212
|
updated_at?: number | null | undefined;
|
|
1209
1213
|
organization_id?: string | null | undefined;
|
|
1210
1214
|
instructions?: string | null | undefined;
|
|
1211
1215
|
query_name?: string | null | undefined;
|
|
1212
1216
|
query_hint?: string | null | undefined;
|
|
1213
|
-
click_count?: number | null | undefined;
|
|
1214
1217
|
}> & {
|
|
1215
1218
|
_id: import("mongoose").Types.ObjectId;
|
|
1216
1219
|
} & {
|
package/dist/index.js
CHANGED
|
@@ -158,8 +158,9 @@ exports.PreDefinedQuerySchema = new mongoose_1.Schema({
|
|
|
158
158
|
default: 'active',
|
|
159
159
|
required: true,
|
|
160
160
|
},
|
|
161
|
+
full_document_search: { type: Boolean, default: false },
|
|
161
162
|
users: { type: [Object] },
|
|
162
|
-
click_count: { type: Number },
|
|
163
|
+
click_count: { type: Number, default: 0 },
|
|
163
164
|
created_at: { type: Number },
|
|
164
165
|
updated_at: { type: Number },
|
|
165
166
|
}, {
|
package/dist/types.d.ts
CHANGED
|
@@ -403,6 +403,7 @@ export declare const zodPreDefinedQuerySchema: z.ZodObject<{
|
|
|
403
403
|
bucket_name?: string | undefined;
|
|
404
404
|
processing_status?: "pending" | "processing" | "completed" | "failed" | undefined;
|
|
405
405
|
}>, "many">>;
|
|
406
|
+
full_document_search: z.ZodOptional<z.ZodBoolean>;
|
|
406
407
|
status: z.ZodDefault<z.ZodEnum<["active", "inactive", "archived"]>>;
|
|
407
408
|
users: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
408
409
|
_id: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
@@ -481,6 +482,7 @@ export declare const zodPreDefinedQuerySchema: z.ZodObject<{
|
|
|
481
482
|
bucket_name?: string | undefined;
|
|
482
483
|
processing_status?: "pending" | "processing" | "completed" | "failed" | undefined;
|
|
483
484
|
}[] | undefined;
|
|
485
|
+
full_document_search?: boolean | undefined;
|
|
484
486
|
users?: {
|
|
485
487
|
_id?: string | undefined;
|
|
486
488
|
created_at?: number | undefined;
|
|
@@ -530,6 +532,7 @@ export declare const zodPreDefinedQuerySchema: z.ZodObject<{
|
|
|
530
532
|
bucket_name?: string | undefined;
|
|
531
533
|
processing_status?: "pending" | "processing" | "completed" | "failed" | undefined;
|
|
532
534
|
}[] | undefined;
|
|
535
|
+
full_document_search?: boolean | undefined;
|
|
533
536
|
users?: {
|
|
534
537
|
_id?: string | undefined;
|
|
535
538
|
created_at?: number | undefined;
|
|
@@ -550,26 +553,57 @@ export declare const zodQuerySchema: z.ZodObject<{
|
|
|
550
553
|
thread_id: z.ZodOptional<z.ZodString>;
|
|
551
554
|
context_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
552
555
|
organization_id: z.ZodString;
|
|
553
|
-
|
|
556
|
+
user: z.ZodObject<{
|
|
557
|
+
user_id: z.ZodString;
|
|
558
|
+
first_name: z.ZodOptional<z.ZodString>;
|
|
559
|
+
last_name: z.ZodOptional<z.ZodString>;
|
|
560
|
+
email: z.ZodOptional<z.ZodString>;
|
|
561
|
+
}, "strip", z.ZodTypeAny, {
|
|
562
|
+
user_id: string;
|
|
563
|
+
email?: string | undefined;
|
|
564
|
+
first_name?: string | undefined;
|
|
565
|
+
last_name?: string | undefined;
|
|
566
|
+
}, {
|
|
567
|
+
user_id: string;
|
|
568
|
+
email?: string | undefined;
|
|
569
|
+
first_name?: string | undefined;
|
|
570
|
+
last_name?: string | undefined;
|
|
571
|
+
}>;
|
|
554
572
|
query: z.ZodString;
|
|
555
573
|
pre_defined_query_id: z.ZodOptional<z.ZodString>;
|
|
574
|
+
custom_instructions: z.ZodOptional<z.ZodString>;
|
|
575
|
+
full_document_search: z.ZodOptional<z.ZodBoolean>;
|
|
556
576
|
timestamp: z.ZodNumber;
|
|
557
577
|
}, "strip", z.ZodTypeAny, {
|
|
558
578
|
organization_id: string;
|
|
559
579
|
query: string;
|
|
560
|
-
|
|
580
|
+
user: {
|
|
581
|
+
user_id: string;
|
|
582
|
+
email?: string | undefined;
|
|
583
|
+
first_name?: string | undefined;
|
|
584
|
+
last_name?: string | undefined;
|
|
585
|
+
};
|
|
561
586
|
timestamp: number;
|
|
587
|
+
full_document_search?: boolean | undefined;
|
|
562
588
|
thread_id?: string | undefined;
|
|
563
589
|
context_ids?: string[] | undefined;
|
|
564
590
|
pre_defined_query_id?: string | undefined;
|
|
591
|
+
custom_instructions?: string | undefined;
|
|
565
592
|
}, {
|
|
566
593
|
organization_id: string;
|
|
567
594
|
query: string;
|
|
568
|
-
|
|
595
|
+
user: {
|
|
596
|
+
user_id: string;
|
|
597
|
+
email?: string | undefined;
|
|
598
|
+
first_name?: string | undefined;
|
|
599
|
+
last_name?: string | undefined;
|
|
600
|
+
};
|
|
569
601
|
timestamp: number;
|
|
602
|
+
full_document_search?: boolean | undefined;
|
|
570
603
|
thread_id?: string | undefined;
|
|
571
604
|
context_ids?: string[] | undefined;
|
|
572
605
|
pre_defined_query_id?: string | undefined;
|
|
606
|
+
custom_instructions?: string | undefined;
|
|
573
607
|
}>;
|
|
574
608
|
export declare const zodThreadSchema: z.ZodObject<{
|
|
575
609
|
_id: z.ZodOptional<z.ZodString>;
|
package/dist/types.js
CHANGED
|
@@ -127,6 +127,7 @@ exports.zodPreDefinedQuerySchema = zod_1.z.object({
|
|
|
127
127
|
query: zod_1.z.string().min(1),
|
|
128
128
|
instructions: zod_1.z.string().optional(),
|
|
129
129
|
contexts: zod_1.z.array(exports.zodContextSchema.partial()).optional(),
|
|
130
|
+
full_document_search: zod_1.z.boolean().optional(),
|
|
130
131
|
status: zod_1.z.enum(['active', 'inactive', 'archived']).default('active'),
|
|
131
132
|
users: zod_1.z.array(exports.zodUserSchema.partial()).optional(),
|
|
132
133
|
click_count: zod_1.z.number().optional(),
|
|
@@ -138,9 +139,16 @@ exports.zodQuerySchema = zod_1.z.object({
|
|
|
138
139
|
thread_id: zod_1.z.string().optional(),
|
|
139
140
|
context_ids: zod_1.z.array(zod_1.z.string()).optional(),
|
|
140
141
|
organization_id: zod_1.z.string(),
|
|
141
|
-
|
|
142
|
+
user: zod_1.z.object({
|
|
143
|
+
user_id: zod_1.z.string(),
|
|
144
|
+
first_name: zod_1.z.string().optional(),
|
|
145
|
+
last_name: zod_1.z.string().optional(),
|
|
146
|
+
email: zod_1.z.string().email().optional(),
|
|
147
|
+
}),
|
|
142
148
|
query: zod_1.z.string().min(1),
|
|
143
149
|
pre_defined_query_id: zod_1.z.string().optional(),
|
|
150
|
+
custom_instructions: zod_1.z.string().optional(),
|
|
151
|
+
full_document_search: zod_1.z.boolean().optional(),
|
|
144
152
|
timestamp: zod_1.z.number(),
|
|
145
153
|
});
|
|
146
154
|
exports.zodThreadSchema = zod_1.z.object({
|
package/index.ts
CHANGED
|
@@ -164,8 +164,9 @@ export const PreDefinedQuerySchema = new Schema(
|
|
|
164
164
|
default: 'active',
|
|
165
165
|
required: true,
|
|
166
166
|
},
|
|
167
|
+
full_document_search: { type: Boolean, default: false },
|
|
167
168
|
users: { type: [Object] },
|
|
168
|
-
click_count: { type: Number },
|
|
169
|
+
click_count: { type: Number, default: 0 },
|
|
169
170
|
created_at: { type: Number },
|
|
170
171
|
updated_at: { type: Number },
|
|
171
172
|
},
|
package/package.json
CHANGED
package/types.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
1
|
+
import { custom, z } from 'zod';
|
|
2
2
|
|
|
3
3
|
export const modelsList = [
|
|
4
4
|
'gemini-2.5-flash-lite',
|
|
@@ -88,7 +88,6 @@ export const zodAgentSchema = z.object({
|
|
|
88
88
|
updated_at: z.number().optional(),
|
|
89
89
|
});
|
|
90
90
|
|
|
91
|
-
|
|
92
91
|
export const zodChunkSchema = z.object({
|
|
93
92
|
_id: z.string().optional(),
|
|
94
93
|
chunk_id: z.string().optional(),
|
|
@@ -134,6 +133,7 @@ export const zodPreDefinedQuerySchema = z.object({
|
|
|
134
133
|
query: z.string().min(1),
|
|
135
134
|
instructions: z.string().optional(),
|
|
136
135
|
contexts: z.array(zodContextSchema.partial()).optional(),
|
|
136
|
+
full_document_search: z.boolean().optional(),
|
|
137
137
|
status: z.enum(['active', 'inactive', 'archived']).default('active'),
|
|
138
138
|
users: z.array(zodUserSchema.partial()).optional(),
|
|
139
139
|
click_count: z.number().optional(),
|
|
@@ -146,11 +146,18 @@ export const zodQuerySchema = z.object({
|
|
|
146
146
|
thread_id: z.string().optional(), // If there is not thread id provided, a new thread will be created
|
|
147
147
|
context_ids: z.array(z.string()).optional(), // Run on all organization files unless specific file ids are provided
|
|
148
148
|
organization_id: z.string(), // Will be used to fetch the agent, contexts, chunks, etc.
|
|
149
|
-
|
|
149
|
+
user: z.object({
|
|
150
|
+
user_id: z.string(),
|
|
151
|
+
first_name: z.string().optional(),
|
|
152
|
+
last_name: z.string().optional(),
|
|
153
|
+
email: z.string().email().optional(),
|
|
154
|
+
}),
|
|
150
155
|
query: z.string().min(1),
|
|
151
156
|
pre_defined_query_id: z.string().optional(),
|
|
157
|
+
custom_instructions: z.string().optional(),
|
|
158
|
+
full_document_search: z.boolean().optional(),
|
|
152
159
|
timestamp: z.number(),
|
|
153
|
-
})
|
|
160
|
+
});
|
|
154
161
|
|
|
155
162
|
export const zodThreadSchema = z.object({
|
|
156
163
|
_id: z.string().optional(),
|
|
@@ -192,7 +199,7 @@ export type QueueMessageBodyType<T> = {
|
|
|
192
199
|
organization_id: string;
|
|
193
200
|
data: T;
|
|
194
201
|
timestamp: number;
|
|
195
|
-
}
|
|
202
|
+
};
|
|
196
203
|
|
|
197
204
|
export type OrganizationType = z.infer<typeof zodOrganizationSchema>;
|
|
198
205
|
export type UserType = z.infer<typeof zodUserSchema>;
|
|
@@ -217,4 +224,4 @@ export enum FileType {
|
|
|
217
224
|
|
|
218
225
|
export enum QueuesList {
|
|
219
226
|
CONTEXT_PROCESS = 'context_process_queue',
|
|
220
|
-
}
|
|
227
|
+
}
|