@honcho-ai/core 1.7.0 → 2.0.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/CHANGELOG.md +58 -0
- package/LICENSE +1 -1
- package/README.md +12 -1
- package/index.d.mts +2 -5
- package/index.d.ts +2 -5
- package/index.d.ts.map +1 -1
- package/index.js +0 -3
- package/index.js.map +1 -1
- package/index.mjs +0 -3
- package/index.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/index.d.ts +1 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +1 -3
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +0 -1
- package/resources/index.mjs.map +1 -1
- package/resources/workspaces/conclusions.d.ts +33 -66
- package/resources/workspaces/conclusions.d.ts.map +1 -1
- package/resources/workspaces/conclusions.js +12 -5
- package/resources/workspaces/conclusions.js.map +1 -1
- package/resources/workspaces/conclusions.mjs +12 -5
- package/resources/workspaces/conclusions.mjs.map +1 -1
- package/resources/workspaces/index.d.ts +6 -6
- package/resources/workspaces/index.d.ts.map +1 -1
- package/resources/workspaces/index.js +3 -4
- package/resources/workspaces/index.js.map +1 -1
- package/resources/workspaces/index.mjs +1 -1
- package/resources/workspaces/index.mjs.map +1 -1
- package/resources/workspaces/peers/index.d.ts +1 -1
- package/resources/workspaces/peers/index.d.ts.map +1 -1
- package/resources/workspaces/peers/peers.d.ts +82 -153
- package/resources/workspaces/peers/peers.d.ts.map +1 -1
- package/resources/workspaces/peers/peers.js +24 -20
- package/resources/workspaces/peers/peers.js.map +1 -1
- package/resources/workspaces/peers/peers.mjs +24 -20
- package/resources/workspaces/peers/peers.mjs.map +1 -1
- package/resources/workspaces/peers/sessions.d.ts +1 -1
- package/resources/workspaces/queue.d.ts +82 -0
- package/resources/workspaces/queue.d.ts.map +1 -0
- package/resources/workspaces/queue.js +16 -0
- package/resources/workspaces/queue.js.map +1 -0
- package/resources/workspaces/queue.mjs +12 -0
- package/resources/workspaces/queue.mjs.map +1 -0
- package/resources/workspaces/sessions/index.d.ts +2 -2
- package/resources/workspaces/sessions/index.d.ts.map +1 -1
- package/resources/workspaces/sessions/index.js.map +1 -1
- package/resources/workspaces/sessions/index.mjs.map +1 -1
- package/resources/workspaces/sessions/messages.d.ts +13 -11
- package/resources/workspaces/sessions/messages.d.ts.map +1 -1
- package/resources/workspaces/sessions/messages.js +10 -8
- package/resources/workspaces/sessions/messages.js.map +1 -1
- package/resources/workspaces/sessions/messages.mjs +10 -8
- package/resources/workspaces/sessions/messages.mjs.map +1 -1
- package/resources/workspaces/sessions/peers.d.ts +15 -12
- package/resources/workspaces/sessions/peers.d.ts.map +1 -1
- package/resources/workspaces/sessions/peers.js +12 -7
- package/resources/workspaces/sessions/peers.js.map +1 -1
- package/resources/workspaces/sessions/peers.mjs +12 -7
- package/resources/workspaces/sessions/peers.mjs.map +1 -1
- package/resources/workspaces/sessions/sessions.d.ts +40 -118
- package/resources/workspaces/sessions/sessions.d.ts.map +1 -1
- package/resources/workspaces/sessions/sessions.js +19 -17
- package/resources/workspaces/sessions/sessions.js.map +1 -1
- package/resources/workspaces/sessions/sessions.mjs +19 -17
- package/resources/workspaces/sessions/sessions.mjs.map +1 -1
- package/resources/workspaces/webhooks.d.ts +2 -3
- package/resources/workspaces/webhooks.d.ts.map +1 -1
- package/resources/workspaces/webhooks.js +4 -1
- package/resources/workspaces/webhooks.js.map +1 -1
- package/resources/workspaces/webhooks.mjs +4 -1
- package/resources/workspaces/webhooks.mjs.map +1 -1
- package/resources/workspaces/workspaces.d.ts +59 -196
- package/resources/workspaces/workspaces.d.ts.map +1 -1
- package/resources/workspaces/workspaces.js +32 -34
- package/resources/workspaces/workspaces.js.map +1 -1
- package/resources/workspaces/workspaces.mjs +34 -36
- package/resources/workspaces/workspaces.mjs.map +1 -1
- package/src/index.ts +4 -21
- package/src/resources/index.ts +2 -7
- package/src/resources/workspaces/conclusions.ts +36 -78
- package/src/resources/workspaces/index.ts +9 -33
- package/src/resources/workspaces/peers/index.ts +4 -4
- package/src/resources/workspaces/peers/peers.ts +102 -181
- package/src/resources/workspaces/peers/sessions.ts +1 -1
- package/src/resources/workspaces/queue.ts +111 -0
- package/src/resources/workspaces/sessions/index.ts +2 -3
- package/src/resources/workspaces/sessions/messages.ts +25 -23
- package/src/resources/workspaces/sessions/peers.ts +16 -14
- package/src/resources/workspaces/sessions/sessions.ts +53 -143
- package/src/resources/workspaces/webhooks.ts +5 -5
- package/src/resources/workspaces/workspaces.ts +99 -325
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/resources/keys.d.ts +0 -29
- package/resources/keys.d.ts.map +0 -1
- package/resources/keys.js +0 -20
- package/resources/keys.js.map +0 -1
- package/resources/keys.mjs +0 -16
- package/resources/keys.mjs.map +0 -1
- package/resources/workspaces/observations.d.ts +0 -166
- package/resources/workspaces/observations.d.ts.map +0 -1
- package/resources/workspaces/observations.js +0 -64
- package/resources/workspaces/observations.js.map +0 -1
- package/resources/workspaces/observations.mjs +0 -59
- package/resources/workspaces/observations.mjs.map +0 -1
- package/src/resources/keys.ts +0 -51
- package/src/resources/workspaces/observations.ts +0 -249
|
@@ -13,7 +13,7 @@ export class Peers extends APIResource {
|
|
|
13
13
|
sessions: SessionsAPI.Sessions = new SessionsAPI.Sessions(this._client);
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
* Update a Peer's
|
|
16
|
+
* Update a Peer's metadata and/or configuration.
|
|
17
17
|
*/
|
|
18
18
|
update(
|
|
19
19
|
workspaceId: string,
|
|
@@ -25,7 +25,7 @@ export class Peers extends APIResource {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
|
-
* Get
|
|
28
|
+
* Get all Peers for a Workspace, paginated with optional filters.
|
|
29
29
|
*/
|
|
30
30
|
list(
|
|
31
31
|
workspaceId: string,
|
|
@@ -76,7 +76,9 @@ export class Peers extends APIResource {
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
/**
|
|
79
|
-
*
|
|
79
|
+
* Query a Peer's representation using natural language. Performs agentic search
|
|
80
|
+
* and reasoning to comprehensively answer the query based on all latent knowledge
|
|
81
|
+
* gathered about the peer from their messages and conclusions.
|
|
80
82
|
*/
|
|
81
83
|
chat(
|
|
82
84
|
workspaceId: string,
|
|
@@ -90,39 +92,39 @@ export class Peers extends APIResource {
|
|
|
90
92
|
/**
|
|
91
93
|
* Get context for a peer, including their representation and peer card.
|
|
92
94
|
*
|
|
93
|
-
* This endpoint returns the
|
|
94
|
-
* target is specified, returns the context for the target from the
|
|
95
|
-
* perspective. If no target is specified, returns the peer's own
|
|
96
|
-
* (self-observation).
|
|
95
|
+
* This endpoint returns a curated subset of the representation and peer card for a
|
|
96
|
+
* peer. If a target is specified, returns the context for the target from the
|
|
97
|
+
* observer peer's perspective. If no target is specified, returns the peer's own
|
|
98
|
+
* context (self-observation).
|
|
97
99
|
*
|
|
98
100
|
* This is useful for getting all the context needed about a peer without making
|
|
99
101
|
* multiple API calls.
|
|
100
102
|
*/
|
|
101
|
-
|
|
103
|
+
context(
|
|
102
104
|
workspaceId: string,
|
|
103
105
|
peerId: string,
|
|
104
|
-
query?:
|
|
106
|
+
query?: PeerContextParams,
|
|
105
107
|
options?: Core.RequestOptions,
|
|
106
|
-
): Core.APIPromise<
|
|
107
|
-
|
|
108
|
+
): Core.APIPromise<PeerContextResponse>;
|
|
109
|
+
context(
|
|
108
110
|
workspaceId: string,
|
|
109
111
|
peerId: string,
|
|
110
112
|
options?: Core.RequestOptions,
|
|
111
|
-
): Core.APIPromise<
|
|
112
|
-
|
|
113
|
+
): Core.APIPromise<PeerContextResponse>;
|
|
114
|
+
context(
|
|
113
115
|
workspaceId: string,
|
|
114
116
|
peerId: string,
|
|
115
|
-
query:
|
|
117
|
+
query: PeerContextParams | Core.RequestOptions = {},
|
|
116
118
|
options?: Core.RequestOptions,
|
|
117
|
-
): Core.APIPromise<
|
|
119
|
+
): Core.APIPromise<PeerContextResponse> {
|
|
118
120
|
if (isRequestOptions(query)) {
|
|
119
|
-
return this.
|
|
121
|
+
return this.context(workspaceId, peerId, {}, query);
|
|
120
122
|
}
|
|
121
123
|
return this._client.get(`/v2/workspaces/${workspaceId}/peers/${peerId}/context`, { query, ...options });
|
|
122
124
|
}
|
|
123
125
|
|
|
124
126
|
/**
|
|
125
|
-
* Get a Peer by ID
|
|
127
|
+
* Get a Peer by ID or create a new Peer with the given ID.
|
|
126
128
|
*
|
|
127
129
|
* If peer_id is provided as a query parameter, it uses that (must match JWT
|
|
128
130
|
* workspace_id). Otherwise, it uses the peer_id from the JWT.
|
|
@@ -136,7 +138,29 @@ export class Peers extends APIResource {
|
|
|
136
138
|
}
|
|
137
139
|
|
|
138
140
|
/**
|
|
139
|
-
*
|
|
141
|
+
* Get a curated subset of a Peer's Representation. A Representation is always a
|
|
142
|
+
* subset of the total knowledge about the Peer. The subset can be scoped and
|
|
143
|
+
* filtered in various ways.
|
|
144
|
+
*
|
|
145
|
+
* If a session_id is provided in the body, we get the Representation of the Peer
|
|
146
|
+
* scoped to that Session. If a target is provided, we get the Representation of
|
|
147
|
+
* the target from the perspective of the Peer. If no target is provided, we get
|
|
148
|
+
* the omniscient Honcho Representation of the Peer.
|
|
149
|
+
*/
|
|
150
|
+
representation(
|
|
151
|
+
workspaceId: string,
|
|
152
|
+
peerId: string,
|
|
153
|
+
body: PeerRepresentationParams,
|
|
154
|
+
options?: Core.RequestOptions,
|
|
155
|
+
): Core.APIPromise<PeerRepresentationResponse> {
|
|
156
|
+
return this._client.post(`/v2/workspaces/${workspaceId}/peers/${peerId}/representation`, {
|
|
157
|
+
body,
|
|
158
|
+
...options,
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Search a Peer's messages, optionally filtered by various criteria.
|
|
140
164
|
*/
|
|
141
165
|
search(
|
|
142
166
|
workspaceId: string,
|
|
@@ -166,26 +190,6 @@ export class Peers extends APIResource {
|
|
|
166
190
|
...options,
|
|
167
191
|
});
|
|
168
192
|
}
|
|
169
|
-
|
|
170
|
-
/**
|
|
171
|
-
* Get a peer's working representation for a session.
|
|
172
|
-
*
|
|
173
|
-
* If a session_id is provided in the body, we get the working representation of
|
|
174
|
-
* the peer in that session. If a target is provided, we get the representation of
|
|
175
|
-
* the target from the perspective of the peer. If no target is provided, we get
|
|
176
|
-
* the omniscient Honcho representation of the peer.
|
|
177
|
-
*/
|
|
178
|
-
workingRepresentation(
|
|
179
|
-
workspaceId: string,
|
|
180
|
-
peerId: string,
|
|
181
|
-
body: PeerWorkingRepresentationParams,
|
|
182
|
-
options?: Core.RequestOptions,
|
|
183
|
-
): Core.APIPromise<PeerWorkingRepresentationResponse> {
|
|
184
|
-
return this._client.post(`/v2/workspaces/${workspaceId}/peers/${peerId}/representation`, {
|
|
185
|
-
body,
|
|
186
|
-
...options,
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
193
|
}
|
|
190
194
|
|
|
191
195
|
export class PeersPage extends Page<Peer> {}
|
|
@@ -244,7 +248,7 @@ export interface PeerChatResponse {
|
|
|
244
248
|
/**
|
|
245
249
|
* Context for a peer, including representation and peer card.
|
|
246
250
|
*/
|
|
247
|
-
export interface
|
|
251
|
+
export interface PeerContextResponse {
|
|
248
252
|
/**
|
|
249
253
|
* The ID of the peer
|
|
250
254
|
*/
|
|
@@ -261,106 +265,18 @@ export interface PeerGetContextResponse {
|
|
|
261
265
|
peer_card?: Array<string> | null;
|
|
262
266
|
|
|
263
267
|
/**
|
|
264
|
-
* A
|
|
265
|
-
*
|
|
266
|
-
*
|
|
267
|
-
* From there, deductive observations can be made by establishing logical
|
|
268
|
-
* relationships between explicit observations.
|
|
269
|
-
*
|
|
270
|
-
* In the future, we can add more levels of reasoning on top of these.
|
|
271
|
-
*
|
|
272
|
-
* All of a peer's observations are stored as documents in a collection. These
|
|
273
|
-
* documents can be queried in various ways to produce this Representation object.
|
|
274
|
-
*
|
|
275
|
-
* Additionally, a "working representation" is a version of this data structure
|
|
276
|
-
* representing the most recent observations within a single session.
|
|
277
|
-
*
|
|
278
|
-
* A representation can have a maximum number of observations, which is applied
|
|
279
|
-
* individually to each level of reasoning. If a maximum is set, observations are
|
|
280
|
-
* added and removed in FIFO order.
|
|
268
|
+
* A curated subset of the representation of the target peer from the observer's
|
|
269
|
+
* perspective
|
|
281
270
|
*/
|
|
282
|
-
representation?:
|
|
271
|
+
representation?: string | null;
|
|
283
272
|
}
|
|
284
273
|
|
|
285
|
-
export
|
|
286
|
-
|
|
287
|
-
* A Representation is a traversable and diffable map of observations. At the base,
|
|
288
|
-
* we have a list of explicit observations, derived from a peer's messages.
|
|
289
|
-
*
|
|
290
|
-
* From there, deductive observations can be made by establishing logical
|
|
291
|
-
* relationships between explicit observations.
|
|
292
|
-
*
|
|
293
|
-
* In the future, we can add more levels of reasoning on top of these.
|
|
294
|
-
*
|
|
295
|
-
* All of a peer's observations are stored as documents in a collection. These
|
|
296
|
-
* documents can be queried in various ways to produce this Representation object.
|
|
297
|
-
*
|
|
298
|
-
* Additionally, a "working representation" is a version of this data structure
|
|
299
|
-
* representing the most recent observations within a single session.
|
|
300
|
-
*
|
|
301
|
-
* A representation can have a maximum number of observations, which is applied
|
|
302
|
-
* individually to each level of reasoning. If a maximum is set, observations are
|
|
303
|
-
* added and removed in FIFO order.
|
|
304
|
-
*/
|
|
305
|
-
export interface Representation {
|
|
306
|
-
/**
|
|
307
|
-
* Conclusions that MUST be true given explicit facts and premises - strict logical
|
|
308
|
-
* necessities. Each deduction should have premises and a single conclusion.
|
|
309
|
-
*/
|
|
310
|
-
deductive?: Array<Representation.Deductive>;
|
|
311
|
-
|
|
312
|
-
/**
|
|
313
|
-
* Facts LITERALLY stated by the user - direct quotes or clear paraphrases only, no
|
|
314
|
-
* interpretation or inference. Example: ['The user is 25 years old', 'The user has
|
|
315
|
-
* a dog']
|
|
316
|
-
*/
|
|
317
|
-
explicit?: Array<Representation.Explicit>;
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
export namespace Representation {
|
|
321
|
-
/**
|
|
322
|
-
* Deductive observation with multiple premises and one conclusion, plus metadata.
|
|
323
|
-
*/
|
|
324
|
-
export interface Deductive {
|
|
325
|
-
/**
|
|
326
|
-
* The deductive conclusion
|
|
327
|
-
*/
|
|
328
|
-
conclusion: string;
|
|
329
|
-
|
|
330
|
-
created_at: string;
|
|
331
|
-
|
|
332
|
-
message_ids: Array<number>;
|
|
333
|
-
|
|
334
|
-
session_name: string;
|
|
335
|
-
|
|
336
|
-
/**
|
|
337
|
-
* Supporting premises or evidence for this conclusion
|
|
338
|
-
*/
|
|
339
|
-
premises?: Array<string>;
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
/**
|
|
343
|
-
* Explicit observation with content and metadata.
|
|
344
|
-
*/
|
|
345
|
-
export interface Explicit {
|
|
346
|
-
/**
|
|
347
|
-
* The explicit observation
|
|
348
|
-
*/
|
|
349
|
-
content: string;
|
|
350
|
-
|
|
351
|
-
created_at: string;
|
|
352
|
-
|
|
353
|
-
message_ids: Array<number>;
|
|
354
|
-
|
|
355
|
-
session_name: string;
|
|
356
|
-
}
|
|
357
|
-
}
|
|
274
|
+
export interface PeerRepresentationResponse {
|
|
275
|
+
representation: string;
|
|
358
276
|
}
|
|
359
277
|
|
|
360
278
|
export type PeerSearchResponse = Array<MessagesAPI.Message>;
|
|
361
279
|
|
|
362
|
-
export type PeerWorkingRepresentationResponse = { [key: string]: unknown };
|
|
363
|
-
|
|
364
280
|
export interface PeerUpdateParams {
|
|
365
281
|
configuration?: { [key: string]: unknown } | null;
|
|
366
282
|
|
|
@@ -376,8 +292,8 @@ export interface PeerListParams extends PageParams {
|
|
|
376
292
|
|
|
377
293
|
export interface PeerCardParams {
|
|
378
294
|
/**
|
|
379
|
-
*
|
|
380
|
-
* card
|
|
295
|
+
* Optional target peer to retrieve a card for, from the observer's perspective. If
|
|
296
|
+
* not provided, returns the observer's own card
|
|
381
297
|
*/
|
|
382
298
|
target?: string | null;
|
|
383
299
|
}
|
|
@@ -388,6 +304,11 @@ export interface PeerChatParams {
|
|
|
388
304
|
*/
|
|
389
305
|
query: string;
|
|
390
306
|
|
|
307
|
+
/**
|
|
308
|
+
* Level of reasoning to apply: minimal, low, medium, high, or extra-high
|
|
309
|
+
*/
|
|
310
|
+
reasoning_level?: 'minimal' | 'low' | 'medium' | 'high' | 'extra-high';
|
|
311
|
+
|
|
391
312
|
/**
|
|
392
313
|
* ID of the session to scope the representation to
|
|
393
314
|
*/
|
|
@@ -401,20 +322,20 @@ export interface PeerChatParams {
|
|
|
401
322
|
target?: string | null;
|
|
402
323
|
}
|
|
403
324
|
|
|
404
|
-
export interface
|
|
325
|
+
export interface PeerContextParams {
|
|
405
326
|
/**
|
|
406
|
-
* Whether to include the most
|
|
327
|
+
* Whether to include the most frequent conclusions in the representation
|
|
407
328
|
*/
|
|
408
|
-
|
|
329
|
+
include_most_frequent?: boolean;
|
|
409
330
|
|
|
410
331
|
/**
|
|
411
|
-
* Maximum number of
|
|
332
|
+
* Maximum number of conclusions to include in the representation
|
|
412
333
|
*/
|
|
413
|
-
|
|
334
|
+
max_conclusions?: number | null;
|
|
414
335
|
|
|
415
336
|
/**
|
|
416
337
|
* Only used if `search_query` is provided. Maximum distance for semantically
|
|
417
|
-
* relevant
|
|
338
|
+
* relevant conclusions
|
|
418
339
|
*/
|
|
419
340
|
search_max_distance?: number | null;
|
|
420
341
|
|
|
@@ -425,13 +346,13 @@ export interface PeerGetContextParams {
|
|
|
425
346
|
|
|
426
347
|
/**
|
|
427
348
|
* Only used if `search_query` is provided. Number of semantic-search-retrieved
|
|
428
|
-
*
|
|
349
|
+
* conclusions to include
|
|
429
350
|
*/
|
|
430
351
|
search_top_k?: number | null;
|
|
431
352
|
|
|
432
353
|
/**
|
|
433
|
-
*
|
|
434
|
-
* context (self-observation)
|
|
354
|
+
* Optional target peer to get context for, from the observer's perspective. If not
|
|
355
|
+
* provided, returns the observer's own context (self-observation)
|
|
435
356
|
*/
|
|
436
357
|
target?: string | null;
|
|
437
358
|
}
|
|
@@ -444,74 +365,74 @@ export interface PeerGetOrCreateParams {
|
|
|
444
365
|
metadata?: { [key: string]: unknown } | null;
|
|
445
366
|
}
|
|
446
367
|
|
|
447
|
-
export interface
|
|
368
|
+
export interface PeerRepresentationParams {
|
|
448
369
|
/**
|
|
449
|
-
*
|
|
370
|
+
* Only used if `search_query` is provided. Whether to include the most frequent
|
|
371
|
+
* conclusions in the representation
|
|
450
372
|
*/
|
|
451
|
-
|
|
373
|
+
include_most_frequent?: boolean | null;
|
|
452
374
|
|
|
453
375
|
/**
|
|
454
|
-
*
|
|
376
|
+
* Only used if `search_query` is provided. Maximum number of conclusions to
|
|
377
|
+
* include in the representation
|
|
455
378
|
*/
|
|
456
|
-
|
|
379
|
+
max_conclusions?: number | null;
|
|
457
380
|
|
|
458
381
|
/**
|
|
459
|
-
*
|
|
382
|
+
* Only used if `search_query` is provided. Maximum distance to search for
|
|
383
|
+
* semantically relevant conclusions
|
|
460
384
|
*/
|
|
461
|
-
|
|
462
|
-
}
|
|
385
|
+
search_max_distance?: number | null;
|
|
463
386
|
|
|
464
|
-
export interface PeerSetCardParams {
|
|
465
387
|
/**
|
|
466
|
-
*
|
|
388
|
+
* Optional input to curate the representation around semantic search results
|
|
467
389
|
*/
|
|
468
|
-
|
|
390
|
+
search_query?: string | null;
|
|
469
391
|
|
|
470
392
|
/**
|
|
471
|
-
*
|
|
472
|
-
*
|
|
393
|
+
* Only used if `search_query` is provided. Number of semantic-search-retrieved
|
|
394
|
+
* conclusions to include in the representation
|
|
473
395
|
*/
|
|
474
|
-
|
|
475
|
-
}
|
|
396
|
+
search_top_k?: number | null;
|
|
476
397
|
|
|
477
|
-
export interface PeerWorkingRepresentationParams {
|
|
478
398
|
/**
|
|
479
|
-
*
|
|
480
|
-
* observations in the representation
|
|
399
|
+
* Optional session ID within which to scope the representation
|
|
481
400
|
*/
|
|
482
|
-
|
|
401
|
+
session_id?: string | null;
|
|
483
402
|
|
|
484
403
|
/**
|
|
485
|
-
*
|
|
486
|
-
*
|
|
404
|
+
* Optional peer ID to get the representation for, from the perspective of this
|
|
405
|
+
* peer
|
|
487
406
|
*/
|
|
488
|
-
|
|
407
|
+
target?: string | null;
|
|
408
|
+
}
|
|
489
409
|
|
|
410
|
+
export interface PeerSearchParams {
|
|
490
411
|
/**
|
|
491
|
-
*
|
|
492
|
-
* semantically relevant observations
|
|
412
|
+
* Search query
|
|
493
413
|
*/
|
|
494
|
-
|
|
414
|
+
query: string;
|
|
495
415
|
|
|
496
416
|
/**
|
|
497
|
-
*
|
|
417
|
+
* Filters to scope the search
|
|
498
418
|
*/
|
|
499
|
-
|
|
419
|
+
filters?: { [key: string]: unknown } | null;
|
|
500
420
|
|
|
501
421
|
/**
|
|
502
|
-
*
|
|
503
|
-
* observations to include in the representation
|
|
422
|
+
* Number of results to return
|
|
504
423
|
*/
|
|
505
|
-
|
|
424
|
+
limit?: number;
|
|
425
|
+
}
|
|
506
426
|
|
|
427
|
+
export interface PeerSetCardParams {
|
|
507
428
|
/**
|
|
508
|
-
*
|
|
429
|
+
* Body param: The peer card content to set
|
|
509
430
|
*/
|
|
510
|
-
|
|
431
|
+
peer_card: Array<string>;
|
|
511
432
|
|
|
512
433
|
/**
|
|
513
|
-
* Optional peer
|
|
514
|
-
*
|
|
434
|
+
* Query param: Optional target peer to set a card for, from the observer's
|
|
435
|
+
* perspective. If not provided, sets the observer's own card
|
|
515
436
|
*/
|
|
516
437
|
target?: string | null;
|
|
517
438
|
}
|
|
@@ -527,19 +448,19 @@ export declare namespace Peers {
|
|
|
527
448
|
type PeerCardResponse as PeerCardResponse,
|
|
528
449
|
type SessionGet as SessionGet,
|
|
529
450
|
type PeerChatResponse as PeerChatResponse,
|
|
530
|
-
type
|
|
451
|
+
type PeerContextResponse as PeerContextResponse,
|
|
452
|
+
type PeerRepresentationResponse as PeerRepresentationResponse,
|
|
531
453
|
type PeerSearchResponse as PeerSearchResponse,
|
|
532
|
-
type PeerWorkingRepresentationResponse as PeerWorkingRepresentationResponse,
|
|
533
454
|
PeersPage as PeersPage,
|
|
534
455
|
type PeerUpdateParams as PeerUpdateParams,
|
|
535
456
|
type PeerListParams as PeerListParams,
|
|
536
457
|
type PeerCardParams as PeerCardParams,
|
|
537
458
|
type PeerChatParams as PeerChatParams,
|
|
538
|
-
type
|
|
459
|
+
type PeerContextParams as PeerContextParams,
|
|
539
460
|
type PeerGetOrCreateParams as PeerGetOrCreateParams,
|
|
461
|
+
type PeerRepresentationParams as PeerRepresentationParams,
|
|
540
462
|
type PeerSearchParams as PeerSearchParams,
|
|
541
463
|
type PeerSetCardParams as PeerSetCardParams,
|
|
542
|
-
type PeerWorkingRepresentationParams as PeerWorkingRepresentationParams,
|
|
543
464
|
};
|
|
544
465
|
|
|
545
466
|
export { Sessions as Sessions, type SessionListParams as SessionListParams };
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from "../../resource.js";
|
|
4
|
+
import { isRequestOptions } from "../../core.js";
|
|
5
|
+
import * as Core from "../../core.js";
|
|
6
|
+
|
|
7
|
+
export class Queue extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Get the processing queue status for a Workspace, optionally scoped to an
|
|
10
|
+
* observer, sender, and/or session.
|
|
11
|
+
*/
|
|
12
|
+
status(
|
|
13
|
+
workspaceId: string,
|
|
14
|
+
query?: QueueStatusParams,
|
|
15
|
+
options?: Core.RequestOptions,
|
|
16
|
+
): Core.APIPromise<QueueStatusResponse>;
|
|
17
|
+
status(workspaceId: string, options?: Core.RequestOptions): Core.APIPromise<QueueStatusResponse>;
|
|
18
|
+
status(
|
|
19
|
+
workspaceId: string,
|
|
20
|
+
query: QueueStatusParams | Core.RequestOptions = {},
|
|
21
|
+
options?: Core.RequestOptions,
|
|
22
|
+
): Core.APIPromise<QueueStatusResponse> {
|
|
23
|
+
if (isRequestOptions(query)) {
|
|
24
|
+
return this.status(workspaceId, {}, query);
|
|
25
|
+
}
|
|
26
|
+
return this._client.get(`/v2/workspaces/${workspaceId}/queue/status`, { query, ...options });
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Aggregated processing queue status.
|
|
32
|
+
*/
|
|
33
|
+
export interface QueueStatusResponse {
|
|
34
|
+
/**
|
|
35
|
+
* Completed work units
|
|
36
|
+
*/
|
|
37
|
+
completed_work_units: number;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Work units currently being processed
|
|
41
|
+
*/
|
|
42
|
+
in_progress_work_units: number;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Work units waiting to be processed
|
|
46
|
+
*/
|
|
47
|
+
pending_work_units: number;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Total work units
|
|
51
|
+
*/
|
|
52
|
+
total_work_units: number;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Per-session status when not filtered by session
|
|
56
|
+
*/
|
|
57
|
+
sessions?: { [key: string]: QueueStatusResponse.Sessions } | null;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export namespace QueueStatusResponse {
|
|
61
|
+
/**
|
|
62
|
+
* Status for a specific session within the processing queue.
|
|
63
|
+
*/
|
|
64
|
+
export interface Sessions {
|
|
65
|
+
/**
|
|
66
|
+
* Completed work units
|
|
67
|
+
*/
|
|
68
|
+
completed_work_units: number;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Work units currently being processed
|
|
72
|
+
*/
|
|
73
|
+
in_progress_work_units: number;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Work units waiting to be processed
|
|
77
|
+
*/
|
|
78
|
+
pending_work_units: number;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Total work units
|
|
82
|
+
*/
|
|
83
|
+
total_work_units: number;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Session ID if filtered by session
|
|
87
|
+
*/
|
|
88
|
+
session_id?: string | null;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export interface QueueStatusParams {
|
|
93
|
+
/**
|
|
94
|
+
* Optional observer ID to filter by
|
|
95
|
+
*/
|
|
96
|
+
observer_id?: string | null;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Optional sender ID to filter by
|
|
100
|
+
*/
|
|
101
|
+
sender_id?: string | null;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Optional session ID to filter by
|
|
105
|
+
*/
|
|
106
|
+
session_id?: string | null;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export declare namespace Queue {
|
|
110
|
+
export { type QueueStatusResponse as QueueStatusResponse, type QueueStatusParams as QueueStatusParams };
|
|
111
|
+
}
|
|
@@ -15,7 +15,6 @@ export {
|
|
|
15
15
|
export {
|
|
16
16
|
Peers,
|
|
17
17
|
type SessionPeerConfig,
|
|
18
|
-
type PeerSetConfigResponse,
|
|
19
18
|
type PeerListParams,
|
|
20
19
|
type PeerAddParams,
|
|
21
20
|
type PeerRemoveParams,
|
|
@@ -29,13 +28,13 @@ export {
|
|
|
29
28
|
type SessionConfiguration,
|
|
30
29
|
type Summary,
|
|
31
30
|
type SessionDeleteResponse,
|
|
32
|
-
type
|
|
31
|
+
type SessionContextResponse,
|
|
33
32
|
type SessionSearchResponse,
|
|
34
33
|
type SessionSummariesResponse,
|
|
35
34
|
type SessionUpdateParams,
|
|
36
35
|
type SessionListParams,
|
|
37
36
|
type SessionCloneParams,
|
|
38
|
-
type
|
|
37
|
+
type SessionContextParams,
|
|
39
38
|
type SessionGetOrCreateParams,
|
|
40
39
|
type SessionSearchParams,
|
|
41
40
|
} from "./sessions.js";
|
|
@@ -16,29 +16,16 @@ export class Messages extends APIResource {
|
|
|
16
16
|
body: MessageCreateParams,
|
|
17
17
|
options?: Core.RequestOptions,
|
|
18
18
|
): Core.APIPromise<MessageCreateResponse> {
|
|
19
|
-
return this._client.post(`/v2/workspaces/${workspaceId}/sessions/${sessionId}/messages
|
|
19
|
+
return this._client.post(`/v2/workspaces/${workspaceId}/sessions/${sessionId}/messages`, {
|
|
20
20
|
body,
|
|
21
21
|
...options,
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
workspaceId: string,
|
|
30
|
-
sessionId: string,
|
|
31
|
-
messageId: string,
|
|
32
|
-
options?: Core.RequestOptions,
|
|
33
|
-
): Core.APIPromise<Message> {
|
|
34
|
-
return this._client.get(
|
|
35
|
-
`/v2/workspaces/${workspaceId}/sessions/${sessionId}/messages/${messageId}`,
|
|
36
|
-
options,
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Update the metadata of a Message
|
|
26
|
+
* Update the metadata of a message.
|
|
27
|
+
*
|
|
28
|
+
* This will overwrite any existing metadata for the message.
|
|
42
29
|
*/
|
|
43
30
|
update(
|
|
44
31
|
workspaceId: string,
|
|
@@ -54,7 +41,7 @@ export class Messages extends APIResource {
|
|
|
54
41
|
}
|
|
55
42
|
|
|
56
43
|
/**
|
|
57
|
-
* Get all messages for a
|
|
44
|
+
* Get all messages for a Session with optional filters. Results are paginated.
|
|
58
45
|
*/
|
|
59
46
|
list(
|
|
60
47
|
workspaceId: string,
|
|
@@ -84,6 +71,21 @@ export class Messages extends APIResource {
|
|
|
84
71
|
);
|
|
85
72
|
}
|
|
86
73
|
|
|
74
|
+
/**
|
|
75
|
+
* Get a single message by ID from a Session.
|
|
76
|
+
*/
|
|
77
|
+
get(
|
|
78
|
+
workspaceId: string,
|
|
79
|
+
sessionId: string,
|
|
80
|
+
messageId: string,
|
|
81
|
+
options?: Core.RequestOptions,
|
|
82
|
+
): Core.APIPromise<Message> {
|
|
83
|
+
return this._client.get(
|
|
84
|
+
`/v2/workspaces/${workspaceId}/sessions/${sessionId}/messages/${messageId}`,
|
|
85
|
+
options,
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
|
|
87
89
|
/**
|
|
88
90
|
* Create messages from uploaded files. Files are converted to text and split into
|
|
89
91
|
* multiple messages.
|
|
@@ -148,15 +150,15 @@ export namespace MessageCreate {
|
|
|
148
150
|
*/
|
|
149
151
|
export interface Configuration {
|
|
150
152
|
/**
|
|
151
|
-
* Configuration for
|
|
153
|
+
* Configuration for peer card functionality. If reasoning is disabled, peer cards
|
|
154
|
+
* will also be disabled and these settings will be ignored.
|
|
152
155
|
*/
|
|
153
|
-
|
|
156
|
+
peer_card?: WorkspacesAPI.PeerCardConfiguration | null;
|
|
154
157
|
|
|
155
158
|
/**
|
|
156
|
-
* Configuration for
|
|
157
|
-
* will also be disabled and these settings will be ignored.
|
|
159
|
+
* Configuration for reasoning functionality.
|
|
158
160
|
*/
|
|
159
|
-
|
|
161
|
+
reasoning?: WorkspacesAPI.ReasoningConfiguration | null;
|
|
160
162
|
}
|
|
161
163
|
}
|
|
162
164
|
|