Repository navigation
Expand file tree
/
Copy pathtypes.ts
More file actions
177 lines (157 loc) · 4.9 KB
/
Copy pathtypes.ts
File metadata and controls
177 lines (157 loc) · 4.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
import {
type PluginsCommonOptions,
type AdminUser,
type HttpExtra,
type AudioAdapter,
type ChatSurfaceAdapter,
} from "adminforth";
import type { AgentModeCompletionAdapter } from "./application/ports.js";
interface ISessionResource {
resourceId: string;
idField: string;
titleField: string;
/**
* @deprecated Not used by the plugin — session turns are looked up via
* `turnResource.sessionIdField`. Kept optional for backward compatibility;
* will be removed in a future major version.
*/
turnsField?: string;
askerIdField: string;
createdAtField: string;
}
interface ITurnResource {
resourceId: string;
idField: string;
sessionIdField: string;
createdAtField: string;
promptField: string;
responseField: string;
debugField?: string;
checkpointIdField?: string;
/**
* Optional array column with image attachments of the user message. Enables pasting
* and attaching images in the chat. Requires UploadPlugin installed on this column
* with `allowedFileExtensions` limited to images (png, jpg, jpeg, webp).
*/
attachmentsField?: string;
}
export interface IImageAttachmentsOptions {
/**
* How many images one message can have, at most `maxViewedPerTurn`: the `view_image` tool
* loads all images of a message at once.
* Default is 5
*/
maxPerMessage?: number;
/**
* How many minutes the model sees an image after it was sent or loaded again with the
* `view_image` tool. Every shown image costs tokens on every model call.
* Default is 30
*/
visibleMinutes?: number;
/**
* How many images the model keeps seeing, the latest ones; the others become notes the
* model can load again with the `view_image` tool. A `view_image` can keep more of the images
* it loaded, up to `maxViewedPerTurn`, until the next images are sent or loaded.
* Default is 5
*/
maxVisible?: number;
/**
* How many images the model can load again with the `view_image` tool during one answer: one
* call, whole messages, the most likely first. It sees all of them for that answer and keeps the
* ones it picks for the next messages; past the limit it asks the user which images matter.
* Default is 10
*/
maxViewedPerTurn?: number;
}
interface ICheckpointResource {
resourceId: string;
idField: string;
threadIdField: string;
checkpointNamespaceField: string;
checkpointIdField: string;
parentCheckpointIdField: string;
rowKindField: string;
taskIdField: string;
sequenceField: string;
createdAtField: string;
checkpointPayloadField: string;
metadataPayloadField: string;
writesPayloadField: string;
schemaVersionField: string;
}
export interface PluginOptions extends PluginsCommonOptions {
/**
* Optional placeholder examples to preload for the chat textarea.
* They are resolved once when the chat frontend loads.
*/
placeholderMessages?: ((input: {
adminUser: AdminUser;
headers: HttpExtra["headers"];
}) => string[] | Promise<string[]>);
/**
* Modes for the plugin.
* Each mode can have its own configuration.
* Each mode uses its own completion adapter instance.
*/
modes: {
name: string;
completionAdapter: AgentModeCompletionAdapter;
}[];
/**
* Optional audio adapter for speech-to-text and text-to-speech flows.
*/
audioAdapter?: AudioAdapter;
/**
* Optional external chat surfaces, such as Telegram webhooks.
*/
chatSurfaceAdapters?: ChatSurfaceAdapter[];
/**
* Max tokens for the generation.
* Default is 1000
*/
maxTokens?: number;
/**
* Optional custom system prompt appended to the built-in agent system prompt.
*/
systemPrompt?: string;
/**
* @deprecated Not applied — reasoning effort is configured on the completion
* adapter (e.g. `extraRequestBodyParameters.reasoning.effort`), not here.
* Kept for backward compatibility; will be removed in a future major version.
*/
reasoning?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh";
/**
* Resource configuration for sessions.
*/
sessionResource: ISessionResource;
/**
* Resource configuration for turns.
*/
turnResource: ITurnResource;
/**
* Limits of the image attachments of `turnResource.attachmentsField`, whole numbers from 1.
*/
imageAttachments?: IImageAttachmentsOptions;
/**
* Makes chat sticky by default. By default this prop is false
*/
stickByDefault?: boolean;
/**
* Optional resource configuration for a persistent LangGraph checkpointer.
* Falls back to an in-memory MemorySaver when omitted.
*/
checkpointResource?: ICheckpointResource;
/**
* Optional resource configuration for resolving chat users through OAuth external identities.
*/
chatExternalIdentityResource?: {
resourceId: string;
adminUserIdField?: string;
providerField?: string;
subjectField?: string;
externalUserIdField?: string;
surfaces: Record<string, {
provider: string;
}>;
};
}