chatifai 1.0.52 → 1.0.54

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
@@ -160,7 +160,7 @@ export declare const AgentSchema: Schema<any, import("mongoose").Model<any, any,
160
160
  updatedAt: NativeDate;
161
161
  } & {
162
162
  title: string;
163
- model: "gemini-2.5-flash-lite" | "gemini-2.5-flash" | "gemini-2.5-pro" | "grok-4-fast-non-reasoning" | "grok-4-fast-reasoning" | "gpt-4.1" | "gpt-4.1-mini" | "gpt-4.1-nano" | "claude-3.7-sonnet" | "gemini-3-flash-preview";
163
+ model: string;
164
164
  max_tokens: number;
165
165
  is_editable: boolean;
166
166
  is_hard_to_copy: boolean;
@@ -182,7 +182,7 @@ export declare const AgentSchema: Schema<any, import("mongoose").Model<any, any,
182
182
  updatedAt: NativeDate;
183
183
  } & {
184
184
  title: string;
185
- model: "gemini-2.5-flash-lite" | "gemini-2.5-flash" | "gemini-2.5-pro" | "grok-4-fast-non-reasoning" | "grok-4-fast-reasoning" | "gpt-4.1" | "gpt-4.1-mini" | "gpt-4.1-nano" | "claude-3.7-sonnet" | "gemini-3-flash-preview";
185
+ model: string;
186
186
  max_tokens: number;
187
187
  is_editable: boolean;
188
188
  is_hard_to_copy: boolean;
@@ -204,7 +204,7 @@ export declare const AgentSchema: Schema<any, import("mongoose").Model<any, any,
204
204
  updatedAt: NativeDate;
205
205
  } & {
206
206
  title: string;
207
- model: "gemini-2.5-flash-lite" | "gemini-2.5-flash" | "gemini-2.5-pro" | "grok-4-fast-non-reasoning" | "grok-4-fast-reasoning" | "gpt-4.1" | "gpt-4.1-mini" | "gpt-4.1-nano" | "claude-3.7-sonnet" | "gemini-3-flash-preview";
207
+ model: string;
208
208
  max_tokens: number;
209
209
  is_editable: boolean;
210
210
  is_hard_to_copy: boolean;
package/dist/index.js CHANGED
@@ -27,7 +27,7 @@ exports.OrganizationSchema = new mongoose_1.Schema({
27
27
  plan: { type: String, minlength: 1, maxlength: 100 },
28
28
  active_user_limit: { type: Number, min: 1 },
29
29
  documents_size_limit: { type: Number, min: 1 },
30
- allowed_models: { type: [String], enum: types_1.modelsList },
30
+ allowed_models: { type: [String] },
31
31
  queries_limit: { type: Number, min: 1 },
32
32
  created_at: { type: Number },
33
33
  updated_at: { type: Number },
@@ -64,7 +64,7 @@ exports.AgentSchema = new mongoose_1.Schema({
64
64
  title: { type: String, required: true, minlength: 1, maxlength: 100 },
65
65
  description: { type: String },
66
66
  instructions: { type: String, minlength: 1, maxlength: 1500 },
67
- model: { type: String, enum: types_1.modelsList, required: true },
67
+ model: { type: String, required: true },
68
68
  temperature: { type: Number, min: 0, max: 1 },
69
69
  max_tokens: { type: Number, min: 1, default: 3000 },
70
70
  elevenlabs_voice_id: { type: String },
package/dist/types.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { z } from 'zod';
2
- export declare const modelsList: readonly ["gemini-2.5-flash-lite", "gemini-2.5-flash", "gemini-2.5-pro", "grok-4-fast-non-reasoning", "grok-4-fast-reasoning", "gpt-4.1", "gpt-4.1-mini", "gpt-4.1-nano", "claude-3.7-sonnet", "gemini-3-flash-preview"];
3
2
  export declare const userRoles: readonly ["admin", "member", "client"];
4
3
  export declare const zodClerkMinimalUserSchema: z.ZodObject<{
5
4
  user_id: z.ZodString;
@@ -26,7 +25,7 @@ export declare const zodOrganizationSchema: z.ZodObject<{
26
25
  plan: z.ZodOptional<z.ZodString>;
27
26
  active_user_limit: z.ZodOptional<z.ZodNumber>;
28
27
  documents_size_limit: z.ZodOptional<z.ZodNumber>;
29
- allowed_models: z.ZodOptional<z.ZodArray<z.ZodEnum<["gemini-2.5-flash-lite", "gemini-2.5-flash", "gemini-2.5-pro", "grok-4-fast-non-reasoning", "grok-4-fast-reasoning", "gpt-4.1", "gpt-4.1-mini", "gpt-4.1-nano", "claude-3.7-sonnet", "gemini-3-flash-preview"]>, "many">>;
28
+ allowed_models: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
30
29
  queries_limit: z.ZodOptional<z.ZodNumber>;
31
30
  created_at: z.ZodOptional<z.ZodNumber>;
32
31
  updated_at: z.ZodOptional<z.ZodNumber>;
@@ -39,7 +38,7 @@ export declare const zodOrganizationSchema: z.ZodObject<{
39
38
  plan?: string | undefined;
40
39
  active_user_limit?: number | undefined;
41
40
  documents_size_limit?: number | undefined;
42
- allowed_models?: ("gemini-2.5-flash-lite" | "gemini-2.5-flash" | "gemini-2.5-pro" | "grok-4-fast-non-reasoning" | "grok-4-fast-reasoning" | "gpt-4.1" | "gpt-4.1-mini" | "gpt-4.1-nano" | "claude-3.7-sonnet" | "gemini-3-flash-preview")[] | undefined;
41
+ allowed_models?: string[] | undefined;
43
42
  queries_limit?: number | undefined;
44
43
  created_at?: number | undefined;
45
44
  updated_at?: number | undefined;
@@ -52,7 +51,7 @@ export declare const zodOrganizationSchema: z.ZodObject<{
52
51
  plan?: string | undefined;
53
52
  active_user_limit?: number | undefined;
54
53
  documents_size_limit?: number | undefined;
55
- allowed_models?: ("gemini-2.5-flash-lite" | "gemini-2.5-flash" | "gemini-2.5-pro" | "grok-4-fast-non-reasoning" | "grok-4-fast-reasoning" | "gpt-4.1" | "gpt-4.1-mini" | "gpt-4.1-nano" | "claude-3.7-sonnet" | "gemini-3-flash-preview")[] | undefined;
54
+ allowed_models?: string[] | undefined;
56
55
  queries_limit?: number | undefined;
57
56
  created_at?: number | undefined;
58
57
  updated_at?: number | undefined;
@@ -202,7 +201,7 @@ export declare const zodAgentSchema: z.ZodObject<{
202
201
  title: z.ZodString;
203
202
  description: z.ZodOptional<z.ZodString>;
204
203
  instructions: z.ZodString;
205
- model: z.ZodEnum<["gemini-2.5-flash-lite", "gemini-2.5-flash", "gemini-2.5-pro", "grok-4-fast-non-reasoning", "grok-4-fast-reasoning", "gpt-4.1", "gpt-4.1-mini", "gpt-4.1-nano", "claude-3.7-sonnet", "gemini-3-flash-preview"]>;
204
+ model: z.ZodOptional<z.ZodString>;
206
205
  temperature: z.ZodOptional<z.ZodNumber>;
207
206
  max_tokens: z.ZodOptional<z.ZodNumber>;
208
207
  elevenlabs_voice_id: z.ZodOptional<z.ZodString>;
@@ -219,13 +218,13 @@ export declare const zodAgentSchema: z.ZodObject<{
219
218
  }, "strip", z.ZodTypeAny, {
220
219
  title: string;
221
220
  instructions: string;
222
- model: "gemini-2.5-flash-lite" | "gemini-2.5-flash" | "gemini-2.5-pro" | "grok-4-fast-non-reasoning" | "grok-4-fast-reasoning" | "gpt-4.1" | "gpt-4.1-mini" | "gpt-4.1-nano" | "claude-3.7-sonnet" | "gemini-3-flash-preview";
223
221
  _id?: string | undefined;
224
222
  created_at?: number | undefined;
225
223
  updated_at?: number | undefined;
226
224
  organization_id?: string | undefined;
227
225
  file_search_store_name?: string | undefined;
228
226
  description?: string | undefined;
227
+ model?: string | undefined;
229
228
  temperature?: number | undefined;
230
229
  max_tokens?: number | undefined;
231
230
  elevenlabs_voice_id?: string | undefined;
@@ -239,13 +238,13 @@ export declare const zodAgentSchema: z.ZodObject<{
239
238
  }, {
240
239
  title: string;
241
240
  instructions: string;
242
- model: "gemini-2.5-flash-lite" | "gemini-2.5-flash" | "gemini-2.5-pro" | "grok-4-fast-non-reasoning" | "grok-4-fast-reasoning" | "gpt-4.1" | "gpt-4.1-mini" | "gpt-4.1-nano" | "claude-3.7-sonnet" | "gemini-3-flash-preview";
243
241
  _id?: string | undefined;
244
242
  created_at?: number | undefined;
245
243
  updated_at?: number | undefined;
246
244
  organization_id?: string | undefined;
247
245
  file_search_store_name?: string | undefined;
248
246
  description?: string | undefined;
247
+ model?: string | undefined;
249
248
  temperature?: number | undefined;
250
249
  max_tokens?: number | undefined;
251
250
  elevenlabs_voice_id?: string | undefined;
@@ -967,7 +966,6 @@ export type AgentType = z.infer<typeof zodAgentSchema>;
967
966
  export type ContextType = z.infer<typeof zodContextSchema>;
968
967
  export type ChunkType = z.infer<typeof zodChunkSchema>;
969
968
  export type PreDefinedQueryType = z.infer<typeof zodPreDefinedQuerySchema>;
970
- export type ModelType = (typeof modelsList)[number];
971
969
  export type UserRoleType = (typeof userRoles)[number];
972
970
  export type FullFileTextType = z.infer<typeof zodFullTextSchema>;
973
971
  export type QueryType = z.infer<typeof zodQuerySchema>;
@@ -983,3 +981,15 @@ export declare enum FileType {
983
981
  export declare enum QueuesList {
984
982
  CONTEXT_PROCESS = "context_process_queue"
985
983
  }
984
+ export interface ModelInfo {
985
+ id: string;
986
+ name: string;
987
+ contextLength: number;
988
+ pricing: {
989
+ prompt: number;
990
+ completion: number;
991
+ web_search?: number;
992
+ cacheRead?: number;
993
+ cacheWrite?: number;
994
+ };
995
+ }
package/dist/types.js CHANGED
@@ -1,19 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.QueuesList = exports.FileType = exports.zodFreeTextSchema = exports.zodMessageSchema = exports.zodThreadSchema = exports.zodQuerySchema = exports.zodPreDefinedQuerySchema = exports.zodFullTextSchema = exports.zodChunkSchema = exports.zodAgentSchema = exports.zodContextSchema = exports.zodUserSchema = exports.zodOrganizationSchema = exports.zodClerkMinimalUserSchema = exports.userRoles = exports.modelsList = void 0;
3
+ exports.QueuesList = exports.FileType = exports.zodFreeTextSchema = exports.zodMessageSchema = exports.zodThreadSchema = exports.zodQuerySchema = exports.zodPreDefinedQuerySchema = exports.zodFullTextSchema = exports.zodChunkSchema = exports.zodAgentSchema = exports.zodContextSchema = exports.zodUserSchema = exports.zodOrganizationSchema = exports.zodClerkMinimalUserSchema = exports.userRoles = void 0;
4
4
  const zod_1 = require("zod");
5
- exports.modelsList = [
6
- 'gemini-2.5-flash-lite',
7
- 'gemini-2.5-flash',
8
- 'gemini-2.5-pro',
9
- 'grok-4-fast-non-reasoning',
10
- 'grok-4-fast-reasoning',
11
- 'gpt-4.1',
12
- 'gpt-4.1-mini',
13
- 'gpt-4.1-nano',
14
- 'claude-3.7-sonnet',
15
- 'gemini-3-flash-preview',
16
- ];
17
5
  exports.userRoles = ['admin', 'member', 'client'];
18
6
  exports.zodClerkMinimalUserSchema = zod_1.z.object({
19
7
  user_id: zod_1.z.string(),
@@ -30,7 +18,7 @@ exports.zodOrganizationSchema = zod_1.z.object({
30
18
  plan: zod_1.z.string().min(1).max(100).optional(),
31
19
  active_user_limit: zod_1.z.number().min(1).optional(),
32
20
  documents_size_limit: zod_1.z.number().min(1).optional(),
33
- allowed_models: zod_1.z.array(zod_1.z.enum(exports.modelsList)).optional(),
21
+ allowed_models: zod_1.z.array(zod_1.z.string()).optional(),
34
22
  queries_limit: zod_1.z.number().min(1).optional(),
35
23
  created_at: zod_1.z.number().optional(),
36
24
  updated_at: zod_1.z.number().optional(),
@@ -90,7 +78,7 @@ exports.zodAgentSchema = zod_1.z.object({
90
78
  title: zod_1.z.string().min(1).max(100),
91
79
  description: zod_1.z.string().optional(),
92
80
  instructions: zod_1.z.string().min(1).max(1500),
93
- model: zod_1.z.enum(exports.modelsList),
81
+ model: zod_1.z.string().optional(),
94
82
  temperature: zod_1.z.number().min(0).max(1).optional(),
95
83
  max_tokens: zod_1.z.number().min(1).optional(),
96
84
  elevenlabs_voice_id: zod_1.z.string().optional(),
package/index.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  export * from './types';
3
3
 
4
4
  import { Schema } from 'mongoose';
5
- import { modelsList, userRoles } from './types';
5
+ import { userRoles } from './types';
6
6
 
7
7
  export const OrganizationSchema = new Schema(
8
8
  {
@@ -13,7 +13,7 @@ export const OrganizationSchema = new Schema(
13
13
  plan: { type: String, minlength: 1, maxlength: 100 },
14
14
  active_user_limit: { type: Number, min: 1 },
15
15
  documents_size_limit: { type: Number, min: 1 },
16
- allowed_models: { type: [String], enum: modelsList },
16
+ allowed_models: { type: [String] },
17
17
  queries_limit: { type: Number, min: 1 },
18
18
  created_at: { type: Number },
19
19
  updated_at: { type: Number },
@@ -58,7 +58,7 @@ export const AgentSchema = new Schema(
58
58
  title: { type: String, required: true, minlength: 1, maxlength: 100 },
59
59
  description: { type: String },
60
60
  instructions: { type: String, minlength: 1, maxlength: 1500 },
61
- model: { type: String, enum: modelsList, required: true },
61
+ model: { type: String, required: true },
62
62
  temperature: { type: Number, min: 0, max: 1 },
63
63
  max_tokens: { type: Number, min: 1, default: 3000 },
64
64
  elevenlabs_voice_id: { type: String },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chatifai",
3
- "version": "1.0.52",
3
+ "version": "1.0.54",
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
@@ -1,19 +1,5 @@
1
1
  import { custom, z } from 'zod';
2
2
 
3
- export const modelsList = [
4
- 'gemini-2.5-flash-lite',
5
- 'gemini-2.5-flash',
6
- 'gemini-2.5-pro',
7
- 'grok-4-fast-non-reasoning',
8
- 'grok-4-fast-reasoning',
9
- 'gpt-4.1',
10
- 'gpt-4.1-mini',
11
- 'gpt-4.1-nano',
12
- 'claude-3.7-sonnet',
13
- 'gemini-3-flash-preview',
14
-
15
- ] as const;
16
-
17
3
  export const userRoles = ['admin', 'member', 'client'] as const;
18
4
 
19
5
  export const zodClerkMinimalUserSchema = z.object({
@@ -32,7 +18,7 @@ export const zodOrganizationSchema = z.object({
32
18
  plan: z.string().min(1).max(100).optional(),
33
19
  active_user_limit: z.number().min(1).optional(),
34
20
  documents_size_limit: z.number().min(1).optional(),
35
- allowed_models: z.array(z.enum(modelsList)).optional(),
21
+ allowed_models: z.array(z.string()).optional(),
36
22
  queries_limit: z.number().min(1).optional(),
37
23
  created_at: z.number().optional(),
38
24
  updated_at: z.number().optional(),
@@ -95,7 +81,7 @@ export const zodAgentSchema = z.object({
95
81
  title: z.string().min(1).max(100),
96
82
  description: z.string().optional(),
97
83
  instructions: z.string().min(1).max(1500),
98
- model: z.enum(modelsList),
84
+ model: z.string().optional(),
99
85
  temperature: z.number().min(0).max(1).optional(),
100
86
  max_tokens: z.number().min(1).optional(),
101
87
  elevenlabs_voice_id: z.string().optional(),
@@ -226,7 +212,7 @@ export type EventAttributeType = {
226
212
 
227
213
  /**
228
214
  * Used for queue message bodies
229
- * Used in context processing queue
215
+ * Used in context processing queue
230
216
  */
231
217
  export type QueueMessageBodyType<T> = {
232
218
  organization_id: string;
@@ -240,7 +226,6 @@ export type AgentType = z.infer<typeof zodAgentSchema>;
240
226
  export type ContextType = z.infer<typeof zodContextSchema>;
241
227
  export type ChunkType = z.infer<typeof zodChunkSchema>;
242
228
  export type PreDefinedQueryType = z.infer<typeof zodPreDefinedQuerySchema>;
243
- export type ModelType = (typeof modelsList)[number];
244
229
  export type UserRoleType = (typeof userRoles)[number];
245
230
  export type FullFileTextType = z.infer<typeof zodFullTextSchema>;
246
231
  export type QueryType = z.infer<typeof zodQuerySchema>;
@@ -258,3 +243,16 @@ export enum FileType {
258
243
  export enum QueuesList {
259
244
  CONTEXT_PROCESS = 'context_process_queue',
260
245
  }
246
+
247
+ export interface ModelInfo {
248
+ id: string;
249
+ name: string;
250
+ contextLength: number;
251
+ pricing: {
252
+ prompt: number;
253
+ completion: number;
254
+ web_search?: number;
255
+ cacheRead?: number;
256
+ cacheWrite?: number;
257
+ };
258
+ }