@amaster.ai/dsh-storage 0.1.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.
Files changed (97) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +66 -0
  3. package/cordis.patch.yml +3 -0
  4. package/lib/backends/database.js +198 -0
  5. package/lib/generated/mysql/browser.js +17 -0
  6. package/lib/generated/mysql/client.js +34 -0
  7. package/lib/generated/mysql/commonInputTypes.js +10 -0
  8. package/lib/generated/mysql/enums.js +10 -0
  9. package/lib/generated/mysql/internal/class.js +49 -0
  10. package/lib/generated/mysql/internal/prismaNamespace.js +146 -0
  11. package/lib/generated/mysql/internal/prismaNamespaceBrowser.js +117 -0
  12. package/lib/generated/mysql/models/AiChatHistory.js +1 -0
  13. package/lib/generated/mysql/models/AiMessage.js +1 -0
  14. package/lib/generated/mysql/models.js +1 -0
  15. package/lib/generated/postgresql/browser.js +17 -0
  16. package/lib/generated/postgresql/client.js +34 -0
  17. package/lib/generated/postgresql/commonInputTypes.js +10 -0
  18. package/lib/generated/postgresql/enums.js +10 -0
  19. package/lib/generated/postgresql/internal/class.js +49 -0
  20. package/lib/generated/postgresql/internal/prismaNamespace.js +131 -0
  21. package/lib/generated/postgresql/internal/prismaNamespaceBrowser.js +102 -0
  22. package/lib/generated/postgresql/models/AiChatHistory.js +1 -0
  23. package/lib/generated/postgresql/models/AiMessage.js +1 -0
  24. package/lib/generated/postgresql/models.js +1 -0
  25. package/lib/generated/sqlite/browser.js +17 -0
  26. package/lib/generated/sqlite/client.js +34 -0
  27. package/lib/generated/sqlite/commonInputTypes.js +10 -0
  28. package/lib/generated/sqlite/enums.js +10 -0
  29. package/lib/generated/sqlite/internal/class.js +49 -0
  30. package/lib/generated/sqlite/internal/prismaNamespace.js +128 -0
  31. package/lib/generated/sqlite/internal/prismaNamespaceBrowser.js +99 -0
  32. package/lib/generated/sqlite/models/AiChatHistory.js +1 -0
  33. package/lib/generated/sqlite/models/AiMessage.js +1 -0
  34. package/lib/generated/sqlite/models.js +1 -0
  35. package/lib/generated/sqlserver/browser.js +17 -0
  36. package/lib/generated/sqlserver/client.js +34 -0
  37. package/lib/generated/sqlserver/commonInputTypes.js +10 -0
  38. package/lib/generated/sqlserver/enums.js +10 -0
  39. package/lib/generated/sqlserver/internal/class.js +49 -0
  40. package/lib/generated/sqlserver/internal/prismaNamespace.js +119 -0
  41. package/lib/generated/sqlserver/internal/prismaNamespaceBrowser.js +90 -0
  42. package/lib/generated/sqlserver/models/AiChatHistory.js +1 -0
  43. package/lib/generated/sqlserver/models/AiMessage.js +1 -0
  44. package/lib/generated/sqlserver/models.js +1 -0
  45. package/lib/index.js +224 -0
  46. package/lib/projector.js +153 -0
  47. package/lib/types/backends/database.d.ts +37 -0
  48. package/lib/types/generated/mysql/browser.d.ts +15 -0
  49. package/lib/types/generated/mysql/client.d.ts +34 -0
  50. package/lib/types/generated/mysql/commonInputTypes.d.ts +396 -0
  51. package/lib/types/generated/mysql/enums.d.ts +1 -0
  52. package/lib/types/generated/mysql/internal/class.d.ts +143 -0
  53. package/lib/types/generated/mysql/internal/prismaNamespace.d.ts +709 -0
  54. package/lib/types/generated/mysql/internal/prismaNamespaceBrowser.d.ts +112 -0
  55. package/lib/types/generated/mysql/models/AiChatHistory.d.ts +1258 -0
  56. package/lib/types/generated/mysql/models/AiMessage.d.ts +1360 -0
  57. package/lib/types/generated/mysql/models.d.ts +3 -0
  58. package/lib/types/generated/postgresql/browser.d.ts +15 -0
  59. package/lib/types/generated/postgresql/client.d.ts +34 -0
  60. package/lib/types/generated/postgresql/commonInputTypes.d.ts +392 -0
  61. package/lib/types/generated/postgresql/enums.d.ts +1 -0
  62. package/lib/types/generated/postgresql/internal/class.d.ts +143 -0
  63. package/lib/types/generated/postgresql/internal/prismaNamespace.d.ts +728 -0
  64. package/lib/types/generated/postgresql/internal/prismaNamespaceBrowser.d.ts +95 -0
  65. package/lib/types/generated/postgresql/models/AiChatHistory.d.ts +1373 -0
  66. package/lib/types/generated/postgresql/models/AiMessage.d.ts +1497 -0
  67. package/lib/types/generated/postgresql/models.d.ts +3 -0
  68. package/lib/types/generated/sqlite/browser.d.ts +15 -0
  69. package/lib/types/generated/sqlite/client.d.ts +34 -0
  70. package/lib/types/generated/sqlite/commonInputTypes.d.ts +373 -0
  71. package/lib/types/generated/sqlite/enums.d.ts +1 -0
  72. package/lib/types/generated/sqlite/internal/class.d.ts +143 -0
  73. package/lib/types/generated/sqlite/internal/prismaNamespace.d.ts +705 -0
  74. package/lib/types/generated/sqlite/internal/prismaNamespaceBrowser.d.ts +92 -0
  75. package/lib/types/generated/sqlite/models/AiChatHistory.d.ts +1371 -0
  76. package/lib/types/generated/sqlite/models/AiMessage.d.ts +1494 -0
  77. package/lib/types/generated/sqlite/models.d.ts +3 -0
  78. package/lib/types/generated/sqlserver/browser.d.ts +15 -0
  79. package/lib/types/generated/sqlserver/client.d.ts +34 -0
  80. package/lib/types/generated/sqlserver/commonInputTypes.d.ts +333 -0
  81. package/lib/types/generated/sqlserver/enums.d.ts +1 -0
  82. package/lib/types/generated/sqlserver/internal/class.d.ts +143 -0
  83. package/lib/types/generated/sqlserver/internal/prismaNamespace.d.ts +669 -0
  84. package/lib/types/generated/sqlserver/internal/prismaNamespaceBrowser.d.ts +80 -0
  85. package/lib/types/generated/sqlserver/models/AiChatHistory.d.ts +1257 -0
  86. package/lib/types/generated/sqlserver/models/AiMessage.d.ts +1376 -0
  87. package/lib/types/generated/sqlserver/models.d.ts +3 -0
  88. package/lib/types/index.d.ts +56 -0
  89. package/lib/types/projector.d.ts +48 -0
  90. package/lib/types/types.d.ts +49 -0
  91. package/lib/types.js +8 -0
  92. package/package.json +85 -0
  93. package/preview.png +0 -0
  94. package/prisma/schema.mysql.prisma +75 -0
  95. package/prisma/schema.postgresql.prisma +67 -0
  96. package/prisma/schema.sqlite.prisma +67 -0
  97. package/prisma/schema.sqlserver.prisma +73 -0
