@lumavox/client 0.0.0-stage → 0.2.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.
- package/LICENSE +21 -0
- package/README.md +122 -2
- package/dist/audio.d.ts +38 -0
- package/dist/audio.js +1 -0
- package/dist/client.d.ts +121 -0
- package/dist/client.js +132 -0
- package/dist/conversation.d.ts +325 -0
- package/dist/conversation.js +765 -0
- package/dist/errors.d.ts +94 -0
- package/dist/errors.js +148 -0
- package/dist/events.d.ts +229 -0
- package/dist/events.js +1 -0
- package/dist/gen/index.d.ts +1 -0
- package/dist/gen/index.js +2 -0
- package/dist/gen/types.gen.d.ts +719 -0
- package/dist/gen/types.gen.js +2 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +15 -0
- package/dist/pcm.d.ts +38 -0
- package/dist/pcm.js +110 -0
- package/dist/protocol.gen.d.ts +44 -0
- package/dist/protocol.gen.js +46 -0
- package/dist/socket.d.ts +167 -0
- package/dist/socket.js +185 -0
- package/dist/token.d.ts +39 -0
- package/dist/token.js +63 -0
- package/dist/transport.d.ts +83 -0
- package/dist/transport.js +236 -0
- package/package.json +39 -4
|
@@ -0,0 +1,719 @@
|
|
|
1
|
+
export type ClientOptions = {
|
|
2
|
+
baseUrl: `${string}://${string}` | (string & {});
|
|
3
|
+
};
|
|
4
|
+
export type ErrorResponse = {
|
|
5
|
+
error: ErrorInfo;
|
|
6
|
+
};
|
|
7
|
+
export type ErrorInfo = {
|
|
8
|
+
code: ErrorCode;
|
|
9
|
+
/**
|
|
10
|
+
* What went wrong, in words
|
|
11
|
+
*/
|
|
12
|
+
message: string;
|
|
13
|
+
/**
|
|
14
|
+
* Echo of `X-Request-Id` — include it when reporting a problem
|
|
15
|
+
*/
|
|
16
|
+
request_id: string;
|
|
17
|
+
/**
|
|
18
|
+
* Where the request failed validation; empty otherwise
|
|
19
|
+
*/
|
|
20
|
+
issues: Array<ValidationIssue>;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* What went wrong, for a client to switch on: one per HTTP status, except `waitlisted`, a 403 of its own. New codes may be added.
|
|
24
|
+
*/
|
|
25
|
+
export type ErrorCode = 'invalid_request' | 'unauthenticated' | 'insufficient_credits' | 'forbidden' | 'waitlisted' | 'not_found' | 'method_not_allowed' | 'conflict' | 'too_large' | 'validation_failed' | 'rate_limited' | 'internal' | 'provider_failed' | 'unavailable';
|
|
26
|
+
export type ValidationIssue = {
|
|
27
|
+
location: 'body' | 'query' | 'path' | 'header';
|
|
28
|
+
/**
|
|
29
|
+
* The dotted path to the field (`voice_config.sample_rate`, `agent_ids.2`); `null` for the whole body.
|
|
30
|
+
*/
|
|
31
|
+
field: string | null;
|
|
32
|
+
message: string;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* A conversation, and a page of it. `messages` is the conversation so far, oldest first.
|
|
36
|
+
*
|
|
37
|
+
* **The most recent 50 by default**, not the whole transcript — a long conversation is not something a caller can be handed in one response. `messages.next_cursor` reaches the older ones: pass it as `cursor` on `GET /v1/agent/sessions/{session_id}`, whose `limit` raises or lowers the page, up to 200. It is null once the page reaches the beginning of the conversation.
|
|
38
|
+
*
|
|
39
|
+
* **`messages` is empty on a new conversation, including for an agent that has an opening line**. The opening line — generated or scripted — is the first turn on `/v1/agent/stream`, so it is written when a client connects rather than when the session is created. Opening a session makes no model call and no speech call of any kind.
|
|
40
|
+
*/
|
|
41
|
+
export type SessionDetail = {
|
|
42
|
+
agent_id: string;
|
|
43
|
+
created_at: string;
|
|
44
|
+
/**
|
|
45
|
+
* Who this conversation is with. Send it again to open another conversation with the same person, carrying their memory.
|
|
46
|
+
*/
|
|
47
|
+
end_user_id: string;
|
|
48
|
+
id: string;
|
|
49
|
+
title: string | null;
|
|
50
|
+
turn_seq: number;
|
|
51
|
+
updated_at: string;
|
|
52
|
+
messages: MessagePage;
|
|
53
|
+
/**
|
|
54
|
+
* How this agent stands with this person, as the conversation opens.
|
|
55
|
+
*
|
|
56
|
+
* **Null when the agent has `relation_enabled` off**, which is not the same as "they have no history": the counters run for every pair regardless, and returning one for an agent that keeps none would show a relationship the model is not being told about.
|
|
57
|
+
*
|
|
58
|
+
* It belongs to the **person**, not the conversation, so it carries across every session with the same `end_user_id`. Here so that rendering it at conversation start needs no second call; `GET /v1/agent/relations` is still how you read it any other time, and the socket's `relation` event is how you learn it moved mid-turn — which is rare, and is the only time it changes.
|
|
59
|
+
*/
|
|
60
|
+
relation: RelationInfo | null;
|
|
61
|
+
/**
|
|
62
|
+
* True when this is a conversation that already existed rather than a new one — see `resume` on the request.
|
|
63
|
+
*
|
|
64
|
+
* Worth branching on: a resumed session arrives with its `messages` already populated and its `turn_seq` past zero, so a client that assumed an empty transcript will render nothing until the next turn.
|
|
65
|
+
*/
|
|
66
|
+
resumed: boolean;
|
|
67
|
+
};
|
|
68
|
+
export type MessagePage = {
|
|
69
|
+
data: Array<MessageInfo>;
|
|
70
|
+
/**
|
|
71
|
+
* Pass as `cursor` for the next page; `null` when this is the last.
|
|
72
|
+
*/
|
|
73
|
+
next_cursor: string | null;
|
|
74
|
+
};
|
|
75
|
+
export type MessageInfo = {
|
|
76
|
+
content: string;
|
|
77
|
+
created_at: string;
|
|
78
|
+
id: string;
|
|
79
|
+
/**
|
|
80
|
+
* On a reply: what the agent looked up in its knowledge for it — each lookup's query, outcome and the entries it found, with their scores. Null when nothing was looked up.
|
|
81
|
+
*/
|
|
82
|
+
knowledge: MessageKnowledge | null;
|
|
83
|
+
/**
|
|
84
|
+
* How the agent said it felt when it wrote this reply, when the agent reports moods. Null on user messages, on agents with emotion off, and on any reply where the model did not report a usable one.
|
|
85
|
+
*/
|
|
86
|
+
mood: string | null;
|
|
87
|
+
/**
|
|
88
|
+
* How strongly, 0 to 1. Null when the model gave a label without a number — the label is the half it gets right.
|
|
89
|
+
*/
|
|
90
|
+
mood_intensity: number | null;
|
|
91
|
+
role: 'user' | 'assistant';
|
|
92
|
+
};
|
|
93
|
+
export type MessageKnowledge = {
|
|
94
|
+
lookups: Array<KnowledgeLookupInfo>;
|
|
95
|
+
/**
|
|
96
|
+
* How the agent read its knowledge on this turn: `lookup` or `prompt`.
|
|
97
|
+
*/
|
|
98
|
+
mode: 'lookup' | 'prompt';
|
|
99
|
+
};
|
|
100
|
+
export type KnowledgeLookupInfo = {
|
|
101
|
+
hits: Array<KnowledgeCitation>;
|
|
102
|
+
/**
|
|
103
|
+
* `found`, `none` (nothing relevant enough), or `failed` (the lookup itself could not be done).
|
|
104
|
+
*/
|
|
105
|
+
outcome: 'found' | 'none' | 'failed';
|
|
106
|
+
query: string;
|
|
107
|
+
/**
|
|
108
|
+
* `first` — looked up before the reply; `tool` — the model asked for it.
|
|
109
|
+
*/
|
|
110
|
+
via: 'first' | 'tool';
|
|
111
|
+
};
|
|
112
|
+
export type KnowledgeCitation = {
|
|
113
|
+
entry_id: string;
|
|
114
|
+
score: number;
|
|
115
|
+
title: string;
|
|
116
|
+
};
|
|
117
|
+
export type RelationInfo = {
|
|
118
|
+
agent_id: string;
|
|
119
|
+
/**
|
|
120
|
+
* The agent's name, so a list of these is readable without resolving ids.
|
|
121
|
+
*/
|
|
122
|
+
agent_name: string | null;
|
|
123
|
+
/**
|
|
124
|
+
* Separate sessions, ever. A stronger signal of familiarity than `turns` — twenty short visits is a longer acquaintance than one long conversation.
|
|
125
|
+
*/
|
|
126
|
+
conversations: number;
|
|
127
|
+
/**
|
|
128
|
+
* How much the agent has told **them** about itself, -1 to 1 — the asymmetric half of knowing each other, and the one nothing can count.
|
|
129
|
+
*
|
|
130
|
+
* Deliberately not part of `tier`: an agent can have opened up to somebody it has come to dislike, and folding this into affection would make that state unrepresentable.
|
|
131
|
+
*/
|
|
132
|
+
disclosure: number;
|
|
133
|
+
/**
|
|
134
|
+
* The person, as `eu_...`.
|
|
135
|
+
*/
|
|
136
|
+
end_user_id: string;
|
|
137
|
+
first_met_at: string | null;
|
|
138
|
+
last_seen_at: string | null;
|
|
139
|
+
/**
|
|
140
|
+
* One line the model wrote about them. **Replaced, not appended** — it is rendered into every future prompt for this pair, so it is bounded by design.
|
|
141
|
+
*/
|
|
142
|
+
note: string | null;
|
|
143
|
+
/**
|
|
144
|
+
* How many times the model has recorded a change. Zero on a long history means the tool is not being called, which is the first thing to check when a relationship is not moving.
|
|
145
|
+
*/
|
|
146
|
+
recorded: number;
|
|
147
|
+
/**
|
|
148
|
+
* The relationship as the model is told it — bands and counted phrases, never numbers. **Empty string** when there is nothing worth saying yet, in which case nothing about them is added to the prompt at all — which is a real state and not a missing value.
|
|
149
|
+
*/
|
|
150
|
+
summary: string;
|
|
151
|
+
/**
|
|
152
|
+
* What the agent would call this relationship, and what it is actually told: **Despised, Disliked, Acquaintances, Friends** or **Good Friends**.
|
|
153
|
+
*
|
|
154
|
+
* Derived on every read from the axes below and never stored, so it cannot go stale. The rule is one sentence: *warmth and trust set the direction, familiarity sets how far it can go* — a first conversation caps at Acquaintances however well it went, and the ceiling rises as they talk. Dislike is not capped: an agent can take against somebody on one remark.
|
|
155
|
+
*/
|
|
156
|
+
tier: 'Despised' | 'Disliked' | 'Acquaintances' | 'Friends' | 'Good Friends';
|
|
157
|
+
/**
|
|
158
|
+
* -1 to 1, on the same scale.
|
|
159
|
+
*/
|
|
160
|
+
trust: number;
|
|
161
|
+
/**
|
|
162
|
+
* Turns exchanged, ever. Counted, not judged.
|
|
163
|
+
*/
|
|
164
|
+
turns: number;
|
|
165
|
+
/**
|
|
166
|
+
* -1 to 1. Zero is indifference, which is where every relationship starts.
|
|
167
|
+
*/
|
|
168
|
+
warmth: number;
|
|
169
|
+
};
|
|
170
|
+
export type SessionCreateRequest = {
|
|
171
|
+
/**
|
|
172
|
+
* Which agent this conversation is with.
|
|
173
|
+
*/
|
|
174
|
+
agent_id: string;
|
|
175
|
+
/**
|
|
176
|
+
* Optional, and only ever the key's own end user — their id from `POST /v1/end-users`, or your own id for them.
|
|
177
|
+
*
|
|
178
|
+
* **A conversation is always the person the ephemeral key was minted for**: the key says who is talking, so this can only confirm it, and naming anybody else is a **403**. What the agent remembers about them — durable facts and the standing relationship — is theirs, and carries into every conversation with any of your agents.
|
|
179
|
+
*
|
|
180
|
+
* Set once, when the session opens. It cannot change afterwards.
|
|
181
|
+
*/
|
|
182
|
+
end_user_id?: string | null;
|
|
183
|
+
/**
|
|
184
|
+
* Whether to continue this person's most recent conversation with this agent instead of starting a new one.
|
|
185
|
+
*
|
|
186
|
+
* **Unset is the useful default**: it resumes when this person has a conversation with this agent from the last 7 days to continue, and starts a new one otherwise. That matches what 'open a conversation with this person' usually means, and it stops an integration that opens a session per page load from scattering somebody's history across a dozen fragments.
|
|
187
|
+
*
|
|
188
|
+
* `false` always starts a new conversation — this is what a 'new chat' button should send. `true` is the same as leaving it unset; it exists so the intent can be stated rather than implied.
|
|
189
|
+
*
|
|
190
|
+
* Nothing is lost by starting fresh: durable facts and the standing relationship belong to the *person*, not the conversation, and are carried into every new one.
|
|
191
|
+
*
|
|
192
|
+
* The response's `resumed` says which happened.
|
|
193
|
+
*/
|
|
194
|
+
resume?: boolean | null;
|
|
195
|
+
/**
|
|
196
|
+
* Optional label.
|
|
197
|
+
*/
|
|
198
|
+
title?: string | null;
|
|
199
|
+
};
|
|
200
|
+
export type SessionPage = {
|
|
201
|
+
data: Array<SessionInfo>;
|
|
202
|
+
/**
|
|
203
|
+
* Pass as `cursor` for the next page; `null` when this is the last.
|
|
204
|
+
*/
|
|
205
|
+
next_cursor: string | null;
|
|
206
|
+
};
|
|
207
|
+
export type SessionInfo = {
|
|
208
|
+
agent_id: string;
|
|
209
|
+
created_at: string;
|
|
210
|
+
/**
|
|
211
|
+
* Who this conversation is with. Send it again to open another conversation with the same person, carrying their memory.
|
|
212
|
+
*/
|
|
213
|
+
end_user_id: string;
|
|
214
|
+
id: string;
|
|
215
|
+
title: string | null;
|
|
216
|
+
turn_seq: number;
|
|
217
|
+
updated_at: string;
|
|
218
|
+
};
|
|
219
|
+
export type CompactionInfo = {
|
|
220
|
+
/**
|
|
221
|
+
* The last message this summary covers. Anything after it is still sent to the model verbatim.
|
|
222
|
+
*/
|
|
223
|
+
after_seq: number;
|
|
224
|
+
/**
|
|
225
|
+
* Durable facts written to long-term memory by this call. Zero when extraction was not asked for, or when there was nothing worth keeping.
|
|
226
|
+
*/
|
|
227
|
+
facts_stored: number;
|
|
228
|
+
input_tokens: number | null;
|
|
229
|
+
/**
|
|
230
|
+
* What produced the summary.
|
|
231
|
+
*/
|
|
232
|
+
model: string | null;
|
|
233
|
+
output_tokens: number | null;
|
|
234
|
+
session_id: string;
|
|
235
|
+
/**
|
|
236
|
+
* What the next turn will start from.
|
|
237
|
+
*/
|
|
238
|
+
summary: string;
|
|
239
|
+
/**
|
|
240
|
+
* `manual` (a client asked), `automatic` (a turn reached the agent's threshold) or `idle` (the conversation went quiet and its facts were extracted).
|
|
241
|
+
*/
|
|
242
|
+
trigger: 'manual' | 'automatic' | 'idle';
|
|
243
|
+
};
|
|
244
|
+
export type CompactRequest = {
|
|
245
|
+
/**
|
|
246
|
+
* Whether to also extract durable facts about the end user, in the same model call.
|
|
247
|
+
*
|
|
248
|
+
* Unset uses the agent's own setting.
|
|
249
|
+
*/
|
|
250
|
+
extract_facts?: boolean | null;
|
|
251
|
+
};
|
|
252
|
+
export type FactPage = {
|
|
253
|
+
data: Array<FactInfo>;
|
|
254
|
+
/**
|
|
255
|
+
* Pass as `cursor` for the next page; `null` when this is the last.
|
|
256
|
+
*/
|
|
257
|
+
next_cursor: string | null;
|
|
258
|
+
};
|
|
259
|
+
export type FactInfo = {
|
|
260
|
+
/**
|
|
261
|
+
* Which agent was being talked to when this was learned.
|
|
262
|
+
*/
|
|
263
|
+
agent_id: string | null;
|
|
264
|
+
created_at: string;
|
|
265
|
+
id: string;
|
|
266
|
+
text: string;
|
|
267
|
+
/**
|
|
268
|
+
* A fact is never edited, only learned or forgotten: the same as `created_at`.
|
|
269
|
+
*/
|
|
270
|
+
updated_at: string;
|
|
271
|
+
};
|
|
272
|
+
export type FactsDeleted = {
|
|
273
|
+
/**
|
|
274
|
+
* How many stored facts were deleted.
|
|
275
|
+
*/
|
|
276
|
+
facts_deleted: number;
|
|
277
|
+
};
|
|
278
|
+
export type RelationPage = {
|
|
279
|
+
data: Array<RelationInfo>;
|
|
280
|
+
/**
|
|
281
|
+
* Pass as `cursor` for the next page; `null` when this is the last.
|
|
282
|
+
*/
|
|
283
|
+
next_cursor: string | null;
|
|
284
|
+
};
|
|
285
|
+
export type ListSessionsData = {
|
|
286
|
+
body?: never;
|
|
287
|
+
path?: never;
|
|
288
|
+
query?: {
|
|
289
|
+
/**
|
|
290
|
+
* How many to answer, 1 to 200.
|
|
291
|
+
*/
|
|
292
|
+
limit?: number;
|
|
293
|
+
/**
|
|
294
|
+
* The `next_cursor` of the page before.
|
|
295
|
+
*/
|
|
296
|
+
cursor?: string;
|
|
297
|
+
};
|
|
298
|
+
url: '/v1/agent/sessions';
|
|
299
|
+
};
|
|
300
|
+
export type ListSessionsErrors = {
|
|
301
|
+
/**
|
|
302
|
+
* Missing or invalid credentials
|
|
303
|
+
*/
|
|
304
|
+
401: ErrorResponse;
|
|
305
|
+
/**
|
|
306
|
+
* The key is valid but its scopes do not cover this capability
|
|
307
|
+
*/
|
|
308
|
+
403: ErrorResponse;
|
|
309
|
+
/**
|
|
310
|
+
* The request failed validation
|
|
311
|
+
*/
|
|
312
|
+
422: ErrorResponse;
|
|
313
|
+
/**
|
|
314
|
+
* Rate limit exceeded
|
|
315
|
+
*/
|
|
316
|
+
429: ErrorResponse;
|
|
317
|
+
};
|
|
318
|
+
export type ListSessionsError = ListSessionsErrors[keyof ListSessionsErrors];
|
|
319
|
+
export type ListSessionsResponses = {
|
|
320
|
+
/**
|
|
321
|
+
* One page of conversations, most recent first
|
|
322
|
+
*/
|
|
323
|
+
200: SessionPage;
|
|
324
|
+
};
|
|
325
|
+
export type ListSessionsResponse = ListSessionsResponses[keyof ListSessionsResponses];
|
|
326
|
+
export type CreateSessionData = {
|
|
327
|
+
body: SessionCreateRequest;
|
|
328
|
+
path?: never;
|
|
329
|
+
query?: never;
|
|
330
|
+
url: '/v1/agent/sessions';
|
|
331
|
+
};
|
|
332
|
+
export type CreateSessionErrors = {
|
|
333
|
+
/**
|
|
334
|
+
* The request could not be read: malformed JSON
|
|
335
|
+
*/
|
|
336
|
+
400: ErrorResponse;
|
|
337
|
+
/**
|
|
338
|
+
* Missing or invalid credentials
|
|
339
|
+
*/
|
|
340
|
+
401: ErrorResponse;
|
|
341
|
+
/**
|
|
342
|
+
* The key's scopes do not cover agents, or it is for another agent or person
|
|
343
|
+
*/
|
|
344
|
+
403: ErrorResponse;
|
|
345
|
+
/**
|
|
346
|
+
* Unknown agent id
|
|
347
|
+
*/
|
|
348
|
+
404: ErrorResponse;
|
|
349
|
+
/**
|
|
350
|
+
* The request failed validation
|
|
351
|
+
*/
|
|
352
|
+
422: ErrorResponse;
|
|
353
|
+
/**
|
|
354
|
+
* Rate limit exceeded
|
|
355
|
+
*/
|
|
356
|
+
429: ErrorResponse;
|
|
357
|
+
};
|
|
358
|
+
export type CreateSessionError = CreateSessionErrors[keyof CreateSessionErrors];
|
|
359
|
+
export type CreateSessionResponses = {
|
|
360
|
+
/**
|
|
361
|
+
* The conversation — new or continued, per `resumed`
|
|
362
|
+
*/
|
|
363
|
+
201: SessionDetail;
|
|
364
|
+
};
|
|
365
|
+
export type CreateSessionResponse = CreateSessionResponses[keyof CreateSessionResponses];
|
|
366
|
+
export type DeleteSessionData = {
|
|
367
|
+
body?: never;
|
|
368
|
+
path: {
|
|
369
|
+
session_id: string;
|
|
370
|
+
};
|
|
371
|
+
query?: never;
|
|
372
|
+
url: '/v1/agent/sessions/{session_id}';
|
|
373
|
+
};
|
|
374
|
+
export type DeleteSessionErrors = {
|
|
375
|
+
/**
|
|
376
|
+
* Missing or invalid credentials
|
|
377
|
+
*/
|
|
378
|
+
401: ErrorResponse;
|
|
379
|
+
/**
|
|
380
|
+
* The key is valid but its scopes do not cover this capability
|
|
381
|
+
*/
|
|
382
|
+
403: ErrorResponse;
|
|
383
|
+
/**
|
|
384
|
+
* Unknown session id
|
|
385
|
+
*/
|
|
386
|
+
404: ErrorResponse;
|
|
387
|
+
/**
|
|
388
|
+
* The request failed validation
|
|
389
|
+
*/
|
|
390
|
+
422: ErrorResponse;
|
|
391
|
+
/**
|
|
392
|
+
* Rate limit exceeded
|
|
393
|
+
*/
|
|
394
|
+
429: ErrorResponse;
|
|
395
|
+
};
|
|
396
|
+
export type DeleteSessionError = DeleteSessionErrors[keyof DeleteSessionErrors];
|
|
397
|
+
export type DeleteSessionResponses = {
|
|
398
|
+
/**
|
|
399
|
+
* The session and its messages are gone
|
|
400
|
+
*/
|
|
401
|
+
204: void;
|
|
402
|
+
};
|
|
403
|
+
export type DeleteSessionResponse = DeleteSessionResponses[keyof DeleteSessionResponses];
|
|
404
|
+
export type GetSessionData = {
|
|
405
|
+
body?: never;
|
|
406
|
+
path: {
|
|
407
|
+
session_id: string;
|
|
408
|
+
};
|
|
409
|
+
query?: {
|
|
410
|
+
/**
|
|
411
|
+
* How many messages, counting back from the newest, 1 to 200. The page itself is oldest first.
|
|
412
|
+
*/
|
|
413
|
+
limit?: number;
|
|
414
|
+
/**
|
|
415
|
+
* `messages.next_cursor` of the page before, for the older messages.
|
|
416
|
+
*/
|
|
417
|
+
cursor?: string;
|
|
418
|
+
};
|
|
419
|
+
url: '/v1/agent/sessions/{session_id}';
|
|
420
|
+
};
|
|
421
|
+
export type GetSessionErrors = {
|
|
422
|
+
/**
|
|
423
|
+
* Missing or invalid credentials
|
|
424
|
+
*/
|
|
425
|
+
401: ErrorResponse;
|
|
426
|
+
/**
|
|
427
|
+
* The key is valid but its scopes do not cover this capability
|
|
428
|
+
*/
|
|
429
|
+
403: ErrorResponse;
|
|
430
|
+
/**
|
|
431
|
+
* Unknown session id
|
|
432
|
+
*/
|
|
433
|
+
404: ErrorResponse;
|
|
434
|
+
/**
|
|
435
|
+
* The request failed validation
|
|
436
|
+
*/
|
|
437
|
+
422: ErrorResponse;
|
|
438
|
+
/**
|
|
439
|
+
* Rate limit exceeded
|
|
440
|
+
*/
|
|
441
|
+
429: ErrorResponse;
|
|
442
|
+
};
|
|
443
|
+
export type GetSessionError = GetSessionErrors[keyof GetSessionErrors];
|
|
444
|
+
export type GetSessionResponses = {
|
|
445
|
+
/**
|
|
446
|
+
* The conversation and one page of its messages
|
|
447
|
+
*/
|
|
448
|
+
200: SessionDetail;
|
|
449
|
+
};
|
|
450
|
+
export type GetSessionResponse = GetSessionResponses[keyof GetSessionResponses];
|
|
451
|
+
export type CompactSessionData = {
|
|
452
|
+
body: CompactRequest;
|
|
453
|
+
path: {
|
|
454
|
+
session_id: string;
|
|
455
|
+
};
|
|
456
|
+
query?: never;
|
|
457
|
+
url: '/v1/agent/sessions/{session_id}/compact';
|
|
458
|
+
};
|
|
459
|
+
export type CompactSessionErrors = {
|
|
460
|
+
/**
|
|
461
|
+
* The request could not be read: malformed JSON
|
|
462
|
+
*/
|
|
463
|
+
400: ErrorResponse;
|
|
464
|
+
/**
|
|
465
|
+
* Missing or invalid credentials
|
|
466
|
+
*/
|
|
467
|
+
401: ErrorResponse;
|
|
468
|
+
/**
|
|
469
|
+
* The key is valid but its scopes do not cover this capability
|
|
470
|
+
*/
|
|
471
|
+
403: ErrorResponse;
|
|
472
|
+
/**
|
|
473
|
+
* Unknown session id
|
|
474
|
+
*/
|
|
475
|
+
404: ErrorResponse;
|
|
476
|
+
/**
|
|
477
|
+
* Another compaction of this conversation finished first
|
|
478
|
+
*/
|
|
479
|
+
409: ErrorResponse;
|
|
480
|
+
/**
|
|
481
|
+
* The request failed validation
|
|
482
|
+
*/
|
|
483
|
+
422: ErrorResponse;
|
|
484
|
+
/**
|
|
485
|
+
* Rate limit exceeded
|
|
486
|
+
*/
|
|
487
|
+
429: ErrorResponse;
|
|
488
|
+
/**
|
|
489
|
+
* The model provider failed or timed out
|
|
490
|
+
*/
|
|
491
|
+
502: ErrorResponse;
|
|
492
|
+
/**
|
|
493
|
+
* The model provider is not configured
|
|
494
|
+
*/
|
|
495
|
+
503: ErrorResponse;
|
|
496
|
+
};
|
|
497
|
+
export type CompactSessionError = CompactSessionErrors[keyof CompactSessionErrors];
|
|
498
|
+
export type CompactSessionResponses = {
|
|
499
|
+
/**
|
|
500
|
+
* The summary that replaced the turns it covers
|
|
501
|
+
*/
|
|
502
|
+
200: CompactionInfo;
|
|
503
|
+
};
|
|
504
|
+
export type CompactSessionResponse = CompactSessionResponses[keyof CompactSessionResponses];
|
|
505
|
+
export type ExtractSessionFactsData = {
|
|
506
|
+
body?: never;
|
|
507
|
+
path: {
|
|
508
|
+
session_id: string;
|
|
509
|
+
};
|
|
510
|
+
query?: never;
|
|
511
|
+
url: '/v1/agent/sessions/{session_id}/extract';
|
|
512
|
+
};
|
|
513
|
+
export type ExtractSessionFactsErrors = {
|
|
514
|
+
/**
|
|
515
|
+
* Missing or invalid credentials
|
|
516
|
+
*/
|
|
517
|
+
401: ErrorResponse;
|
|
518
|
+
/**
|
|
519
|
+
* The key is valid but its scopes do not cover this capability
|
|
520
|
+
*/
|
|
521
|
+
403: ErrorResponse;
|
|
522
|
+
/**
|
|
523
|
+
* Unknown session id
|
|
524
|
+
*/
|
|
525
|
+
404: ErrorResponse;
|
|
526
|
+
/**
|
|
527
|
+
* Another compaction of this conversation finished first
|
|
528
|
+
*/
|
|
529
|
+
409: ErrorResponse;
|
|
530
|
+
/**
|
|
531
|
+
* The request failed validation
|
|
532
|
+
*/
|
|
533
|
+
422: ErrorResponse;
|
|
534
|
+
/**
|
|
535
|
+
* Rate limit exceeded
|
|
536
|
+
*/
|
|
537
|
+
429: ErrorResponse;
|
|
538
|
+
/**
|
|
539
|
+
* The model provider failed or timed out
|
|
540
|
+
*/
|
|
541
|
+
502: ErrorResponse;
|
|
542
|
+
/**
|
|
543
|
+
* The model provider is not configured
|
|
544
|
+
*/
|
|
545
|
+
503: ErrorResponse;
|
|
546
|
+
};
|
|
547
|
+
export type ExtractSessionFactsError = ExtractSessionFactsErrors[keyof ExtractSessionFactsErrors];
|
|
548
|
+
export type ExtractSessionFactsResponses = {
|
|
549
|
+
/**
|
|
550
|
+
* The facts pulled out of the conversation and stored
|
|
551
|
+
*/
|
|
552
|
+
200: CompactionInfo;
|
|
553
|
+
};
|
|
554
|
+
export type ExtractSessionFactsResponse = ExtractSessionFactsResponses[keyof ExtractSessionFactsResponses];
|
|
555
|
+
export type DeleteAllFactsData = {
|
|
556
|
+
body?: never;
|
|
557
|
+
path?: never;
|
|
558
|
+
query?: {
|
|
559
|
+
/**
|
|
560
|
+
* Optional, and only ever the key's own end user — their `eu_...` id or your own id for them. Anybody else is a 403.
|
|
561
|
+
*/
|
|
562
|
+
end_user_id?: string;
|
|
563
|
+
};
|
|
564
|
+
url: '/v1/agent/facts';
|
|
565
|
+
};
|
|
566
|
+
export type DeleteAllFactsErrors = {
|
|
567
|
+
/**
|
|
568
|
+
* Missing or invalid credentials
|
|
569
|
+
*/
|
|
570
|
+
401: ErrorResponse;
|
|
571
|
+
/**
|
|
572
|
+
* The key is valid but its scopes do not cover this capability
|
|
573
|
+
*/
|
|
574
|
+
403: ErrorResponse;
|
|
575
|
+
/**
|
|
576
|
+
* The request failed validation
|
|
577
|
+
*/
|
|
578
|
+
422: ErrorResponse;
|
|
579
|
+
/**
|
|
580
|
+
* Rate limit exceeded
|
|
581
|
+
*/
|
|
582
|
+
429: ErrorResponse;
|
|
583
|
+
};
|
|
584
|
+
export type DeleteAllFactsError = DeleteAllFactsErrors[keyof DeleteAllFactsErrors];
|
|
585
|
+
export type DeleteAllFactsResponses = {
|
|
586
|
+
/**
|
|
587
|
+
* How many stored facts were deleted
|
|
588
|
+
*/
|
|
589
|
+
200: FactsDeleted;
|
|
590
|
+
};
|
|
591
|
+
export type DeleteAllFactsResponse = DeleteAllFactsResponses[keyof DeleteAllFactsResponses];
|
|
592
|
+
export type ListFactsData = {
|
|
593
|
+
body?: never;
|
|
594
|
+
path?: never;
|
|
595
|
+
query?: {
|
|
596
|
+
/**
|
|
597
|
+
* Optional, and only ever the key's own end user — their `eu_...` id or your own id for them. Anybody else is a 403.
|
|
598
|
+
*/
|
|
599
|
+
end_user_id?: string;
|
|
600
|
+
};
|
|
601
|
+
url: '/v1/agent/facts';
|
|
602
|
+
};
|
|
603
|
+
export type ListFactsErrors = {
|
|
604
|
+
/**
|
|
605
|
+
* Missing or invalid credentials
|
|
606
|
+
*/
|
|
607
|
+
401: ErrorResponse;
|
|
608
|
+
/**
|
|
609
|
+
* The key is valid but its scopes do not cover this capability
|
|
610
|
+
*/
|
|
611
|
+
403: ErrorResponse;
|
|
612
|
+
/**
|
|
613
|
+
* The request failed validation
|
|
614
|
+
*/
|
|
615
|
+
422: ErrorResponse;
|
|
616
|
+
/**
|
|
617
|
+
* Rate limit exceeded
|
|
618
|
+
*/
|
|
619
|
+
429: ErrorResponse;
|
|
620
|
+
};
|
|
621
|
+
export type ListFactsError = ListFactsErrors[keyof ListFactsErrors];
|
|
622
|
+
export type ListFactsResponses = {
|
|
623
|
+
/**
|
|
624
|
+
* What the platform remembers about this end user
|
|
625
|
+
*/
|
|
626
|
+
200: FactPage;
|
|
627
|
+
};
|
|
628
|
+
export type ListFactsResponse = ListFactsResponses[keyof ListFactsResponses];
|
|
629
|
+
export type DeleteFactData = {
|
|
630
|
+
body?: never;
|
|
631
|
+
path: {
|
|
632
|
+
fact_id: string;
|
|
633
|
+
};
|
|
634
|
+
query?: never;
|
|
635
|
+
url: '/v1/agent/facts/{fact_id}';
|
|
636
|
+
};
|
|
637
|
+
export type DeleteFactErrors = {
|
|
638
|
+
/**
|
|
639
|
+
* Missing or invalid credentials
|
|
640
|
+
*/
|
|
641
|
+
401: ErrorResponse;
|
|
642
|
+
/**
|
|
643
|
+
* The key is valid but its scopes do not cover this capability
|
|
644
|
+
*/
|
|
645
|
+
403: ErrorResponse;
|
|
646
|
+
/**
|
|
647
|
+
* Unknown fact id
|
|
648
|
+
*/
|
|
649
|
+
404: ErrorResponse;
|
|
650
|
+
/**
|
|
651
|
+
* The request failed validation
|
|
652
|
+
*/
|
|
653
|
+
422: ErrorResponse;
|
|
654
|
+
/**
|
|
655
|
+
* Rate limit exceeded
|
|
656
|
+
*/
|
|
657
|
+
429: ErrorResponse;
|
|
658
|
+
};
|
|
659
|
+
export type DeleteFactError = DeleteFactErrors[keyof DeleteFactErrors];
|
|
660
|
+
export type DeleteFactResponses = {
|
|
661
|
+
/**
|
|
662
|
+
* The fact is gone
|
|
663
|
+
*/
|
|
664
|
+
204: void;
|
|
665
|
+
};
|
|
666
|
+
export type DeleteFactResponse = DeleteFactResponses[keyof DeleteFactResponses];
|
|
667
|
+
export type ListRelationsData = {
|
|
668
|
+
body?: never;
|
|
669
|
+
path?: never;
|
|
670
|
+
query?: {
|
|
671
|
+
/**
|
|
672
|
+
* Only this agent's relationship.
|
|
673
|
+
*/
|
|
674
|
+
agent_id?: string;
|
|
675
|
+
/**
|
|
676
|
+
* Optional, and only ever the key's own end user — their `eu_...` id or your own id for them. Anybody else is a 403.
|
|
677
|
+
*/
|
|
678
|
+
end_user_id?: string;
|
|
679
|
+
/**
|
|
680
|
+
* How many to answer, 1 to 200.
|
|
681
|
+
*/
|
|
682
|
+
limit?: number;
|
|
683
|
+
/**
|
|
684
|
+
* The `next_cursor` of the page before.
|
|
685
|
+
*/
|
|
686
|
+
cursor?: string;
|
|
687
|
+
};
|
|
688
|
+
url: '/v1/agent/relations';
|
|
689
|
+
};
|
|
690
|
+
export type ListRelationsErrors = {
|
|
691
|
+
/**
|
|
692
|
+
* Missing or invalid credentials
|
|
693
|
+
*/
|
|
694
|
+
401: ErrorResponse;
|
|
695
|
+
/**
|
|
696
|
+
* The key is valid but its scopes do not cover this capability
|
|
697
|
+
*/
|
|
698
|
+
403: ErrorResponse;
|
|
699
|
+
/**
|
|
700
|
+
* Unknown agent id
|
|
701
|
+
*/
|
|
702
|
+
404: ErrorResponse;
|
|
703
|
+
/**
|
|
704
|
+
* The request failed validation
|
|
705
|
+
*/
|
|
706
|
+
422: ErrorResponse;
|
|
707
|
+
/**
|
|
708
|
+
* Rate limit exceeded
|
|
709
|
+
*/
|
|
710
|
+
429: ErrorResponse;
|
|
711
|
+
};
|
|
712
|
+
export type ListRelationsError = ListRelationsErrors[keyof ListRelationsErrors];
|
|
713
|
+
export type ListRelationsResponses = {
|
|
714
|
+
/**
|
|
715
|
+
* How each agent feels about the person, most recent first
|
|
716
|
+
*/
|
|
717
|
+
200: RelationPage;
|
|
718
|
+
};
|
|
719
|
+
export type ListRelationsResponse = ListRelationsResponses[keyof ListRelationsResponses];
|