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