@@ -0,0 +1,1257 @@
1
+ import type * as runtime from "@prisma/client/runtime/client";
2
+ import type * as Prisma from "../internal/prismaNamespace.js";
3
+ /**
4
+ * Model AiChatHistory
5
+ * Per-session rollup, maintained incrementally by the projector.
6
+ */
7
+ export type AiChatHistoryModel = runtime.Types.Result.DefaultSelection<Prisma.$AiChatHistoryPayload>;
8
+ export type AggregateAiChatHistory = {
9
+ _count: AiChatHistoryCountAggregateOutputType | null;
10
+ _avg: AiChatHistoryAvgAggregateOutputType | null;
11
+ _sum: AiChatHistorySumAggregateOutputType | null;
12
+ _min: AiChatHistoryMinAggregateOutputType | null;
13
+ _max: AiChatHistoryMaxAggregateOutputType | null;
14
+ };
15
+ export type AiChatHistoryAvgAggregateOutputType = {
16
+ messageCount: number | null;
17
+ totalTokens: number | null;
18
+ };
19
+ export type AiChatHistorySumAggregateOutputType = {
20
+ messageCount: number | null;
21
+ totalTokens: bigint | null;
22
+ };
23
+ export type AiChatHistoryMinAggregateOutputType = {
24
+ id: string | null;
25
+ sessionId: string | null;
26
+ title: string | null;
27
+ summary: string | null;
28
+ messageCount: number | null;
29
+ totalTokens: bigint | null;
30
+ firstMessageAt: Date | null;
31
+ lastMessageAt: Date | null;
32
+ metadata: string | null;
33
+ deletedAt: Date | null;
34
+ };
35
+ export type AiChatHistoryMaxAggregateOutputType = {
36
+ id: string | null;
37
+ sessionId: string | null;
38
+ title: string | null;
39
+ summary: string | null;
40
+ messageCount: number | null;
41
+ totalTokens: bigint | null;
42
+ firstMessageAt: Date | null;
43
+ lastMessageAt: Date | null;
44
+ metadata: string | null;
45
+ deletedAt: Date | null;
46
+ };
47
+ export type AiChatHistoryCountAggregateOutputType = {
48
+ id: number;
49
+ sessionId: number;
50
+ title: number;
51
+ summary: number;
52
+ messageCount: number;
53
+ totalTokens: number;
54
+ firstMessageAt: number;
55
+ lastMessageAt: number;
56
+ metadata: number;
57
+ deletedAt: number;
58
+ _all: number;
59
+ };
60
+ export type AiChatHistoryAvgAggregateInputType = {
61
+ messageCount?: true;
62
+ totalTokens?: true;
63
+ };
64
+ export type AiChatHistorySumAggregateInputType = {
65
+ messageCount?: true;
66
+ totalTokens?: true;
67
+ };
68
+ export type AiChatHistoryMinAggregateInputType = {
69
+ id?: true;
70
+ sessionId?: true;
71
+ title?: true;
72
+ summary?: true;
73
+ messageCount?: true;
74
+ totalTokens?: true;
75
+ firstMessageAt?: true;
76
+ lastMessageAt?: true;
77
+ metadata?: true;
78
+ deletedAt?: true;
79
+ };
80
+ export type AiChatHistoryMaxAggregateInputType = {
81
+ id?: true;
82
+ sessionId?: true;
83
+ title?: true;
84
+ summary?: true;
85
+ messageCount?: true;
86
+ totalTokens?: true;
87
+ firstMessageAt?: true;
88
+ lastMessageAt?: true;
89
+ metadata?: true;
90
+ deletedAt?: true;
91
+ };
92
+ export type AiChatHistoryCountAggregateInputType = {
93
+ id?: true;
94
+ sessionId?: true;
95
+ title?: true;
96
+ summary?: true;
97
+ messageCount?: true;
98
+ totalTokens?: true;
99
+ firstMessageAt?: true;
100
+ lastMessageAt?: true;
101
+ metadata?: true;
102
+ deletedAt?: true;
103
+ _all?: true;
104
+ };
105
+ export type AiChatHistoryAggregateArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
106
+ /**
107
+ * Filter which AiChatHistory to aggregate.
108
+ */
109
+ where?: Prisma.AiChatHistoryWhereInput;
110
+ /**
111
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
112
+ *
113
+ * Determine the order of AiChatHistories to fetch.
114
+ */
115
+ orderBy?: Prisma.AiChatHistoryOrderByWithRelationInput | Prisma.AiChatHistoryOrderByWithRelationInput[];
116
+ /**
117
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
118
+ *
119
+ * Sets the start position
120
+ */
121
+ cursor?: Prisma.AiChatHistoryWhereUniqueInput;
122
+ /**
123
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
124
+ *
125
+ * Take `±n` AiChatHistories from the position of the cursor.
126
+ */
127
+ take?: number;
128
+ /**
129
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
130
+ *
131
+ * Skip the first `n` AiChatHistories.
132
+ */
133
+ skip?: number;
134
+ /**
135
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
136
+ *
137
+ * Count returned AiChatHistories
138
+ **/
139
+ _count?: true | AiChatHistoryCountAggregateInputType;
140
+ /**
141
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
142
+ *
143
+ * Select which fields to average
144
+ **/
145
+ _avg?: AiChatHistoryAvgAggregateInputType;
146
+ /**
147
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
148
+ *
149
+ * Select which fields to sum
150
+ **/
151
+ _sum?: AiChatHistorySumAggregateInputType;
152
+ /**
153
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
154
+ *
155
+ * Select which fields to find the minimum value
156
+ **/
157
+ _min?: AiChatHistoryMinAggregateInputType;
158
+ /**
159
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
160
+ *
161
+ * Select which fields to find the maximum value
162
+ **/
163
+ _max?: AiChatHistoryMaxAggregateInputType;
164
+ };
165
+ export type GetAiChatHistoryAggregateType<T extends AiChatHistoryAggregateArgs> = {
166
+ [P in keyof T & keyof AggregateAiChatHistory]: P extends '_count' | 'count' ? T[P] extends true ? number : Prisma.GetScalarType<T[P], AggregateAiChatHistory[P]> : Prisma.GetScalarType<T[P], AggregateAiChatHistory[P]>;
167
+ };
168
+ export type AiChatHistoryGroupByArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
169
+ where?: Prisma.AiChatHistoryWhereInput;
170
+ orderBy?: Prisma.AiChatHistoryOrderByWithAggregationInput | Prisma.AiChatHistoryOrderByWithAggregationInput[];
171
+ by: Prisma.AiChatHistoryScalarFieldEnum[] | Prisma.AiChatHistoryScalarFieldEnum;
172
+ having?: Prisma.AiChatHistoryScalarWhereWithAggregatesInput;
173
+ take?: number;
174
+ skip?: number;
175
+ _count?: AiChatHistoryCountAggregateInputType | true;
176
+ _avg?: AiChatHistoryAvgAggregateInputType;
177
+ _sum?: AiChatHistorySumAggregateInputType;
178
+ _min?: AiChatHistoryMinAggregateInputType;
179
+ _max?: AiChatHistoryMaxAggregateInputType;
180
+ };
181
+ export type AiChatHistoryGroupByOutputType = {
182
+ id: string;
183
+ sessionId: string;
184
+ title: string | null;
185
+ summary: string | null;
186
+ messageCount: number;
187
+ totalTokens: bigint;
188
+ firstMessageAt: Date | null;
189
+ lastMessageAt: Date | null;
190
+ metadata: string | null;
191
+ deletedAt: Date | null;
192
+ _count: AiChatHistoryCountAggregateOutputType | null;
193
+ _avg: AiChatHistoryAvgAggregateOutputType | null;
194
+ _sum: AiChatHistorySumAggregateOutputType | null;
195
+ _min: AiChatHistoryMinAggregateOutputType | null;
196
+ _max: AiChatHistoryMaxAggregateOutputType | null;
197
+ };
198
+ export type GetAiChatHistoryGroupByPayload<T extends AiChatHistoryGroupByArgs> = Prisma.PrismaPromise<Array<Prisma.PickEnumerable<AiChatHistoryGroupByOutputType, T['by']> & {
199
+ [P in ((keyof T) & (keyof AiChatHistoryGroupByOutputType))]: P extends '_count' ? T[P] extends boolean ? number : Prisma.GetScalarType<T[P], AiChatHistoryGroupByOutputType[P]> : Prisma.GetScalarType<T[P], AiChatHistoryGroupByOutputType[P]>;
200
+ }>>;
201
+ export type AiChatHistoryWhereInput = {
202
+ AND?: Prisma.AiChatHistoryWhereInput | Prisma.AiChatHistoryWhereInput[];
203
+ OR?: Prisma.AiChatHistoryWhereInput[];
204
+ NOT?: Prisma.AiChatHistoryWhereInput | Prisma.AiChatHistoryWhereInput[];
205
+ id?: Prisma.StringFilter<"AiChatHistory"> | string;
206
+ sessionId?: Prisma.StringFilter<"AiChatHistory"> | string;
207
+ title?: Prisma.StringNullableFilter<"AiChatHistory"> | string | null;
208
+ summary?: Prisma.StringNullableFilter<"AiChatHistory"> | string | null;
209
+ messageCount?: Prisma.IntFilter<"AiChatHistory"> | number;
210
+ totalTokens?: Prisma.BigIntFilter<"AiChatHistory"> | bigint | number;
211
+ firstMessageAt?: Prisma.DateTimeNullableFilter<"AiChatHistory"> | Date | string | null;
212
+ lastMessageAt?: Prisma.DateTimeNullableFilter<"AiChatHistory"> | Date | string | null;
213
+ metadata?: Prisma.StringNullableFilter<"AiChatHistory"> | string | null;
214
+ deletedAt?: Prisma.DateTimeNullableFilter<"AiChatHistory"> | Date | string | null;
215
+ messages?: Prisma.AiMessageListRelationFilter;
216
+ };
217
+ export type AiChatHistoryOrderByWithRelationInput = {
218
+ id?: Prisma.SortOrder;
219
+ sessionId?: Prisma.SortOrder;
220
+ title?: Prisma.SortOrderInput | Prisma.SortOrder;
221
+ summary?: Prisma.SortOrderInput | Prisma.SortOrder;
222
+ messageCount?: Prisma.SortOrder;
223
+ totalTokens?: Prisma.SortOrder;
224
+ firstMessageAt?: Prisma.SortOrderInput | Prisma.SortOrder;
225
+ lastMessageAt?: Prisma.SortOrderInput | Prisma.SortOrder;
226
+ metadata?: Prisma.SortOrderInput | Prisma.SortOrder;
227
+ deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder;
228
+ messages?: Prisma.AiMessageOrderByRelationAggregateInput;
229
+ };
230
+ export type AiChatHistoryWhereUniqueInput = Prisma.AtLeast<{
231
+ id?: string;
232
+ AND?: Prisma.AiChatHistoryWhereInput | Prisma.AiChatHistoryWhereInput[];
233
+ OR?: Prisma.AiChatHistoryWhereInput[];
234
+ NOT?: Prisma.AiChatHistoryWhereInput | Prisma.AiChatHistoryWhereInput[];
235
+ sessionId?: Prisma.StringFilter<"AiChatHistory"> | string;
236
+ title?: Prisma.StringNullableFilter<"AiChatHistory"> | string | null;
237
+ summary?: Prisma.StringNullableFilter<"AiChatHistory"> | string | null;
238
+ messageCount?: Prisma.IntFilter<"AiChatHistory"> | number;
239
+ totalTokens?: Prisma.BigIntFilter<"AiChatHistory"> | bigint | number;
240
+ firstMessageAt?: Prisma.DateTimeNullableFilter<"AiChatHistory"> | Date | string | null;
241
+ lastMessageAt?: Prisma.DateTimeNullableFilter<"AiChatHistory"> | Date | string | null;
242
+ metadata?: Prisma.StringNullableFilter<"AiChatHistory"> | string | null;
243
+ deletedAt?: Prisma.DateTimeNullableFilter<"AiChatHistory"> | Date | string | null;
244
+ messages?: Prisma.AiMessageListRelationFilter;
245
+ }, "id">;
246
+ export type AiChatHistoryOrderByWithAggregationInput = {
247
+ id?: Prisma.SortOrder;
248
+ sessionId?: Prisma.SortOrder;
249
+ title?: Prisma.SortOrderInput | Prisma.SortOrder;
250
+ summary?: Prisma.SortOrderInput | Prisma.SortOrder;
251
+ messageCount?: Prisma.SortOrder;
252
+ totalTokens?: Prisma.SortOrder;
253
+ firstMessageAt?: Prisma.SortOrderInput | Prisma.SortOrder;
254
+ lastMessageAt?: Prisma.SortOrderInput | Prisma.SortOrder;
255
+ metadata?: Prisma.SortOrderInput | Prisma.SortOrder;
256
+ deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder;
257
+ _count?: Prisma.AiChatHistoryCountOrderByAggregateInput;
258
+ _avg?: Prisma.AiChatHistoryAvgOrderByAggregateInput;
259
+ _max?: Prisma.AiChatHistoryMaxOrderByAggregateInput;
260
+ _min?: Prisma.AiChatHistoryMinOrderByAggregateInput;
261
+ _sum?: Prisma.AiChatHistorySumOrderByAggregateInput;
262
+ };
263
+ export type AiChatHistoryScalarWhereWithAggregatesInput = {
264
+ AND?: Prisma.AiChatHistoryScalarWhereWithAggregatesInput | Prisma.AiChatHistoryScalarWhereWithAggregatesInput[];
265
+ OR?: Prisma.AiChatHistoryScalarWhereWithAggregatesInput[];
266
+ NOT?: Prisma.AiChatHistoryScalarWhereWithAggregatesInput | Prisma.AiChatHistoryScalarWhereWithAggregatesInput[];
267
+ id?: Prisma.StringWithAggregatesFilter<"AiChatHistory"> | string;
268
+ sessionId?: Prisma.StringWithAggregatesFilter<"AiChatHistory"> | string;
269
+ title?: Prisma.StringNullableWithAggregatesFilter<"AiChatHistory"> | string | null;
270
+ summary?: Prisma.StringNullableWithAggregatesFilter<"AiChatHistory"> | string | null;
271
+ messageCount?: Prisma.IntWithAggregatesFilter<"AiChatHistory"> | number;
272
+ totalTokens?: Prisma.BigIntWithAggregatesFilter<"AiChatHistory"> | bigint | number;
273
+ firstMessageAt?: Prisma.DateTimeNullableWithAggregatesFilter<"AiChatHistory"> | Date | string | null;
274
+ lastMessageAt?: Prisma.DateTimeNullableWithAggregatesFilter<"AiChatHistory"> | Date | string | null;
275
+ metadata?: Prisma.StringNullableWithAggregatesFilter<"AiChatHistory"> | string | null;
276
+ deletedAt?: Prisma.DateTimeNullableWithAggregatesFilter<"AiChatHistory"> | Date | string | null;
277
+ };
278
+ export type AiChatHistoryCreateInput = {
279
+ id?: string;
280
+ sessionId: string;
281
+ title?: string | null;
282
+ summary?: string | null;
283
+ messageCount?: number;
284
+ totalTokens?: bigint | number;
285
+ firstMessageAt?: Date | string | null;
286
+ lastMessageAt?: Date | string | null;
287
+ metadata?: string | null;
288
+ deletedAt?: Date | string | null;
289
+ messages?: Prisma.AiMessageCreateNestedManyWithoutHistoryInput;
290
+ };
291
+ export type AiChatHistoryUncheckedCreateInput = {
292
+ id?: string;
293
+ sessionId: string;
294
+ title?: string | null;
295
+ summary?: string | null;
296
+ messageCount?: number;
297
+ totalTokens?: bigint | number;
298
+ firstMessageAt?: Date | string | null;
299
+ lastMessageAt?: Date | string | null;
300
+ metadata?: string | null;
301
+ deletedAt?: Date | string | null;
302
+ messages?: Prisma.AiMessageUncheckedCreateNestedManyWithoutHistoryInput;
303
+ };
304
+ export type AiChatHistoryUpdateInput = {
305
+ id?: Prisma.StringFieldUpdateOperationsInput | string;
306
+ sessionId?: Prisma.StringFieldUpdateOperationsInput | string;
307
+ title?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
308
+ summary?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
309
+ messageCount?: Prisma.IntFieldUpdateOperationsInput | number;
310
+ totalTokens?: Prisma.BigIntFieldUpdateOperationsInput | bigint | number;
311
+ firstMessageAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null;
312
+ lastMessageAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null;
313
+ metadata?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
314
+ deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null;
315
+ messages?: Prisma.AiMessageUpdateManyWithoutHistoryNestedInput;
316
+ };
317
+ export type AiChatHistoryUncheckedUpdateInput = {
318
+ id?: Prisma.StringFieldUpdateOperationsInput | string;
319
+ sessionId?: Prisma.StringFieldUpdateOperationsInput | string;
320
+ title?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
321
+ summary?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
322
+ messageCount?: Prisma.IntFieldUpdateOperationsInput | number;
323
+ totalTokens?: Prisma.BigIntFieldUpdateOperationsInput | bigint | number;
324
+ firstMessageAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null;
325
+ lastMessageAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null;
326
+ metadata?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
327
+ deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null;
328
+ messages?: Prisma.AiMessageUncheckedUpdateManyWithoutHistoryNestedInput;
329
+ };
330
+ export type AiChatHistoryCreateManyInput = {
331
+ id?: string;
332
+ sessionId: string;
333
+ title?: string | null;
334
+ summary?: string | null;
335
+ messageCount?: number;
336
+ totalTokens?: bigint | number;
337
+ firstMessageAt?: Date | string | null;
338
+ lastMessageAt?: Date | string | null;
339
+ metadata?: string | null;
340
+ deletedAt?: Date | string | null;
341
+ };
342
+ export type AiChatHistoryUpdateManyMutationInput = {
343
+ id?: Prisma.StringFieldUpdateOperationsInput | string;
344
+ sessionId?: Prisma.StringFieldUpdateOperationsInput | string;
345
+ title?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
346
+ summary?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
347
+ messageCount?: Prisma.IntFieldUpdateOperationsInput | number;
348
+ totalTokens?: Prisma.BigIntFieldUpdateOperationsInput | bigint | number;
349
+ firstMessageAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null;
350
+ lastMessageAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null;
351
+ metadata?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
352
+ deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null;
353
+ };
354
+ export type AiChatHistoryUncheckedUpdateManyInput = {
355
+ id?: Prisma.StringFieldUpdateOperationsInput | string;
356
+ sessionId?: Prisma.StringFieldUpdateOperationsInput | string;
357
+ title?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
358
+ summary?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
359
+ messageCount?: Prisma.IntFieldUpdateOperationsInput | number;
360
+ totalTokens?: Prisma.BigIntFieldUpdateOperationsInput | bigint | number;
361
+ firstMessageAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null;
362
+ lastMessageAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null;
363
+ metadata?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
364
+ deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null;
365
+ };
366
+ export type AiChatHistoryNullableScalarRelationFilter = {
367
+ is?: Prisma.AiChatHistoryWhereInput | null;
368
+ isNot?: Prisma.AiChatHistoryWhereInput | null;
369
+ };
370
+ export type AiChatHistoryCountOrderByAggregateInput = {
371
+ id?: Prisma.SortOrder;
372
+ sessionId?: Prisma.SortOrder;
373
+ title?: Prisma.SortOrder;
374
+ summary?: Prisma.SortOrder;
375
+ messageCount?: Prisma.SortOrder;
376
+ totalTokens?: Prisma.SortOrder;
377
+ firstMessageAt?: Prisma.SortOrder;
378
+ lastMessageAt?: Prisma.SortOrder;
379
+ metadata?: Prisma.SortOrder;
380
+ deletedAt?: Prisma.SortOrder;
381
+ };
382
+ export type AiChatHistoryAvgOrderByAggregateInput = {
383
+ messageCount?: Prisma.SortOrder;
384
+ totalTokens?: Prisma.SortOrder;
385
+ };
386
+ export type AiChatHistoryMaxOrderByAggregateInput = {
387
+ id?: Prisma.SortOrder;
388
+ sessionId?: Prisma.SortOrder;
389
+ title?: Prisma.SortOrder;
390
+ summary?: Prisma.SortOrder;
391
+ messageCount?: Prisma.SortOrder;
392
+ totalTokens?: Prisma.SortOrder;
393
+ firstMessageAt?: Prisma.SortOrder;
394
+ lastMessageAt?: Prisma.SortOrder;
395
+ metadata?: Prisma.SortOrder;
396
+ deletedAt?: Prisma.SortOrder;
397
+ };
398
+ export type AiChatHistoryMinOrderByAggregateInput = {
399
+ id?: Prisma.SortOrder;
400
+ sessionId?: Prisma.SortOrder;
401
+ title?: Prisma.SortOrder;
402
+ summary?: Prisma.SortOrder;
403
+ messageCount?: Prisma.SortOrder;
404
+ totalTokens?: Prisma.SortOrder;
405
+ firstMessageAt?: Prisma.SortOrder;
406
+ lastMessageAt?: Prisma.SortOrder;
407
+ metadata?: Prisma.SortOrder;
408
+ deletedAt?: Prisma.SortOrder;
409
+ };
410
+ export type AiChatHistorySumOrderByAggregateInput = {
411
+ messageCount?: Prisma.SortOrder;
412
+ totalTokens?: Prisma.SortOrder;
413
+ };
414
+ export type AiChatHistoryCreateNestedOneWithoutMessagesInput = {
415
+ create?: Prisma.XOR<Prisma.AiChatHistoryCreateWithoutMessagesInput, Prisma.AiChatHistoryUncheckedCreateWithoutMessagesInput>;
416
+ connectOrCreate?: Prisma.AiChatHistoryCreateOrConnectWithoutMessagesInput;
417
+ connect?: Prisma.AiChatHistoryWhereUniqueInput;
418
+ };
419
+ export type AiChatHistoryUpdateOneWithoutMessagesNestedInput = {
420
+ create?: Prisma.XOR<Prisma.AiChatHistoryCreateWithoutMessagesInput, Prisma.AiChatHistoryUncheckedCreateWithoutMessagesInput>;
421
+ connectOrCreate?: Prisma.AiChatHistoryCreateOrConnectWithoutMessagesInput;
422
+ upsert?: Prisma.AiChatHistoryUpsertWithoutMessagesInput;
423
+ disconnect?: Prisma.AiChatHistoryWhereInput | boolean;
424
+ delete?: Prisma.AiChatHistoryWhereInput | boolean;
425
+ connect?: Prisma.AiChatHistoryWhereUniqueInput;
426
+ update?: Prisma.XOR<Prisma.XOR<Prisma.AiChatHistoryUpdateToOneWithWhereWithoutMessagesInput, Prisma.AiChatHistoryUpdateWithoutMessagesInput>, Prisma.AiChatHistoryUncheckedUpdateWithoutMessagesInput>;
427
+ };
428
+ export type IntFieldUpdateOperationsInput = {
429
+ set?: number;
430
+ increment?: number;
431
+ decrement?: number;
432
+ multiply?: number;
433
+ divide?: number;
434
+ };
435
+ export type BigIntFieldUpdateOperationsInput = {
436
+ set?: bigint | number;
437
+ increment?: bigint | number;
438
+ decrement?: bigint | number;
439
+ multiply?: bigint | number;
440
+ divide?: bigint | number;
441
+ };
442
+ export type AiChatHistoryCreateWithoutMessagesInput = {
443
+ id?: string;
444
+ sessionId: string;
445
+ title?: string | null;
446
+ summary?: string | null;
447
+ messageCount?: number;
448
+ totalTokens?: bigint | number;
449
+ firstMessageAt?: Date | string | null;
450
+ lastMessageAt?: Date | string | null;
451
+ metadata?: string | null;
452
+ deletedAt?: Date | string | null;
453
+ };
454
+ export type AiChatHistoryUncheckedCreateWithoutMessagesInput = {
455
+ id?: string;
456
+ sessionId: string;
457
+ title?: string | null;
458
+ summary?: string | null;
459
+ messageCount?: number;
460
+ totalTokens?: bigint | number;
461
+ firstMessageAt?: Date | string | null;
462
+ lastMessageAt?: Date | string | null;
463
+ metadata?: string | null;
464
+ deletedAt?: Date | string | null;
465
+ };
466
+ export type AiChatHistoryCreateOrConnectWithoutMessagesInput = {
467
+ where: Prisma.AiChatHistoryWhereUniqueInput;
468
+ create: Prisma.XOR<Prisma.AiChatHistoryCreateWithoutMessagesInput, Prisma.AiChatHistoryUncheckedCreateWithoutMessagesInput>;
469
+ };
470
+ export type AiChatHistoryUpsertWithoutMessagesInput = {
471
+ update: Prisma.XOR<Prisma.AiChatHistoryUpdateWithoutMessagesInput, Prisma.AiChatHistoryUncheckedUpdateWithoutMessagesInput>;
472
+ create: Prisma.XOR<Prisma.AiChatHistoryCreateWithoutMessagesInput, Prisma.AiChatHistoryUncheckedCreateWithoutMessagesInput>;
473
+ where?: Prisma.AiChatHistoryWhereInput;
474
+ };
475
+ export type AiChatHistoryUpdateToOneWithWhereWithoutMessagesInput = {
476
+ where?: Prisma.AiChatHistoryWhereInput;
477
+ data: Prisma.XOR<Prisma.AiChatHistoryUpdateWithoutMessagesInput, Prisma.AiChatHistoryUncheckedUpdateWithoutMessagesInput>;
478
+ };
479
+ export type AiChatHistoryUpdateWithoutMessagesInput = {
480
+ id?: Prisma.StringFieldUpdateOperationsInput | string;
481
+ sessionId?: Prisma.StringFieldUpdateOperationsInput | string;
482
+ title?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
483
+ summary?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
484
+ messageCount?: Prisma.IntFieldUpdateOperationsInput | number;
485
+ totalTokens?: Prisma.BigIntFieldUpdateOperationsInput | bigint | number;
486
+ firstMessageAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null;
487
+ lastMessageAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null;
488
+ metadata?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
489
+ deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null;
490
+ };
491
+ export type AiChatHistoryUncheckedUpdateWithoutMessagesInput = {
492
+ id?: Prisma.StringFieldUpdateOperationsInput | string;
493
+ sessionId?: Prisma.StringFieldUpdateOperationsInput | string;
494
+ title?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
495
+ summary?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
496
+ messageCount?: Prisma.IntFieldUpdateOperationsInput | number;
497
+ totalTokens?: Prisma.BigIntFieldUpdateOperationsInput | bigint | number;
498
+ firstMessageAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null;
499
+ lastMessageAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null;
500
+ metadata?: Prisma.NullableStringFieldUpdateOperationsInput | string | null;
501
+ deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null;
502
+ };
503
+ /**
504
+ * Count Type AiChatHistoryCountOutputType
505
+ */
506
+ export type AiChatHistoryCountOutputType = {
507
+ messages: number;
508
+ };
509
+ export type AiChatHistoryCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
510
+ messages?: boolean | AiChatHistoryCountOutputTypeCountMessagesArgs;
511
+ };
512
+ /**
513
+ * AiChatHistoryCountOutputType without action
514
+ */
515
+ export type AiChatHistoryCountOutputTypeDefaultArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
516
+ /**
517
+ * Select specific fields to fetch from the AiChatHistoryCountOutputType
518
+ */
519
+ select?: Prisma.AiChatHistoryCountOutputTypeSelect<ExtArgs> | null;
520
+ };
521
+ /**
522
+ * AiChatHistoryCountOutputType without action
523
+ */
524
+ export type AiChatHistoryCountOutputTypeCountMessagesArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
525
+ where?: Prisma.AiMessageWhereInput;
526
+ };
527
+ export type AiChatHistorySelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
528
+ id?: boolean;
529
+ sessionId?: boolean;
530
+ title?: boolean;
531
+ summary?: boolean;
532
+ messageCount?: boolean;
533
+ totalTokens?: boolean;
534
+ firstMessageAt?: boolean;
535
+ lastMessageAt?: boolean;
536
+ metadata?: boolean;
537
+ deletedAt?: boolean;
538
+ messages?: boolean | Prisma.AiChatHistory$messagesArgs<ExtArgs>;
539
+ _count?: boolean | Prisma.AiChatHistoryCountOutputTypeDefaultArgs<ExtArgs>;
540
+ }, ExtArgs["result"]["aiChatHistory"]>;
541
+ export type AiChatHistorySelectScalar = {
542
+ id?: boolean;
543
+ sessionId?: boolean;
544
+ title?: boolean;
545
+ summary?: boolean;
546
+ messageCount?: boolean;
547
+ totalTokens?: boolean;
548
+ firstMessageAt?: boolean;
549
+ lastMessageAt?: boolean;
550
+ metadata?: boolean;
551
+ deletedAt?: boolean;
552
+ };
553
+ export type AiChatHistoryOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "sessionId" | "title" | "summary" | "messageCount" | "totalTokens" | "firstMessageAt" | "lastMessageAt" | "metadata" | "deletedAt", ExtArgs["result"]["aiChatHistory"]>;
554
+ export type AiChatHistoryInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
555
+ messages?: boolean | Prisma.AiChatHistory$messagesArgs<ExtArgs>;
556
+ _count?: boolean | Prisma.AiChatHistoryCountOutputTypeDefaultArgs<ExtArgs>;
557
+ };
558
+ export type $AiChatHistoryPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
559
+ name: "AiChatHistory";
560
+ objects: {
561
+ messages: Prisma.$AiMessagePayload<ExtArgs>[];
562
+ };
563
+ scalars: runtime.Types.Extensions.GetPayloadResult<{
564
+ id: string;
565
+ sessionId: string;
566
+ title: string | null;
567
+ summary: string | null;
568
+ messageCount: number;
569
+ totalTokens: bigint;
570
+ firstMessageAt: Date | null;
571
+ lastMessageAt: Date | null;
572
+ metadata: string | null;
573
+ deletedAt: Date | null;
574
+ }, ExtArgs["result"]["aiChatHistory"]>;
575
+ composites: {};
576
+ };
577
+ export type AiChatHistoryGetPayload<S extends boolean | null | undefined | AiChatHistoryDefaultArgs> = runtime.Types.Result.GetResult<Prisma.$AiChatHistoryPayload, S>;
578
+ export type AiChatHistoryCountArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = Omit<AiChatHistoryFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
579
+ select?: AiChatHistoryCountAggregateInputType | true;
580
+ };
581
+ export interface AiChatHistoryDelegate<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> {
582
+ [K: symbol]: {
583
+ types: Prisma.TypeMap<ExtArgs>['model']['AiChatHistory'];
584
+ meta: {
585
+ name: 'AiChatHistory';
586
+ };
587
+ };
588
+ /**
589
+ * Find zero or one AiChatHistory that matches the filter.
590
+ * @param {AiChatHistoryFindUniqueArgs} args - Arguments to find a AiChatHistory
591
+ * @example
592
+ * // Get one AiChatHistory
593
+ * const aiChatHistory = await prisma.aiChatHistory.findUnique({
594
+ * where: {
595
+ * // ... provide filter here
596
+ * }
597
+ * })
598
+ */
599
+ findUnique<T extends AiChatHistoryFindUniqueArgs>(args: Prisma.SelectSubset<T, AiChatHistoryFindUniqueArgs<ExtArgs>>): Prisma.Prisma__AiChatHistoryClient<runtime.Types.Result.GetResult<Prisma.$AiChatHistoryPayload<ExtArgs>, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>;
600
+ /**
601
+ * Find one AiChatHistory that matches the filter or throw an error with `error.code='P2025'`
602
+ * if no matches were found.
603
+ * @param {AiChatHistoryFindUniqueOrThrowArgs} args - Arguments to find a AiChatHistory
604
+ * @example
605
+ * // Get one AiChatHistory
606
+ * const aiChatHistory = await prisma.aiChatHistory.findUniqueOrThrow({
607
+ * where: {
608
+ * // ... provide filter here
609
+ * }
610
+ * })
611
+ */
612
+ findUniqueOrThrow<T extends AiChatHistoryFindUniqueOrThrowArgs>(args: Prisma.SelectSubset<T, AiChatHistoryFindUniqueOrThrowArgs<ExtArgs>>): Prisma.Prisma__AiChatHistoryClient<runtime.Types.Result.GetResult<Prisma.$AiChatHistoryPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>;
613
+ /**
614
+ * Find the first AiChatHistory that matches the filter.
615
+ * Note, that providing `undefined` is treated as the value not being there.
616
+ * Read more here: https://pris.ly/d/null-undefined
617
+ * @param {AiChatHistoryFindFirstArgs} args - Arguments to find a AiChatHistory
618
+ * @example
619
+ * // Get one AiChatHistory
620
+ * const aiChatHistory = await prisma.aiChatHistory.findFirst({
621
+ * where: {
622
+ * // ... provide filter here
623
+ * }
624
+ * })
625
+ */
626
+ findFirst<T extends AiChatHistoryFindFirstArgs>(args?: Prisma.SelectSubset<T, AiChatHistoryFindFirstArgs<ExtArgs>>): Prisma.Prisma__AiChatHistoryClient<runtime.Types.Result.GetResult<Prisma.$AiChatHistoryPayload<ExtArgs>, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>;
627
+ /**
628
+ * Find the first AiChatHistory that matches the filter or
629
+ * throw `PrismaKnownClientError` with `P2025` code if no matches were found.
630
+ * Note, that providing `undefined` is treated as the value not being there.
631
+ * Read more here: https://pris.ly/d/null-undefined
632
+ * @param {AiChatHistoryFindFirstOrThrowArgs} args - Arguments to find a AiChatHistory
633
+ * @example
634
+ * // Get one AiChatHistory
635
+ * const aiChatHistory = await prisma.aiChatHistory.findFirstOrThrow({
636
+ * where: {
637
+ * // ... provide filter here
638
+ * }
639
+ * })
640
+ */
641
+ findFirstOrThrow<T extends AiChatHistoryFindFirstOrThrowArgs>(args?: Prisma.SelectSubset<T, AiChatHistoryFindFirstOrThrowArgs<ExtArgs>>): Prisma.Prisma__AiChatHistoryClient<runtime.Types.Result.GetResult<Prisma.$AiChatHistoryPayload<ExtArgs>, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>;
642
+ /**
643
+ * Find zero or more AiChatHistories that matches the filter.
644
+ * Note, that providing `undefined` is treated as the value not being there.
645
+ * Read more here: https://pris.ly/d/null-undefined
646
+ * @param {AiChatHistoryFindManyArgs} args - Arguments to filter and select certain fields only.
647
+ * @example
648
+ * // Get all AiChatHistories
649
+ * const aiChatHistories = await prisma.aiChatHistory.findMany()
650
+ *
651
+ * // Get first 10 AiChatHistories
652
+ * const aiChatHistories = await prisma.aiChatHistory.findMany({ take: 10 })
653
+ *
654
+ * // Only select the `id`
655
+ * const aiChatHistoryWithIdOnly = await prisma.aiChatHistory.findMany({ select: { id: true } })
656
+ *
657
+ */
658
+ findMany<T extends AiChatHistoryFindManyArgs>(args?: Prisma.SelectSubset<T, AiChatHistoryFindManyArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$AiChatHistoryPayload<ExtArgs>, T, "findMany", GlobalOmitOptions>>;
659
+ /**
660
+ * Create a AiChatHistory.
661
+ * @param {AiChatHistoryCreateArgs} args - Arguments to create a AiChatHistory.
662
+ * @example
663
+ * // Create one AiChatHistory
664
+ * const AiChatHistory = await prisma.aiChatHistory.create({
665
+ * data: {
666
+ * // ... data to create a AiChatHistory
667
+ * }
668
+ * })
669
+ *
670
+ */
671
+ create<T extends AiChatHistoryCreateArgs>(args: Prisma.SelectSubset<T, AiChatHistoryCreateArgs<ExtArgs>>): Prisma.Prisma__AiChatHistoryClient<runtime.Types.Result.GetResult<Prisma.$AiChatHistoryPayload<ExtArgs>, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>;
672
+ /**
673
+ * Create many AiChatHistories.
674
+ * @param {AiChatHistoryCreateManyArgs} args - Arguments to create many AiChatHistories.
675
+ * @example
676
+ * // Create many AiChatHistories
677
+ * const aiChatHistory = await prisma.aiChatHistory.createMany({
678
+ * data: [
679
+ * // ... provide data here
680
+ * ]
681
+ * })
682
+ *
683
+ */
684
+ createMany<T extends AiChatHistoryCreateManyArgs>(args?: Prisma.SelectSubset<T, AiChatHistoryCreateManyArgs<ExtArgs>>): Prisma.PrismaPromise<Prisma.BatchPayload>;
685
+ /**
686
+ * Delete a AiChatHistory.
687
+ * @param {AiChatHistoryDeleteArgs} args - Arguments to delete one AiChatHistory.
688
+ * @example
689
+ * // Delete one AiChatHistory
690
+ * const AiChatHistory = await prisma.aiChatHistory.delete({
691
+ * where: {
692
+ * // ... filter to delete one AiChatHistory
693
+ * }
694
+ * })
695
+ *
696
+ */
697
+ delete<T extends AiChatHistoryDeleteArgs>(args: Prisma.SelectSubset<T, AiChatHistoryDeleteArgs<ExtArgs>>): Prisma.Prisma__AiChatHistoryClient<runtime.Types.Result.GetResult<Prisma.$AiChatHistoryPayload<ExtArgs>, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>;
698
+ /**
699
+ * Update one AiChatHistory.
700
+ * @param {AiChatHistoryUpdateArgs} args - Arguments to update one AiChatHistory.
701
+ * @example
702
+ * // Update one AiChatHistory
703
+ * const aiChatHistory = await prisma.aiChatHistory.update({
704
+ * where: {
705
+ * // ... provide filter here
706
+ * },
707
+ * data: {
708
+ * // ... provide data here
709
+ * }
710
+ * })
711
+ *
712
+ */
713
+ update<T extends AiChatHistoryUpdateArgs>(args: Prisma.SelectSubset<T, AiChatHistoryUpdateArgs<ExtArgs>>): Prisma.Prisma__AiChatHistoryClient<runtime.Types.Result.GetResult<Prisma.$AiChatHistoryPayload<ExtArgs>, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>;
714
+ /**
715
+ * Delete zero or more AiChatHistories.
716
+ * @param {AiChatHistoryDeleteManyArgs} args - Arguments to filter AiChatHistories to delete.
717
+ * @example
718
+ * // Delete a few AiChatHistories
719
+ * const { count } = await prisma.aiChatHistory.deleteMany({
720
+ * where: {
721
+ * // ... provide filter here
722
+ * }
723
+ * })
724
+ *
725
+ */
726
+ deleteMany<T extends AiChatHistoryDeleteManyArgs>(args?: Prisma.SelectSubset<T, AiChatHistoryDeleteManyArgs<ExtArgs>>): Prisma.PrismaPromise<Prisma.BatchPayload>;
727
+ /**
728
+ * Update zero or more AiChatHistories.
729
+ * Note, that providing `undefined` is treated as the value not being there.
730
+ * Read more here: https://pris.ly/d/null-undefined
731
+ * @param {AiChatHistoryUpdateManyArgs} args - Arguments to update one or more rows.
732
+ * @example
733
+ * // Update many AiChatHistories
734
+ * const aiChatHistory = await prisma.aiChatHistory.updateMany({
735
+ * where: {
736
+ * // ... provide filter here
737
+ * },
738
+ * data: {
739
+ * // ... provide data here
740
+ * }
741
+ * })
742
+ *
743
+ */
744
+ updateMany<T extends AiChatHistoryUpdateManyArgs>(args: Prisma.SelectSubset<T, AiChatHistoryUpdateManyArgs<ExtArgs>>): Prisma.PrismaPromise<Prisma.BatchPayload>;
745
+ /**
746
+ * Create or update one AiChatHistory.
747
+ * @param {AiChatHistoryUpsertArgs} args - Arguments to update or create a AiChatHistory.
748
+ * @example
749
+ * // Update or create a AiChatHistory
750
+ * const aiChatHistory = await prisma.aiChatHistory.upsert({
751
+ * create: {
752
+ * // ... data to create a AiChatHistory
753
+ * },
754
+ * update: {
755
+ * // ... in case it already exists, update
756
+ * },
757
+ * where: {
758
+ * // ... the filter for the AiChatHistory we want to update
759
+ * }
760
+ * })
761
+ */
762
+ upsert<T extends AiChatHistoryUpsertArgs>(args: Prisma.SelectSubset<T, AiChatHistoryUpsertArgs<ExtArgs>>): Prisma.Prisma__AiChatHistoryClient<runtime.Types.Result.GetResult<Prisma.$AiChatHistoryPayload<ExtArgs>, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>;
763
+ /**
764
+ * Count the number of AiChatHistories.
765
+ * Note, that providing `undefined` is treated as the value not being there.
766
+ * Read more here: https://pris.ly/d/null-undefined
767
+ * @param {AiChatHistoryCountArgs} args - Arguments to filter AiChatHistories to count.
768
+ * @example
769
+ * // Count the number of AiChatHistories
770
+ * const count = await prisma.aiChatHistory.count({
771
+ * where: {
772
+ * // ... the filter for the AiChatHistories we want to count
773
+ * }
774
+ * })
775
+ **/
776
+ count<T extends AiChatHistoryCountArgs>(args?: Prisma.Subset<T, AiChatHistoryCountArgs>): Prisma.PrismaPromise<T extends runtime.Types.Utils.Record<'select', any> ? T['select'] extends true ? number : Prisma.GetScalarType<T['select'], AiChatHistoryCountAggregateOutputType> : number>;
777
+ /**
778
+ * Allows you to perform aggregations operations on a AiChatHistory.
779
+ * Note, that providing `undefined` is treated as the value not being there.
780
+ * Read more here: https://pris.ly/d/null-undefined
781
+ * @param {AiChatHistoryAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
782
+ * @example
783
+ * // Ordered by age ascending
784
+ * // Where email contains prisma.io
785
+ * // Limited to the 10 users
786
+ * const aggregations = await prisma.user.aggregate({
787
+ * _avg: {
788
+ * age: true,
789
+ * },
790
+ * where: {
791
+ * email: {
792
+ * contains: "prisma.io",
793
+ * },
794
+ * },
795
+ * orderBy: {
796
+ * age: "asc",
797
+ * },
798
+ * take: 10,
799
+ * })
800
+ **/
801
+ aggregate<T extends AiChatHistoryAggregateArgs>(args: Prisma.Subset<T, AiChatHistoryAggregateArgs>): Prisma.PrismaPromise<GetAiChatHistoryAggregateType<T>>;
802
+ /**
803
+ * Group by AiChatHistory.
804
+ * Note, that providing `undefined` is treated as the value not being there.
805
+ * Read more here: https://pris.ly/d/null-undefined
806
+ * @param {AiChatHistoryGroupByArgs} args - Group by arguments.
807
+ * @example
808
+ * // Group by city, order by createdAt, get count
809
+ * const result = await prisma.user.groupBy({
810
+ * by: ['city', 'createdAt'],
811
+ * orderBy: {
812
+ * createdAt: true
813
+ * },
814
+ * _count: {
815
+ * _all: true
816
+ * },
817
+ * })
818
+ *
819
+ **/
820
+ groupBy<T extends AiChatHistoryGroupByArgs, HasSelectOrTake extends Prisma.Or<Prisma.Extends<'skip', Prisma.Keys<T>>, Prisma.Extends<'take', Prisma.Keys<T>>>, OrderByArg extends Prisma.True extends HasSelectOrTake ? {
821
+ orderBy: AiChatHistoryGroupByArgs['orderBy'];
822
+ } : {
823
+ orderBy?: AiChatHistoryGroupByArgs['orderBy'];
824
+ }, OrderFields extends Prisma.ExcludeUnderscoreKeys<Prisma.Keys<Prisma.MaybeTupleToUnion<T['orderBy']>>>, ByFields extends Prisma.MaybeTupleToUnion<T['by']>, ByValid extends Prisma.Has<ByFields, OrderFields>, HavingFields extends Prisma.GetHavingFields<T['having']>, HavingValid extends Prisma.Has<ByFields, HavingFields>, ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, InputErrors extends ByEmpty extends Prisma.True ? `Error: "by" must not be empty.` : HavingValid extends Prisma.False ? {
825
+ [P in HavingFields]: P extends ByFields ? never : P extends string ? `Error: Field "${P}" used in "having" needs to be provided in "by".` : [
826
+ Error,
827
+ 'Field ',
828
+ P,
829
+ ` in "having" needs to be provided in "by"`
830
+ ];
831
+ }[HavingFields] : 'take' extends Prisma.Keys<T> ? 'orderBy' extends Prisma.Keys<T> ? ByValid extends Prisma.True ? {} : {
832
+ [P in OrderFields]: P extends ByFields ? never : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`;
833
+ }[OrderFields] : 'Error: If you provide "take", you also need to provide "orderBy"' : 'skip' extends Prisma.Keys<T> ? 'orderBy' extends Prisma.Keys<T> ? ByValid extends Prisma.True ? {} : {
834
+ [P in OrderFields]: P extends ByFields ? never : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`;
835
+ }[OrderFields] : 'Error: If you provide "skip", you also need to provide "orderBy"' : ByValid extends Prisma.True ? {} : {
836
+ [P in OrderFields]: P extends ByFields ? never : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`;
837
+ }[OrderFields]>(args: Prisma.SubsetIntersection<T, AiChatHistoryGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetAiChatHistoryGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>;
838
+ /**
839
+ * Fields of the AiChatHistory model
840
+ */
841
+ readonly fields: AiChatHistoryFieldRefs;
842
+ }
843
+ /**
844
+ * The delegate class that acts as a "Promise-like" for AiChatHistory.
845
+ * Why is this prefixed with `Prisma__`?
846
+ * Because we want to prevent naming conflicts as mentioned in
847
+ * https://github.com/prisma/prisma-client-js/issues/707
848
+ */
849
+ export interface Prisma__AiChatHistoryClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
850
+ readonly [Symbol.toStringTag]: "PrismaPromise";
851
+ messages<T extends Prisma.AiChatHistory$messagesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.AiChatHistory$messagesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$AiMessagePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>;
852
+ /**
853
+ * Attaches callbacks for the resolution and/or rejection of the Promise.
854
+ * @param onfulfilled The callback to execute when the Promise is resolved.
855
+ * @param onrejected The callback to execute when the Promise is rejected.
856
+ * @returns A Promise for the completion of which ever callback is executed.
857
+ */
858
+ then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): runtime.Types.Utils.JsPromise<TResult1 | TResult2>;
859
+ /**
860
+ * Attaches a callback for only the rejection of the Promise.
861
+ * @param onrejected The callback to execute when the Promise is rejected.
862
+ * @returns A Promise for the completion of the callback.
863
+ */
864
+ catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): runtime.Types.Utils.JsPromise<T | TResult>;
865
+ /**
866
+ * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
867
+ * resolved value cannot be modified from the callback.
868
+ * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
869
+ * @returns A Promise for the completion of the callback.
870
+ */
871
+ finally(onfinally?: (() => void) | undefined | null): runtime.Types.Utils.JsPromise<T>;
872
+ }
873
+ /**
874
+ * Fields of the AiChatHistory model
875
+ */
876
+ export interface AiChatHistoryFieldRefs {
877
+ readonly id: Prisma.FieldRef<"AiChatHistory", 'String'>;
878
+ readonly sessionId: Prisma.FieldRef<"AiChatHistory", 'String'>;
879
+ readonly title: Prisma.FieldRef<"AiChatHistory", 'String'>;
880
+ readonly summary: Prisma.FieldRef<"AiChatHistory", 'String'>;
881
+ readonly messageCount: Prisma.FieldRef<"AiChatHistory", 'Int'>;
882
+ readonly totalTokens: Prisma.FieldRef<"AiChatHistory", 'BigInt'>;
883
+ readonly firstMessageAt: Prisma.FieldRef<"AiChatHistory", 'DateTime'>;
884
+ readonly lastMessageAt: Prisma.FieldRef<"AiChatHistory", 'DateTime'>;
885
+ readonly metadata: Prisma.FieldRef<"AiChatHistory", 'String'>;
886
+ readonly deletedAt: Prisma.FieldRef<"AiChatHistory", 'DateTime'>;
887
+ }
888
+ /**
889
+ * AiChatHistory findUnique
890
+ */
891
+ export type AiChatHistoryFindUniqueArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
892
+ /**
893
+ * Select specific fields to fetch from the AiChatHistory
894
+ */
895
+ select?: Prisma.AiChatHistorySelect<ExtArgs> | null;
896
+ /**
897
+ * Omit specific fields from the AiChatHistory
898
+ */
899
+ omit?: Prisma.AiChatHistoryOmit<ExtArgs> | null;
900
+ /**
901
+ * Choose, which related nodes to fetch as well
902
+ */
903
+ include?: Prisma.AiChatHistoryInclude<ExtArgs> | null;
904
+ /**
905
+ * Filter, which AiChatHistory to fetch.
906
+ */
907
+ where: Prisma.AiChatHistoryWhereUniqueInput;
908
+ };
909
+ /**
910
+ * AiChatHistory findUniqueOrThrow
911
+ */
912
+ export type AiChatHistoryFindUniqueOrThrowArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
913
+ /**
914
+ * Select specific fields to fetch from the AiChatHistory
915
+ */
916
+ select?: Prisma.AiChatHistorySelect<ExtArgs> | null;
917
+ /**
918
+ * Omit specific fields from the AiChatHistory
919
+ */
920
+ omit?: Prisma.AiChatHistoryOmit<ExtArgs> | null;
921
+ /**
922
+ * Choose, which related nodes to fetch as well
923
+ */
924
+ include?: Prisma.AiChatHistoryInclude<ExtArgs> | null;
925
+ /**
926
+ * Filter, which AiChatHistory to fetch.
927
+ */
928
+ where: Prisma.AiChatHistoryWhereUniqueInput;
929
+ };
930
+ /**
931
+ * AiChatHistory findFirst
932
+ */
933
+ export type AiChatHistoryFindFirstArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
934
+ /**
935
+ * Select specific fields to fetch from the AiChatHistory
936
+ */
937
+ select?: Prisma.AiChatHistorySelect<ExtArgs> | null;
938
+ /**
939
+ * Omit specific fields from the AiChatHistory
940
+ */
941
+ omit?: Prisma.AiChatHistoryOmit<ExtArgs> | null;
942
+ /**
943
+ * Choose, which related nodes to fetch as well
944
+ */
945
+ include?: Prisma.AiChatHistoryInclude<ExtArgs> | null;
946
+ /**
947
+ * Filter, which AiChatHistory to fetch.
948
+ */
949
+ where?: Prisma.AiChatHistoryWhereInput;
950
+ /**
951
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
952
+ *
953
+ * Determine the order of AiChatHistories to fetch.
954
+ */
955
+ orderBy?: Prisma.AiChatHistoryOrderByWithRelationInput | Prisma.AiChatHistoryOrderByWithRelationInput[];
956
+ /**
957
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
958
+ *
959
+ * Sets the position for searching for AiChatHistories.
960
+ */
961
+ cursor?: Prisma.AiChatHistoryWhereUniqueInput;
962
+ /**
963
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
964
+ *
965
+ * Take `±n` AiChatHistories from the position of the cursor.
966
+ */
967
+ take?: number;
968
+ /**
969
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
970
+ *
971
+ * Skip the first `n` AiChatHistories.
972
+ */
973
+ skip?: number;
974
+ /**
975
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
976
+ *
977
+ * Filter by unique combinations of AiChatHistories.
978
+ */
979
+ distinct?: Prisma.AiChatHistoryScalarFieldEnum | Prisma.AiChatHistoryScalarFieldEnum[];
980
+ };
981
+ /**
982
+ * AiChatHistory findFirstOrThrow
983
+ */
984
+ export type AiChatHistoryFindFirstOrThrowArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
985
+ /**
986
+ * Select specific fields to fetch from the AiChatHistory
987
+ */
988
+ select?: Prisma.AiChatHistorySelect<ExtArgs> | null;
989
+ /**
990
+ * Omit specific fields from the AiChatHistory
991
+ */
992
+ omit?: Prisma.AiChatHistoryOmit<ExtArgs> | null;
993
+ /**
994
+ * Choose, which related nodes to fetch as well
995
+ */
996
+ include?: Prisma.AiChatHistoryInclude<ExtArgs> | null;
997
+ /**
998
+ * Filter, which AiChatHistory to fetch.
999
+ */
1000
+ where?: Prisma.AiChatHistoryWhereInput;
1001
+ /**
1002
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
1003
+ *
1004
+ * Determine the order of AiChatHistories to fetch.
1005
+ */
1006
+ orderBy?: Prisma.AiChatHistoryOrderByWithRelationInput | Prisma.AiChatHistoryOrderByWithRelationInput[];
1007
+ /**
1008
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
1009
+ *
1010
+ * Sets the position for searching for AiChatHistories.
1011
+ */
1012
+ cursor?: Prisma.AiChatHistoryWhereUniqueInput;
1013
+ /**
1014
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
1015
+ *
1016
+ * Take `±n` AiChatHistories from the position of the cursor.
1017
+ */
1018
+ take?: number;
1019
+ /**
1020
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
1021
+ *
1022
+ * Skip the first `n` AiChatHistories.
1023
+ */
1024
+ skip?: number;
1025
+ /**
1026
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
1027
+ *
1028
+ * Filter by unique combinations of AiChatHistories.
1029
+ */
1030
+ distinct?: Prisma.AiChatHistoryScalarFieldEnum | Prisma.AiChatHistoryScalarFieldEnum[];
1031
+ };
1032
+ /**
1033
+ * AiChatHistory findMany
1034
+ */
1035
+ export type AiChatHistoryFindManyArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1036
+ /**
1037
+ * Select specific fields to fetch from the AiChatHistory
1038
+ */
1039
+ select?: Prisma.AiChatHistorySelect<ExtArgs> | null;
1040
+ /**
1041
+ * Omit specific fields from the AiChatHistory
1042
+ */
1043
+ omit?: Prisma.AiChatHistoryOmit<ExtArgs> | null;
1044
+ /**
1045
+ * Choose, which related nodes to fetch as well
1046
+ */
1047
+ include?: Prisma.AiChatHistoryInclude<ExtArgs> | null;
1048
+ /**
1049
+ * Filter, which AiChatHistories to fetch.
1050
+ */
1051
+ where?: Prisma.AiChatHistoryWhereInput;
1052
+ /**
1053
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
1054
+ *
1055
+ * Determine the order of AiChatHistories to fetch.
1056
+ */
1057
+ orderBy?: Prisma.AiChatHistoryOrderByWithRelationInput | Prisma.AiChatHistoryOrderByWithRelationInput[];
1058
+ /**
1059
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
1060
+ *
1061
+ * Sets the position for listing AiChatHistories.
1062
+ */
1063
+ cursor?: Prisma.AiChatHistoryWhereUniqueInput;
1064
+ /**
1065
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
1066
+ *
1067
+ * Take `±n` AiChatHistories from the position of the cursor.
1068
+ */
1069
+ take?: number;
1070
+ /**
1071
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
1072
+ *
1073
+ * Skip the first `n` AiChatHistories.
1074
+ */
1075
+ skip?: number;
1076
+ /**
1077
+ * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
1078
+ *
1079
+ * Filter by unique combinations of AiChatHistories.
1080
+ */
1081
+ distinct?: Prisma.AiChatHistoryScalarFieldEnum | Prisma.AiChatHistoryScalarFieldEnum[];
1082
+ };
1083
+ /**
1084
+ * AiChatHistory create
1085
+ */
1086
+ export type AiChatHistoryCreateArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1087
+ /**
1088
+ * Select specific fields to fetch from the AiChatHistory
1089
+ */
1090
+ select?: Prisma.AiChatHistorySelect<ExtArgs> | null;
1091
+ /**
1092
+ * Omit specific fields from the AiChatHistory
1093
+ */
1094
+ omit?: Prisma.AiChatHistoryOmit<ExtArgs> | null;
1095
+ /**
1096
+ * Choose, which related nodes to fetch as well
1097
+ */
1098
+ include?: Prisma.AiChatHistoryInclude<ExtArgs> | null;
1099
+ /**
1100
+ * The data needed to create a AiChatHistory.
1101
+ */
1102
+ data: Prisma.XOR<Prisma.AiChatHistoryCreateInput, Prisma.AiChatHistoryUncheckedCreateInput>;
1103
+ };
1104
+ /**
1105
+ * AiChatHistory createMany
1106
+ */
1107
+ export type AiChatHistoryCreateManyArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1108
+ /**
1109
+ * The data used to create many AiChatHistories.
1110
+ */
1111
+ data: Prisma.AiChatHistoryCreateManyInput | Prisma.AiChatHistoryCreateManyInput[];
1112
+ };
1113
+ /**
1114
+ * AiChatHistory update
1115
+ */
1116
+ export type AiChatHistoryUpdateArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1117
+ /**
1118
+ * Select specific fields to fetch from the AiChatHistory
1119
+ */
1120
+ select?: Prisma.AiChatHistorySelect<ExtArgs> | null;
1121
+ /**
1122
+ * Omit specific fields from the AiChatHistory
1123
+ */
1124
+ omit?: Prisma.AiChatHistoryOmit<ExtArgs> | null;
1125
+ /**
1126
+ * Choose, which related nodes to fetch as well
1127
+ */
1128
+ include?: Prisma.AiChatHistoryInclude<ExtArgs> | null;
1129
+ /**
1130
+ * The data needed to update a AiChatHistory.
1131
+ */
1132
+ data: Prisma.XOR<Prisma.AiChatHistoryUpdateInput, Prisma.AiChatHistoryUncheckedUpdateInput>;
1133
+ /**
1134
+ * Choose, which AiChatHistory to update.
1135
+ */
1136
+ where: Prisma.AiChatHistoryWhereUniqueInput;
1137
+ };
1138
+ /**
1139
+ * AiChatHistory updateMany
1140
+ */
1141
+ export type AiChatHistoryUpdateManyArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1142
+ /**
1143
+ * The data used to update AiChatHistories.
1144
+ */
1145
+ data: Prisma.XOR<Prisma.AiChatHistoryUpdateManyMutationInput, Prisma.AiChatHistoryUncheckedUpdateManyInput>;
1146
+ /**
1147
+ * Filter which AiChatHistories to update
1148
+ */
1149
+ where?: Prisma.AiChatHistoryWhereInput;
1150
+ /**
1151
+ * Limit how many AiChatHistories to update.
1152
+ */
1153
+ limit?: number;
1154
+ };
1155
+ /**
1156
+ * AiChatHistory upsert
1157
+ */
1158
+ export type AiChatHistoryUpsertArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1159
+ /**
1160
+ * Select specific fields to fetch from the AiChatHistory
1161
+ */
1162
+ select?: Prisma.AiChatHistorySelect<ExtArgs> | null;
1163
+ /**
1164
+ * Omit specific fields from the AiChatHistory
1165
+ */
1166
+ omit?: Prisma.AiChatHistoryOmit<ExtArgs> | null;
1167
+ /**
1168
+ * Choose, which related nodes to fetch as well
1169
+ */
1170
+ include?: Prisma.AiChatHistoryInclude<ExtArgs> | null;
1171
+ /**
1172
+ * The filter to search for the AiChatHistory to update in case it exists.
1173
+ */
1174
+ where: Prisma.AiChatHistoryWhereUniqueInput;
1175
+ /**
1176
+ * In case the AiChatHistory found by the `where` argument doesn't exist, create a new AiChatHistory with this data.
1177
+ */
1178
+ create: Prisma.XOR<Prisma.AiChatHistoryCreateInput, Prisma.AiChatHistoryUncheckedCreateInput>;
1179
+ /**
1180
+ * In case the AiChatHistory was found with the provided `where` argument, update it with this data.
1181
+ */
1182
+ update: Prisma.XOR<Prisma.AiChatHistoryUpdateInput, Prisma.AiChatHistoryUncheckedUpdateInput>;
1183
+ };
1184
+ /**
1185
+ * AiChatHistory delete
1186
+ */
1187
+ export type AiChatHistoryDeleteArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1188
+ /**
1189
+ * Select specific fields to fetch from the AiChatHistory
1190
+ */
1191
+ select?: Prisma.AiChatHistorySelect<ExtArgs> | null;
1192
+ /**
1193
+ * Omit specific fields from the AiChatHistory
1194
+ */
1195
+ omit?: Prisma.AiChatHistoryOmit<ExtArgs> | null;
1196
+ /**
1197
+ * Choose, which related nodes to fetch as well
1198
+ */
1199
+ include?: Prisma.AiChatHistoryInclude<ExtArgs> | null;
1200
+ /**
1201
+ * Filter which AiChatHistory to delete.
1202
+ */
1203
+ where: Prisma.AiChatHistoryWhereUniqueInput;
1204
+ };
1205
+ /**
1206
+ * AiChatHistory deleteMany
1207
+ */
1208
+ export type AiChatHistoryDeleteManyArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1209
+ /**
1210
+ * Filter which AiChatHistories to delete
1211
+ */
1212
+ where?: Prisma.AiChatHistoryWhereInput;
1213
+ /**
1214
+ * Limit how many AiChatHistories to delete.
1215
+ */
1216
+ limit?: number;
1217
+ };
1218
+ /**
1219
+ * AiChatHistory.messages
1220
+ */
1221
+ export type AiChatHistory$messagesArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1222
+ /**
1223
+ * Select specific fields to fetch from the AiMessage
1224
+ */
1225
+ select?: Prisma.AiMessageSelect<ExtArgs> | null;
1226
+ /**
1227
+ * Omit specific fields from the AiMessage
1228
+ */
1229
+ omit?: Prisma.AiMessageOmit<ExtArgs> | null;
1230
+ /**
1231
+ * Choose, which related nodes to fetch as well
1232
+ */
1233
+ include?: Prisma.AiMessageInclude<ExtArgs> | null;
1234
+ where?: Prisma.AiMessageWhereInput;
1235
+ orderBy?: Prisma.AiMessageOrderByWithRelationInput | Prisma.AiMessageOrderByWithRelationInput[];
1236
+ cursor?: Prisma.AiMessageWhereUniqueInput;
1237
+ take?: number;
1238
+ skip?: number;
1239
+ distinct?: Prisma.AiMessageScalarFieldEnum | Prisma.AiMessageScalarFieldEnum[];
1240
+ };
1241
+ /**
1242
+ * AiChatHistory without action
1243
+ */
1244
+ export type AiChatHistoryDefaultArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
1245
+ /**
1246
+ * Select specific fields to fetch from the AiChatHistory
1247
+ */
1248
+ select?: Prisma.AiChatHistorySelect<ExtArgs> | null;
1249
+ /**
1250
+ * Omit specific fields from the AiChatHistory
1251
+ */
1252
+ omit?: Prisma.AiChatHistoryOmit<ExtArgs> | null;
1253
+ /**
1254
+ * Choose, which related nodes to fetch as well
1255
+ */
1256
+ include?: Prisma.AiChatHistoryInclude<ExtArgs> | null;
1257
+ };