You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: adminforth/documentation/docs/tutorial/09-Plugins/01-agent.md
+33-19Lines changed: 33 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -139,6 +139,17 @@ export default {
139
139
name: 'response',
140
140
type: AdminForthDataTypes.TEXT,
141
141
},
142
+
{
143
+
name: 'checkpoint_id',
144
+
type: AdminForthDataTypes.STRING,
145
+
showIn: {
146
+
list: false,
147
+
show: true,
148
+
edit: false,
149
+
create: false,
150
+
filter: false,
151
+
},
152
+
},
142
153
],
143
154
options: {
144
155
allowedActions: {
@@ -152,7 +163,7 @@ export default {
152
163
} asAdminForthResourceInput;
153
164
```
154
165
155
-
`asker_id` must store the current admin user's primary key, and `created_at` should be filled automatically because the plugin sorts sessions and turns by it. The `turns` field can stay nullable, but the plugin configuration still expects it.
166
+
`asker_id` must store the current admin user's primary key, and `created_at` should be filled automatically because the plugin sorts sessions and turns by it. The `turns` field can stay nullable, but the plugin configuration still expects it. The optional `checkpoint_id` field stores the checkpoint attached to each visible turn and enables editing or forking old messages when `checkpointResource` is configured.
156
167
157
168
Add matching tables to your schema:
158
169
@@ -166,11 +177,12 @@ model sessions {
166
177
}
167
178
168
179
model turns {
169
-
id String @id
170
-
session_id String
171
-
created_at DateTime
172
-
prompt String?
173
-
response String?
180
+
id String @id
181
+
session_id String
182
+
created_at DateTime
183
+
prompt String?
184
+
response String?
185
+
checkpoint_id String?
174
186
}
175
187
```
176
188
@@ -273,6 +285,7 @@ globalPlugins: [
273
285
responseField: 'response',
274
286
// optional
275
287
// debugField: 'debug',
288
+
checkpointIdField: 'checkpoint_id',
276
289
},
277
290
// optional, see the "Persistent checkpointer" section below
278
291
// checkpointResource: { ... },
@@ -870,9 +883,9 @@ import type { AdminForthResourceInput } from 'adminforth';
The payload fields can be stored as strings. The plugin serializes and deserializes checkpoint JSON on its own. The composite index on `(thread_id, checkpoint_ns, checkpoint_id)` is recommended because the checkpointer filters rows by these columns.
997
+
The payload fields can be stored as strings. The plugin serializes and deserializes checkpoint JSON on its own. The composite index on `(thread_id, checkpoint_namespace, checkpoint_id)` is recommended because the checkpointer filters rows by these columns.
0 commit comments