chatifai 1.0.32 → 1.0.34

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
@@ -1329,6 +1329,7 @@ export declare const MessageSchema: Schema<any, import("mongoose").Model<any, an
1329
1329
  user_id?: string | null | undefined;
1330
1330
  created_at?: number | null | undefined;
1331
1331
  updated_at?: number | null | undefined;
1332
+ metadata?: any;
1332
1333
  agent_id?: string | null | undefined;
1333
1334
  }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
1334
1335
  createdAt: NativeDate;
@@ -1343,6 +1344,7 @@ export declare const MessageSchema: Schema<any, import("mongoose").Model<any, an
1343
1344
  user_id?: string | null | undefined;
1344
1345
  created_at?: number | null | undefined;
1345
1346
  updated_at?: number | null | undefined;
1347
+ metadata?: any;
1346
1348
  agent_id?: string | null | undefined;
1347
1349
  }>, {}> & import("mongoose").FlatRecord<{
1348
1350
  createdAt: NativeDate;
@@ -1357,6 +1359,7 @@ export declare const MessageSchema: Schema<any, import("mongoose").Model<any, an
1357
1359
  user_id?: string | null | undefined;
1358
1360
  created_at?: number | null | undefined;
1359
1361
  updated_at?: number | null | undefined;
1362
+ metadata?: any;
1360
1363
  agent_id?: string | null | undefined;
1361
1364
  }> & {
1362
1365
  _id: import("mongoose").Types.ObjectId;
package/dist/index.js CHANGED
@@ -219,6 +219,7 @@ exports.MessageSchema = new mongoose_1.Schema({
219
219
  role: { type: String, enum: ['user', 'agent', 'system'], required: true },
220
220
  created_at: { type: Number },
221
221
  updated_at: { type: Number },
222
+ metadata: { type: Object },
222
223
  }, {
223
224
  versionKey: false,
224
225
  toJSON: { virtuals: true },
package/dist/types.d.ts CHANGED
@@ -527,7 +527,84 @@ export declare const zodPreDefinedQuerySchema: z.ZodObject<{
527
527
  }>;
528
528
  export declare const zodQuerySchema: z.ZodObject<{
529
529
  thread_id: z.ZodOptional<z.ZodString>;
530
- context_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
530
+ contexts: z.ZodOptional<z.ZodArray<z.ZodObject<{
531
+ _id: z.ZodOptional<z.ZodOptional<z.ZodString>>;
532
+ organization_id: z.ZodOptional<z.ZodOptional<z.ZodString>>;
533
+ title: z.ZodOptional<z.ZodString>;
534
+ ai_description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
535
+ note: z.ZodOptional<z.ZodOptional<z.ZodString>>;
536
+ file_id: z.ZodOptional<z.ZodOptional<z.ZodString>>;
537
+ file_url: z.ZodOptional<z.ZodOptional<z.ZodString>>;
538
+ file_gcs_url: z.ZodOptional<z.ZodOptional<z.ZodString>>;
539
+ file_name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
540
+ type: z.ZodOptional<z.ZodOptional<z.ZodString>>;
541
+ size: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
542
+ tokens: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
543
+ is_active: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodBoolean>>>;
544
+ created_at: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
545
+ updated_at: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
546
+ uploaded_by: z.ZodOptional<z.ZodOptional<z.ZodObject<{
547
+ first_name: z.ZodOptional<z.ZodString>;
548
+ last_name: z.ZodOptional<z.ZodString>;
549
+ email: z.ZodOptional<z.ZodString>;
550
+ }, "strip", z.ZodTypeAny, {
551
+ first_name?: string | undefined;
552
+ last_name?: string | undefined;
553
+ email?: string | undefined;
554
+ }, {
555
+ first_name?: string | undefined;
556
+ last_name?: string | undefined;
557
+ email?: string | undefined;
558
+ }>>>;
559
+ bucket_name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
560
+ processing_status: z.ZodOptional<z.ZodOptional<z.ZodEnum<["pending", "processing", "completed", "failed"]>>>;
561
+ }, "strip", z.ZodTypeAny, {
562
+ type?: string | undefined;
563
+ _id?: string | undefined;
564
+ title?: string | undefined;
565
+ created_at?: number | undefined;
566
+ updated_at?: number | undefined;
567
+ organization_id?: string | undefined;
568
+ ai_description?: string | undefined;
569
+ note?: string | undefined;
570
+ file_id?: string | undefined;
571
+ file_url?: string | undefined;
572
+ file_gcs_url?: string | undefined;
573
+ file_name?: string | undefined;
574
+ size?: number | undefined;
575
+ tokens?: number | undefined;
576
+ is_active?: boolean | undefined;
577
+ uploaded_by?: {
578
+ first_name?: string | undefined;
579
+ last_name?: string | undefined;
580
+ email?: string | undefined;
581
+ } | undefined;
582
+ bucket_name?: string | undefined;
583
+ processing_status?: "pending" | "processing" | "completed" | "failed" | undefined;
584
+ }, {
585
+ type?: string | undefined;
586
+ _id?: string | undefined;
587
+ title?: string | undefined;
588
+ created_at?: number | undefined;
589
+ updated_at?: number | undefined;
590
+ organization_id?: string | undefined;
591
+ ai_description?: string | undefined;
592
+ note?: string | undefined;
593
+ file_id?: string | undefined;
594
+ file_url?: string | undefined;
595
+ file_gcs_url?: string | undefined;
596
+ file_name?: string | undefined;
597
+ size?: number | undefined;
598
+ tokens?: number | undefined;
599
+ is_active?: boolean | undefined;
600
+ uploaded_by?: {
601
+ first_name?: string | undefined;
602
+ last_name?: string | undefined;
603
+ email?: string | undefined;
604
+ } | undefined;
605
+ bucket_name?: string | undefined;
606
+ processing_status?: "pending" | "processing" | "completed" | "failed" | undefined;
607
+ }>, "many">>;
531
608
  organization_id: z.ZodString;
532
609
  user: z.ZodObject<{
533
610
  user_id: z.ZodString;
@@ -560,9 +637,32 @@ export declare const zodQuerySchema: z.ZodObject<{
560
637
  email?: string | undefined;
561
638
  };
562
639
  timestamp: number;
640
+ contexts?: {
641
+ type?: string | undefined;
642
+ _id?: string | undefined;
643
+ title?: string | undefined;
644
+ created_at?: number | undefined;
645
+ updated_at?: number | undefined;
646
+ organization_id?: string | undefined;
647
+ ai_description?: string | undefined;
648
+ note?: string | undefined;
649
+ file_id?: string | undefined;
650
+ file_url?: string | undefined;
651
+ file_gcs_url?: string | undefined;
652
+ file_name?: string | undefined;
653
+ size?: number | undefined;
654
+ tokens?: number | undefined;
655
+ is_active?: boolean | undefined;
656
+ uploaded_by?: {
657
+ first_name?: string | undefined;
658
+ last_name?: string | undefined;
659
+ email?: string | undefined;
660
+ } | undefined;
661
+ bucket_name?: string | undefined;
662
+ processing_status?: "pending" | "processing" | "completed" | "failed" | undefined;
663
+ }[] | undefined;
563
664
  full_document_search?: boolean | undefined;
564
665
  thread_id?: string | undefined;
565
- context_ids?: string[] | undefined;
566
666
  pre_defined_query_id?: string | undefined;
567
667
  custom_instructions?: string | undefined;
568
668
  }, {
@@ -575,9 +675,32 @@ export declare const zodQuerySchema: z.ZodObject<{
575
675
  email?: string | undefined;
576
676
  };
577
677
  timestamp: number;
678
+ contexts?: {
679
+ type?: string | undefined;
680
+ _id?: string | undefined;
681
+ title?: string | undefined;
682
+ created_at?: number | undefined;
683
+ updated_at?: number | undefined;
684
+ organization_id?: string | undefined;
685
+ ai_description?: string | undefined;
686
+ note?: string | undefined;
687
+ file_id?: string | undefined;
688
+ file_url?: string | undefined;
689
+ file_gcs_url?: string | undefined;
690
+ file_name?: string | undefined;
691
+ size?: number | undefined;
692
+ tokens?: number | undefined;
693
+ is_active?: boolean | undefined;
694
+ uploaded_by?: {
695
+ first_name?: string | undefined;
696
+ last_name?: string | undefined;
697
+ email?: string | undefined;
698
+ } | undefined;
699
+ bucket_name?: string | undefined;
700
+ processing_status?: "pending" | "processing" | "completed" | "failed" | undefined;
701
+ }[] | undefined;
578
702
  full_document_search?: boolean | undefined;
579
703
  thread_id?: string | undefined;
580
- context_ids?: string[] | undefined;
581
704
  pre_defined_query_id?: string | undefined;
582
705
  custom_instructions?: string | undefined;
583
706
  }>;
@@ -649,6 +772,7 @@ export declare const zodMessageSchema: z.ZodObject<{
649
772
  like: z.ZodOptional<z.ZodEnum<["liked", "disliked", "waiting_response"]>>;
650
773
  created_at: z.ZodOptional<z.ZodNumber>;
651
774
  updated_at: z.ZodOptional<z.ZodNumber>;
775
+ metadata: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
652
776
  }, "strip", z.ZodTypeAny, {
653
777
  organization_id: string;
654
778
  thread_id: string;
@@ -658,6 +782,7 @@ export declare const zodMessageSchema: z.ZodObject<{
658
782
  _id?: string | undefined;
659
783
  created_at?: number | undefined;
660
784
  updated_at?: number | undefined;
785
+ metadata?: {} | undefined;
661
786
  agent_id?: string | undefined;
662
787
  is_favorite?: boolean | undefined;
663
788
  like?: "liked" | "disliked" | "waiting_response" | undefined;
@@ -670,6 +795,7 @@ export declare const zodMessageSchema: z.ZodObject<{
670
795
  _id?: string | undefined;
671
796
  created_at?: number | undefined;
672
797
  updated_at?: number | undefined;
798
+ metadata?: {} | undefined;
673
799
  agent_id?: string | undefined;
674
800
  is_favorite?: boolean | undefined;
675
801
  like?: "liked" | "disliked" | "waiting_response" | undefined;
package/dist/types.js CHANGED
@@ -143,7 +143,7 @@ exports.zodPreDefinedQuerySchema = zod_1.z.object({
143
143
  // Zod schema for handling user queries
144
144
  exports.zodQuerySchema = zod_1.z.object({
145
145
  thread_id: zod_1.z.string().optional(),
146
- context_ids: zod_1.z.array(zod_1.z.string()).optional(),
146
+ contexts: zod_1.z.array(exports.zodContextSchema.partial()).optional(),
147
147
  organization_id: zod_1.z.string(),
148
148
  user: exports.zodClerkMinimalUserSchema,
149
149
  query: zod_1.z.string().min(1),
@@ -175,6 +175,7 @@ exports.zodMessageSchema = zod_1.z.object({
175
175
  like: zod_1.z.enum(['liked', 'disliked', 'waiting_response']).optional(),
176
176
  created_at: zod_1.z.number().optional(),
177
177
  updated_at: zod_1.z.number().optional(),
178
+ metadata: zod_1.z.object({}).optional(),
178
179
  });
179
180
  var FileType;
180
181
  (function (FileType) {
package/index.ts CHANGED
@@ -237,6 +237,7 @@ export const MessageSchema = new Schema(
237
237
  role: { type: String, enum: ['user', 'agent', 'system'], required: true },
238
238
  created_at: { type: Number },
239
239
  updated_at: { type: Number },
240
+ metadata: { type: Object },
240
241
  },
241
242
  {
242
243
  versionKey: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chatifai",
3
- "version": "1.0.32",
3
+ "version": "1.0.34",
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
@@ -150,11 +150,11 @@ export const zodPreDefinedQuerySchema = z.object({
150
150
 
151
151
  // Zod schema for handling user queries
152
152
  export const zodQuerySchema = z.object({
153
- thread_id: z.string().optional(), // If there is not thread id provided, a new thread will be created
154
- context_ids: z.array(z.string()).optional(), // Run on all organization files unless specific file ids are provided
153
+ thread_id: z.string().optional(), // Two types of queries: Regular Thread and Predefined Query Thread
154
+ contexts: z.array(zodContextSchema.partial()).optional(), // Run on all organization files unless specific file ids are provided
155
155
  organization_id: z.string(), // Will be used to fetch the agent, contexts, chunks, etc.
156
156
  user: zodClerkMinimalUserSchema,
157
- query: z.string().min(1),
157
+ query: z.string().min(1), // Comes from free text input or predefined query
158
158
  pre_defined_query_id: z.string().optional(),
159
159
  custom_instructions: z.string().optional(),
160
160
  full_document_search: z.boolean().optional(),
@@ -185,6 +185,7 @@ export const zodMessageSchema = z.object({
185
185
  like: z.enum(['liked', 'disliked', 'waiting_response']).optional(), // 1 for like, -1 for dislike
186
186
  created_at: z.number().optional(),
187
187
  updated_at: z.number().optional(),
188
+ metadata: z.object({}).optional(),
188
189
  });
189
190
 
190
191
  export type EventAttributeType = {