@honcho-ai/core 1.8.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 +40 -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 +109 -0
- package/resources/workspaces/conclusions.d.ts.map +1 -0
- package/resources/workspaces/conclusions.js +54 -0
- package/resources/workspaces/conclusions.js.map +1 -0
- package/resources/workspaces/conclusions.mjs +49 -0
- package/resources/workspaces/conclusions.mjs.map +1 -0
- package/resources/workspaces/index.d.ts +6 -5
- package/resources/workspaces/index.d.ts.map +1 -1
- package/resources/workspaces/index.js +6 -4
- package/resources/workspaces/index.js.map +1 -1
- package/resources/workspaces/index.mjs +2 -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/index.js.map +1 -1
- package/resources/workspaces/peers/index.mjs.map +1 -1
- package/resources/workspaces/peers/peers.d.ts +83 -152
- 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 +43 -58
- package/resources/workspaces/sessions/sessions.d.ts.map +1 -1
- package/resources/workspaces/sessions/sessions.js +21 -19
- package/resources/workspaces/sessions/sessions.js.map +1 -1
- package/resources/workspaces/sessions/sessions.mjs +21 -19
- 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 +73 -125
- package/resources/workspaces/workspaces.d.ts.map +1 -1
- package/resources/workspaces/workspaces.js +34 -25
- package/resources/workspaces/workspaces.js.map +1 -1
- package/resources/workspaces/workspaces.mjs +36 -27
- package/resources/workspaces/workspaces.mjs.map +1 -1
- package/src/index.ts +4 -17
- package/src/resources/index.ts +2 -5
- package/src/resources/workspaces/conclusions.ts +178 -0
- package/src/resources/workspaces/index.ts +18 -26
- package/src/resources/workspaces/peers/index.ts +4 -5
- package/src/resources/workspaces/peers/peers.ts +104 -182
- 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 +56 -72
- package/src/resources/workspaces/webhooks.ts +5 -5
- package/src/resources/workspaces/workspaces.ts +125 -209
- 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 -156
- package/resources/workspaces/observations.d.ts.map +0 -1
- package/resources/workspaces/observations.js +0 -58
- package/resources/workspaces/observations.js.map +0 -1
- package/resources/workspaces/observations.mjs +0 -53
- package/resources/workspaces/observations.mjs.map +0 -1
- package/src/resources/keys.ts +0 -51
- package/src/resources/workspaces/observations.ts +0 -238
|
@@ -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> {}
|
|
@@ -233,79 +237,6 @@ export interface PeerCardResponse {
|
|
|
233
237
|
peer_card?: Array<string> | null;
|
|
234
238
|
}
|
|
235
239
|
|
|
236
|
-
/**
|
|
237
|
-
* A Representation is a traversable and diffable map of observations. At the base,
|
|
238
|
-
* we have a list of explicit observations, derived from a peer's messages.
|
|
239
|
-
*
|
|
240
|
-
* From there, deductive observations can be made by establishing logical
|
|
241
|
-
* relationships between explicit observations.
|
|
242
|
-
*
|
|
243
|
-
* In the future, we can add more levels of reasoning on top of these.
|
|
244
|
-
*
|
|
245
|
-
* All of a peer's observations are stored as documents in a collection. These
|
|
246
|
-
* documents can be queried in various ways to produce this Representation object.
|
|
247
|
-
*
|
|
248
|
-
* Additionally, a "working representation" is a version of this data structure
|
|
249
|
-
* representing the most recent observations within a single session.
|
|
250
|
-
*
|
|
251
|
-
* A representation can have a maximum number of observations, which is applied
|
|
252
|
-
* individually to each level of reasoning. If a maximum is set, observations are
|
|
253
|
-
* added and removed in FIFO order.
|
|
254
|
-
*/
|
|
255
|
-
export interface Representation {
|
|
256
|
-
/**
|
|
257
|
-
* Conclusions that MUST be true given explicit facts and premises - strict logical
|
|
258
|
-
* necessities. Each deduction should have premises and a single conclusion.
|
|
259
|
-
*/
|
|
260
|
-
deductive?: Array<Representation.Deductive>;
|
|
261
|
-
|
|
262
|
-
/**
|
|
263
|
-
* Facts LITERALLY stated by the user - direct quotes or clear paraphrases only, no
|
|
264
|
-
* interpretation or inference. Example: ['The user is 25 years old', 'The user has
|
|
265
|
-
* a dog']
|
|
266
|
-
*/
|
|
267
|
-
explicit?: Array<Representation.Explicit>;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
export namespace Representation {
|
|
271
|
-
/**
|
|
272
|
-
* Deductive observation with multiple premises and one conclusion, plus metadata.
|
|
273
|
-
*/
|
|
274
|
-
export interface Deductive {
|
|
275
|
-
/**
|
|
276
|
-
* The deductive conclusion
|
|
277
|
-
*/
|
|
278
|
-
conclusion: string;
|
|
279
|
-
|
|
280
|
-
created_at: string;
|
|
281
|
-
|
|
282
|
-
message_ids: Array<number>;
|
|
283
|
-
|
|
284
|
-
session_name: string;
|
|
285
|
-
|
|
286
|
-
/**
|
|
287
|
-
* Supporting premises or evidence for this conclusion
|
|
288
|
-
*/
|
|
289
|
-
premises?: Array<string>;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
/**
|
|
293
|
-
* Explicit observation with content and metadata.
|
|
294
|
-
*/
|
|
295
|
-
export interface Explicit {
|
|
296
|
-
/**
|
|
297
|
-
* The explicit observation
|
|
298
|
-
*/
|
|
299
|
-
content: string;
|
|
300
|
-
|
|
301
|
-
created_at: string;
|
|
302
|
-
|
|
303
|
-
message_ids: Array<number>;
|
|
304
|
-
|
|
305
|
-
session_name: string;
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
|
|
309
240
|
export interface SessionGet {
|
|
310
241
|
filters?: { [key: string]: unknown } | null;
|
|
311
242
|
}
|
|
@@ -317,7 +248,7 @@ export interface PeerChatResponse {
|
|
|
317
248
|
/**
|
|
318
249
|
* Context for a peer, including representation and peer card.
|
|
319
250
|
*/
|
|
320
|
-
export interface
|
|
251
|
+
export interface PeerContextResponse {
|
|
321
252
|
/**
|
|
322
253
|
* The ID of the peer
|
|
323
254
|
*/
|
|
@@ -334,30 +265,17 @@ export interface PeerGetContextResponse {
|
|
|
334
265
|
peer_card?: Array<string> | null;
|
|
335
266
|
|
|
336
267
|
/**
|
|
337
|
-
* A
|
|
338
|
-
*
|
|
339
|
-
*
|
|
340
|
-
* From there, deductive observations can be made by establishing logical
|
|
341
|
-
* relationships between explicit observations.
|
|
342
|
-
*
|
|
343
|
-
* In the future, we can add more levels of reasoning on top of these.
|
|
344
|
-
*
|
|
345
|
-
* All of a peer's observations are stored as documents in a collection. These
|
|
346
|
-
* documents can be queried in various ways to produce this Representation object.
|
|
347
|
-
*
|
|
348
|
-
* Additionally, a "working representation" is a version of this data structure
|
|
349
|
-
* representing the most recent observations within a single session.
|
|
350
|
-
*
|
|
351
|
-
* A representation can have a maximum number of observations, which is applied
|
|
352
|
-
* individually to each level of reasoning. If a maximum is set, observations are
|
|
353
|
-
* added and removed in FIFO order.
|
|
268
|
+
* A curated subset of the representation of the target peer from the observer's
|
|
269
|
+
* perspective
|
|
354
270
|
*/
|
|
355
|
-
representation?:
|
|
271
|
+
representation?: string | null;
|
|
356
272
|
}
|
|
357
273
|
|
|
358
|
-
export
|
|
274
|
+
export interface PeerRepresentationResponse {
|
|
275
|
+
representation: string;
|
|
276
|
+
}
|
|
359
277
|
|
|
360
|
-
export type
|
|
278
|
+
export type PeerSearchResponse = Array<MessagesAPI.Message>;
|
|
361
279
|
|
|
362
280
|
export interface PeerUpdateParams {
|
|
363
281
|
configuration?: { [key: string]: unknown } | null;
|
|
@@ -374,8 +292,8 @@ export interface PeerListParams extends PageParams {
|
|
|
374
292
|
|
|
375
293
|
export interface PeerCardParams {
|
|
376
294
|
/**
|
|
377
|
-
*
|
|
378
|
-
* 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
|
|
379
297
|
*/
|
|
380
298
|
target?: string | null;
|
|
381
299
|
}
|
|
@@ -386,6 +304,11 @@ export interface PeerChatParams {
|
|
|
386
304
|
*/
|
|
387
305
|
query: string;
|
|
388
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
|
+
|
|
389
312
|
/**
|
|
390
313
|
* ID of the session to scope the representation to
|
|
391
314
|
*/
|
|
@@ -399,20 +322,20 @@ export interface PeerChatParams {
|
|
|
399
322
|
target?: string | null;
|
|
400
323
|
}
|
|
401
324
|
|
|
402
|
-
export interface
|
|
325
|
+
export interface PeerContextParams {
|
|
403
326
|
/**
|
|
404
|
-
* Whether to include the most
|
|
327
|
+
* Whether to include the most frequent conclusions in the representation
|
|
405
328
|
*/
|
|
406
|
-
|
|
329
|
+
include_most_frequent?: boolean;
|
|
407
330
|
|
|
408
331
|
/**
|
|
409
|
-
* Maximum number of
|
|
332
|
+
* Maximum number of conclusions to include in the representation
|
|
410
333
|
*/
|
|
411
|
-
|
|
334
|
+
max_conclusions?: number | null;
|
|
412
335
|
|
|
413
336
|
/**
|
|
414
337
|
* Only used if `search_query` is provided. Maximum distance for semantically
|
|
415
|
-
* relevant
|
|
338
|
+
* relevant conclusions
|
|
416
339
|
*/
|
|
417
340
|
search_max_distance?: number | null;
|
|
418
341
|
|
|
@@ -423,13 +346,13 @@ export interface PeerGetContextParams {
|
|
|
423
346
|
|
|
424
347
|
/**
|
|
425
348
|
* Only used if `search_query` is provided. Number of semantic-search-retrieved
|
|
426
|
-
*
|
|
349
|
+
* conclusions to include
|
|
427
350
|
*/
|
|
428
351
|
search_top_k?: number | null;
|
|
429
352
|
|
|
430
353
|
/**
|
|
431
|
-
*
|
|
432
|
-
* 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)
|
|
433
356
|
*/
|
|
434
357
|
target?: string | null;
|
|
435
358
|
}
|
|
@@ -442,74 +365,74 @@ export interface PeerGetOrCreateParams {
|
|
|
442
365
|
metadata?: { [key: string]: unknown } | null;
|
|
443
366
|
}
|
|
444
367
|
|
|
445
|
-
export interface
|
|
368
|
+
export interface PeerRepresentationParams {
|
|
446
369
|
/**
|
|
447
|
-
*
|
|
370
|
+
* Only used if `search_query` is provided. Whether to include the most frequent
|
|
371
|
+
* conclusions in the representation
|
|
448
372
|
*/
|
|
449
|
-
|
|
373
|
+
include_most_frequent?: boolean | null;
|
|
450
374
|
|
|
451
375
|
/**
|
|
452
|
-
*
|
|
376
|
+
* Only used if `search_query` is provided. Maximum number of conclusions to
|
|
377
|
+
* include in the representation
|
|
453
378
|
*/
|
|
454
|
-
|
|
379
|
+
max_conclusions?: number | null;
|
|
455
380
|
|
|
456
381
|
/**
|
|
457
|
-
*
|
|
382
|
+
* Only used if `search_query` is provided. Maximum distance to search for
|
|
383
|
+
* semantically relevant conclusions
|
|
458
384
|
*/
|
|
459
|
-
|
|
460
|
-
}
|
|
385
|
+
search_max_distance?: number | null;
|
|
461
386
|
|
|
462
|
-
export interface PeerSetCardParams {
|
|
463
387
|
/**
|
|
464
|
-
*
|
|
388
|
+
* Optional input to curate the representation around semantic search results
|
|
465
389
|
*/
|
|
466
|
-
|
|
390
|
+
search_query?: string | null;
|
|
467
391
|
|
|
468
392
|
/**
|
|
469
|
-
*
|
|
470
|
-
*
|
|
393
|
+
* Only used if `search_query` is provided. Number of semantic-search-retrieved
|
|
394
|
+
* conclusions to include in the representation
|
|
471
395
|
*/
|
|
472
|
-
|
|
473
|
-
}
|
|
396
|
+
search_top_k?: number | null;
|
|
474
397
|
|
|
475
|
-
export interface PeerWorkingRepresentationParams {
|
|
476
398
|
/**
|
|
477
|
-
*
|
|
478
|
-
* observations in the representation
|
|
399
|
+
* Optional session ID within which to scope the representation
|
|
479
400
|
*/
|
|
480
|
-
|
|
401
|
+
session_id?: string | null;
|
|
481
402
|
|
|
482
403
|
/**
|
|
483
|
-
*
|
|
484
|
-
*
|
|
404
|
+
* Optional peer ID to get the representation for, from the perspective of this
|
|
405
|
+
* peer
|
|
485
406
|
*/
|
|
486
|
-
|
|
407
|
+
target?: string | null;
|
|
408
|
+
}
|
|
487
409
|
|
|
410
|
+
export interface PeerSearchParams {
|
|
488
411
|
/**
|
|
489
|
-
*
|
|
490
|
-
* semantically relevant observations
|
|
412
|
+
* Search query
|
|
491
413
|
*/
|
|
492
|
-
|
|
414
|
+
query: string;
|
|
493
415
|
|
|
494
416
|
/**
|
|
495
|
-
*
|
|
417
|
+
* Filters to scope the search
|
|
496
418
|
*/
|
|
497
|
-
|
|
419
|
+
filters?: { [key: string]: unknown } | null;
|
|
498
420
|
|
|
499
421
|
/**
|
|
500
|
-
*
|
|
501
|
-
* observations to include in the representation
|
|
422
|
+
* Number of results to return
|
|
502
423
|
*/
|
|
503
|
-
|
|
424
|
+
limit?: number;
|
|
425
|
+
}
|
|
504
426
|
|
|
427
|
+
export interface PeerSetCardParams {
|
|
505
428
|
/**
|
|
506
|
-
*
|
|
429
|
+
* Body param: The peer card content to set
|
|
507
430
|
*/
|
|
508
|
-
|
|
431
|
+
peer_card: Array<string>;
|
|
509
432
|
|
|
510
433
|
/**
|
|
511
|
-
* Optional peer
|
|
512
|
-
*
|
|
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
|
|
513
436
|
*/
|
|
514
437
|
target?: string | null;
|
|
515
438
|
}
|
|
@@ -523,22 +446,21 @@ export declare namespace Peers {
|
|
|
523
446
|
type PageSession as PageSession,
|
|
524
447
|
type Peer as Peer,
|
|
525
448
|
type PeerCardResponse as PeerCardResponse,
|
|
526
|
-
type Representation as Representation,
|
|
527
449
|
type SessionGet as SessionGet,
|
|
528
450
|
type PeerChatResponse as PeerChatResponse,
|
|
529
|
-
type
|
|
451
|
+
type PeerContextResponse as PeerContextResponse,
|
|
452
|
+
type PeerRepresentationResponse as PeerRepresentationResponse,
|
|
530
453
|
type PeerSearchResponse as PeerSearchResponse,
|
|
531
|
-
type PeerWorkingRepresentationResponse as PeerWorkingRepresentationResponse,
|
|
532
454
|
PeersPage as PeersPage,
|
|
533
455
|
type PeerUpdateParams as PeerUpdateParams,
|
|
534
456
|
type PeerListParams as PeerListParams,
|
|
535
457
|
type PeerCardParams as PeerCardParams,
|
|
536
458
|
type PeerChatParams as PeerChatParams,
|
|
537
|
-
type
|
|
459
|
+
type PeerContextParams as PeerContextParams,
|
|
538
460
|
type PeerGetOrCreateParams as PeerGetOrCreateParams,
|
|
461
|
+
type PeerRepresentationParams as PeerRepresentationParams,
|
|
539
462
|
type PeerSearchParams as PeerSearchParams,
|
|
540
463
|
type PeerSetCardParams as PeerSetCardParams,
|
|
541
|
-
type PeerWorkingRepresentationParams as PeerWorkingRepresentationParams,
|
|
542
464
|
};
|
|
543
465
|
|
|
544
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";
|