@honcho-ai/core 1.5.1 → 1.6.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/index.d.mts +2 -2
- package/index.d.ts +2 -2
- package/index.d.ts.map +1 -1
- package/index.js.map +1 -1
- package/index.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/workspaces/index.d.ts +4 -3
- package/resources/workspaces/index.d.ts.map +1 -1
- package/resources/workspaces/index.js +4 -1
- package/resources/workspaces/index.js.map +1 -1
- package/resources/workspaces/index.mjs +1 -0
- package/resources/workspaces/index.mjs.map +1 -1
- package/resources/workspaces/observations.d.ts +124 -0
- package/resources/workspaces/observations.d.ts.map +1 -0
- package/resources/workspaces/observations.js +46 -0
- package/resources/workspaces/observations.js.map +1 -0
- package/resources/workspaces/observations.mjs +41 -0
- package/resources/workspaces/observations.mjs.map +1 -0
- 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 +190 -5
- package/resources/workspaces/peers/peers.d.ts.map +1 -1
- package/resources/workspaces/peers/peers.js +20 -0
- package/resources/workspaces/peers/peers.js.map +1 -1
- package/resources/workspaces/peers/peers.mjs +20 -0
- package/resources/workspaces/peers/peers.mjs.map +1 -1
- package/resources/workspaces/sessions/index.d.ts +1 -1
- 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 +31 -1
- package/resources/workspaces/sessions/messages.d.ts.map +1 -1
- package/resources/workspaces/sessions/messages.js +1 -1
- package/resources/workspaces/sessions/messages.js.map +1 -1
- package/resources/workspaces/sessions/messages.mjs +1 -1
- package/resources/workspaces/sessions/messages.mjs.map +1 -1
- package/resources/workspaces/sessions/peers.d.ts +4 -6
- package/resources/workspaces/sessions/peers.d.ts.map +1 -1
- package/resources/workspaces/sessions/peers.js.map +1 -1
- package/resources/workspaces/sessions/peers.mjs.map +1 -1
- package/resources/workspaces/sessions/sessions.d.ts +77 -10
- package/resources/workspaces/sessions/sessions.d.ts.map +1 -1
- package/resources/workspaces/sessions/sessions.js +7 -1
- package/resources/workspaces/sessions/sessions.js.map +1 -1
- package/resources/workspaces/sessions/sessions.mjs +7 -1
- package/resources/workspaces/sessions/sessions.mjs.map +1 -1
- package/resources/workspaces/workspaces.d.ts +116 -11
- package/resources/workspaces/workspaces.d.ts.map +1 -1
- package/resources/workspaces/workspaces.js +18 -0
- package/resources/workspaces/workspaces.js.map +1 -1
- package/resources/workspaces/workspaces.mjs +18 -0
- package/resources/workspaces/workspaces.mjs.map +1 -1
- package/src/index.ts +12 -0
- package/src/resources/index.ts +6 -0
- package/src/resources/workspaces/index.ts +22 -1
- package/src/resources/workspaces/observations.ts +190 -0
- package/src/resources/workspaces/peers/index.ts +4 -1
- package/src/resources/workspaces/peers/peers.ts +255 -5
- package/src/resources/workspaces/sessions/index.ts +1 -0
- package/src/resources/workspaces/sessions/messages.ts +37 -1
- package/src/resources/workspaces/sessions/peers.ts +4 -6
- package/src/resources/workspaces/sessions/sessions.ts +87 -5
- package/src/resources/workspaces/workspaces.ts +175 -3
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/src/index.ts
CHANGED
|
@@ -9,14 +9,20 @@ import * as Uploads from "./uploads.js";
|
|
|
9
9
|
import * as API from "./resources/index.js";
|
|
10
10
|
import { KeyCreateParams, KeyCreateResponse, Keys } from "./resources/keys.js";
|
|
11
11
|
import {
|
|
12
|
+
DeriverConfiguration,
|
|
12
13
|
DeriverStatus,
|
|
14
|
+
DreamConfiguration,
|
|
13
15
|
MessageSearchOptions,
|
|
16
|
+
PeerCardConfiguration,
|
|
17
|
+
SummaryConfiguration,
|
|
14
18
|
Workspace,
|
|
19
|
+
WorkspaceConfiguration,
|
|
15
20
|
WorkspaceDeriverStatusParams,
|
|
16
21
|
WorkspaceGetOrCreateParams,
|
|
17
22
|
WorkspaceListParams,
|
|
18
23
|
WorkspaceSearchParams,
|
|
19
24
|
WorkspaceSearchResponse,
|
|
25
|
+
WorkspaceTriggerDreamParams,
|
|
20
26
|
WorkspaceUpdateParams,
|
|
21
27
|
Workspaces,
|
|
22
28
|
WorkspacesPage,
|
|
@@ -218,9 +224,14 @@ export declare namespace Honcho {
|
|
|
218
224
|
|
|
219
225
|
export {
|
|
220
226
|
Workspaces as Workspaces,
|
|
227
|
+
type DeriverConfiguration as DeriverConfiguration,
|
|
221
228
|
type DeriverStatus as DeriverStatus,
|
|
229
|
+
type DreamConfiguration as DreamConfiguration,
|
|
222
230
|
type MessageSearchOptions as MessageSearchOptions,
|
|
231
|
+
type PeerCardConfiguration as PeerCardConfiguration,
|
|
232
|
+
type SummaryConfiguration as SummaryConfiguration,
|
|
223
233
|
type Workspace as Workspace,
|
|
234
|
+
type WorkspaceConfiguration as WorkspaceConfiguration,
|
|
224
235
|
type WorkspaceSearchResponse as WorkspaceSearchResponse,
|
|
225
236
|
WorkspacesPage as WorkspacesPage,
|
|
226
237
|
type WorkspaceUpdateParams as WorkspaceUpdateParams,
|
|
@@ -228,6 +239,7 @@ export declare namespace Honcho {
|
|
|
228
239
|
type WorkspaceDeriverStatusParams as WorkspaceDeriverStatusParams,
|
|
229
240
|
type WorkspaceGetOrCreateParams as WorkspaceGetOrCreateParams,
|
|
230
241
|
type WorkspaceSearchParams as WorkspaceSearchParams,
|
|
242
|
+
type WorkspaceTriggerDreamParams as WorkspaceTriggerDreamParams,
|
|
231
243
|
};
|
|
232
244
|
|
|
233
245
|
export {
|
package/src/resources/index.ts
CHANGED
|
@@ -4,13 +4,19 @@ export { Keys, type KeyCreateResponse, type KeyCreateParams } from "./keys.js";
|
|
|
4
4
|
export {
|
|
5
5
|
WorkspacesPage,
|
|
6
6
|
Workspaces,
|
|
7
|
+
type DeriverConfiguration,
|
|
7
8
|
type DeriverStatus,
|
|
9
|
+
type DreamConfiguration,
|
|
8
10
|
type MessageSearchOptions,
|
|
11
|
+
type PeerCardConfiguration,
|
|
12
|
+
type SummaryConfiguration,
|
|
9
13
|
type Workspace,
|
|
14
|
+
type WorkspaceConfiguration,
|
|
10
15
|
type WorkspaceSearchResponse,
|
|
11
16
|
type WorkspaceUpdateParams,
|
|
12
17
|
type WorkspaceListParams,
|
|
13
18
|
type WorkspaceDeriverStatusParams,
|
|
14
19
|
type WorkspaceGetOrCreateParams,
|
|
15
20
|
type WorkspaceSearchParams,
|
|
21
|
+
type WorkspaceTriggerDreamParams,
|
|
16
22
|
} from "./workspaces/workspaces.js";
|
|
@@ -1,28 +1,43 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
+
export {
|
|
4
|
+
ObservationsPage,
|
|
5
|
+
Observations,
|
|
6
|
+
type ObservationGet,
|
|
7
|
+
type ObservationQuery,
|
|
8
|
+
type PageObservation,
|
|
9
|
+
type ObservationDeleteResponse,
|
|
10
|
+
type ObservationQueryResponse,
|
|
11
|
+
type ObservationListParams,
|
|
12
|
+
type ObservationQueryParams,
|
|
13
|
+
} from "./observations.js";
|
|
3
14
|
export {
|
|
4
15
|
PeersPage,
|
|
5
16
|
Peers,
|
|
6
17
|
type PagePeer,
|
|
7
18
|
type PageSession,
|
|
8
19
|
type Peer,
|
|
9
|
-
type SessionGet,
|
|
10
20
|
type PeerCardResponse,
|
|
21
|
+
type SessionGet,
|
|
11
22
|
type PeerChatResponse,
|
|
23
|
+
type PeerGetContextResponse,
|
|
12
24
|
type PeerSearchResponse,
|
|
13
25
|
type PeerWorkingRepresentationResponse,
|
|
14
26
|
type PeerUpdateParams,
|
|
15
27
|
type PeerListParams,
|
|
16
28
|
type PeerCardParams,
|
|
17
29
|
type PeerChatParams,
|
|
30
|
+
type PeerGetContextParams,
|
|
18
31
|
type PeerGetOrCreateParams,
|
|
19
32
|
type PeerSearchParams,
|
|
33
|
+
type PeerSetCardParams,
|
|
20
34
|
type PeerWorkingRepresentationParams,
|
|
21
35
|
} from "./peers/index.js";
|
|
22
36
|
export {
|
|
23
37
|
SessionsPage,
|
|
24
38
|
Sessions,
|
|
25
39
|
type Session,
|
|
40
|
+
type SessionConfiguration,
|
|
26
41
|
type Summary,
|
|
27
42
|
type SessionDeleteResponse,
|
|
28
43
|
type SessionGetContextResponse,
|
|
@@ -47,13 +62,19 @@ export {
|
|
|
47
62
|
export {
|
|
48
63
|
WorkspacesPage,
|
|
49
64
|
Workspaces,
|
|
65
|
+
type DeriverConfiguration,
|
|
50
66
|
type DeriverStatus,
|
|
67
|
+
type DreamConfiguration,
|
|
51
68
|
type MessageSearchOptions,
|
|
69
|
+
type PeerCardConfiguration,
|
|
70
|
+
type SummaryConfiguration,
|
|
52
71
|
type Workspace,
|
|
72
|
+
type WorkspaceConfiguration,
|
|
53
73
|
type WorkspaceSearchResponse,
|
|
54
74
|
type WorkspaceUpdateParams,
|
|
55
75
|
type WorkspaceListParams,
|
|
56
76
|
type WorkspaceDeriverStatusParams,
|
|
57
77
|
type WorkspaceGetOrCreateParams,
|
|
58
78
|
type WorkspaceSearchParams,
|
|
79
|
+
type WorkspaceTriggerDreamParams,
|
|
59
80
|
} from "./workspaces.js";
|
|
@@ -0,0 +1,190 @@
|
|
|
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
|
+
import { Page, type PageParams } from "../../pagination.js";
|
|
7
|
+
|
|
8
|
+
export class Observations extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* List all observations using custom filters. Observations are listed by recency
|
|
11
|
+
* unless `reverse` is set to `true`.
|
|
12
|
+
*
|
|
13
|
+
* Observations can be filtered by session_id, observer_id and observed_id using
|
|
14
|
+
* the filters parameter.
|
|
15
|
+
*/
|
|
16
|
+
list(
|
|
17
|
+
workspaceId: string,
|
|
18
|
+
params?: ObservationListParams,
|
|
19
|
+
options?: Core.RequestOptions,
|
|
20
|
+
): Core.PagePromise<ObservationsPage, Observations>;
|
|
21
|
+
list(workspaceId: string, options?: Core.RequestOptions): Core.PagePromise<ObservationsPage, Observations>;
|
|
22
|
+
list(
|
|
23
|
+
workspaceId: string,
|
|
24
|
+
params: ObservationListParams | Core.RequestOptions = {},
|
|
25
|
+
options?: Core.RequestOptions,
|
|
26
|
+
): Core.PagePromise<ObservationsPage, Observations> {
|
|
27
|
+
if (isRequestOptions(params)) {
|
|
28
|
+
return this.list(workspaceId, {}, params);
|
|
29
|
+
}
|
|
30
|
+
const { page, reverse, size, ...body } = params;
|
|
31
|
+
return this._client.getAPIList(`/v2/workspaces/${workspaceId}/observations/list`, ObservationsPage, {
|
|
32
|
+
query: { page, reverse, size },
|
|
33
|
+
body,
|
|
34
|
+
method: 'post',
|
|
35
|
+
...options,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Delete a specific observation.
|
|
41
|
+
*
|
|
42
|
+
* This permanently deletes the observation (document) from the theory-of-mind
|
|
43
|
+
* system. This action cannot be undone.
|
|
44
|
+
*/
|
|
45
|
+
delete(
|
|
46
|
+
workspaceId: string,
|
|
47
|
+
observationId: string,
|
|
48
|
+
options?: Core.RequestOptions,
|
|
49
|
+
): Core.APIPromise<unknown> {
|
|
50
|
+
return this._client.delete(`/v2/workspaces/${workspaceId}/observations/${observationId}`, options);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Query observations using semantic search.
|
|
55
|
+
*
|
|
56
|
+
* Performs vector similarity search on observations to find semantically relevant
|
|
57
|
+
* results. Observer and observed are required for semantic search and must be
|
|
58
|
+
* provided in filters.
|
|
59
|
+
*/
|
|
60
|
+
query(
|
|
61
|
+
workspaceId: string,
|
|
62
|
+
body: ObservationQueryParams,
|
|
63
|
+
options?: Core.RequestOptions,
|
|
64
|
+
): Core.APIPromise<ObservationQueryResponse> {
|
|
65
|
+
return this._client.post(`/v2/workspaces/${workspaceId}/observations/query`, { body, ...options });
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export class ObservationsPage extends Page<Observations> {}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Schema for listing observations with optional filters
|
|
73
|
+
*/
|
|
74
|
+
export interface ObservationGet {
|
|
75
|
+
filters?: { [key: string]: unknown } | null;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Query parameters for semantic search of observations
|
|
80
|
+
*/
|
|
81
|
+
export interface ObservationQuery {
|
|
82
|
+
/**
|
|
83
|
+
* Semantic search query
|
|
84
|
+
*/
|
|
85
|
+
query: string;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Maximum cosine distance threshold for results
|
|
89
|
+
*/
|
|
90
|
+
distance?: number | null;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Additional filters to apply
|
|
94
|
+
*/
|
|
95
|
+
filters?: { [key: string]: unknown } | null;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Number of results to return
|
|
99
|
+
*/
|
|
100
|
+
top_k?: number;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Observation response - external view of a document
|
|
105
|
+
*/
|
|
106
|
+
export interface Observations {
|
|
107
|
+
id: string;
|
|
108
|
+
|
|
109
|
+
content: string;
|
|
110
|
+
|
|
111
|
+
created_at: string;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* The peer being observed
|
|
115
|
+
*/
|
|
116
|
+
observed_id: string;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* The peer who made the observation
|
|
120
|
+
*/
|
|
121
|
+
observer_id: string;
|
|
122
|
+
|
|
123
|
+
session_id: string;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export interface PageObservation {
|
|
127
|
+
items: Array<Observations>;
|
|
128
|
+
|
|
129
|
+
page: number;
|
|
130
|
+
|
|
131
|
+
size: number;
|
|
132
|
+
|
|
133
|
+
pages?: number;
|
|
134
|
+
|
|
135
|
+
total?: number;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export type ObservationDeleteResponse = unknown;
|
|
139
|
+
|
|
140
|
+
export type ObservationQueryResponse = Array<Observations>;
|
|
141
|
+
|
|
142
|
+
export interface ObservationListParams extends PageParams {
|
|
143
|
+
/**
|
|
144
|
+
* Query param: Whether to reverse the order of results
|
|
145
|
+
*/
|
|
146
|
+
reverse?: boolean | null;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Body param:
|
|
150
|
+
*/
|
|
151
|
+
filters?: { [key: string]: unknown } | null;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export interface ObservationQueryParams {
|
|
155
|
+
/**
|
|
156
|
+
* Semantic search query
|
|
157
|
+
*/
|
|
158
|
+
query: string;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Maximum cosine distance threshold for results
|
|
162
|
+
*/
|
|
163
|
+
distance?: number | null;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Additional filters to apply
|
|
167
|
+
*/
|
|
168
|
+
filters?: { [key: string]: unknown } | null;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Number of results to return
|
|
172
|
+
*/
|
|
173
|
+
top_k?: number;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
Observations.ObservationsPage = ObservationsPage;
|
|
177
|
+
|
|
178
|
+
export declare namespace Observations {
|
|
179
|
+
export {
|
|
180
|
+
type ObservationGet as ObservationGet,
|
|
181
|
+
type ObservationQuery as ObservationQuery,
|
|
182
|
+
type Observations as Observations,
|
|
183
|
+
type PageObservation as PageObservation,
|
|
184
|
+
type ObservationDeleteResponse as ObservationDeleteResponse,
|
|
185
|
+
type ObservationQueryResponse as ObservationQueryResponse,
|
|
186
|
+
ObservationsPage as ObservationsPage,
|
|
187
|
+
type ObservationListParams as ObservationListParams,
|
|
188
|
+
type ObservationQueryParams as ObservationQueryParams,
|
|
189
|
+
};
|
|
190
|
+
}
|
|
@@ -6,17 +6,20 @@ export {
|
|
|
6
6
|
type PagePeer,
|
|
7
7
|
type PageSession,
|
|
8
8
|
type Peer,
|
|
9
|
-
type SessionGet,
|
|
10
9
|
type PeerCardResponse,
|
|
10
|
+
type SessionGet,
|
|
11
11
|
type PeerChatResponse,
|
|
12
|
+
type PeerGetContextResponse,
|
|
12
13
|
type PeerSearchResponse,
|
|
13
14
|
type PeerWorkingRepresentationResponse,
|
|
14
15
|
type PeerUpdateParams,
|
|
15
16
|
type PeerListParams,
|
|
16
17
|
type PeerCardParams,
|
|
17
18
|
type PeerChatParams,
|
|
19
|
+
type PeerGetContextParams,
|
|
18
20
|
type PeerGetOrCreateParams,
|
|
19
21
|
type PeerSearchParams,
|
|
22
|
+
type PeerSetCardParams,
|
|
20
23
|
type PeerWorkingRepresentationParams,
|
|
21
24
|
} from "./peers.js";
|
|
22
25
|
export { Sessions, type SessionListParams } from "./sessions.js";
|
|
@@ -87,6 +87,40 @@ export class Peers extends APIResource {
|
|
|
87
87
|
return this._client.post(`/v2/workspaces/${workspaceId}/peers/${peerId}/chat`, { body, ...options });
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
+
/**
|
|
91
|
+
* Get context for a peer, including their representation and peer card.
|
|
92
|
+
*
|
|
93
|
+
* This endpoint returns the working representation and peer card for a peer. If a
|
|
94
|
+
* target is specified, returns the context for the target from the observer peer's
|
|
95
|
+
* perspective. If no target is specified, returns the peer's own context
|
|
96
|
+
* (self-observation).
|
|
97
|
+
*
|
|
98
|
+
* This is useful for getting all the context needed about a peer without making
|
|
99
|
+
* multiple API calls.
|
|
100
|
+
*/
|
|
101
|
+
getContext(
|
|
102
|
+
workspaceId: string,
|
|
103
|
+
peerId: string,
|
|
104
|
+
query?: PeerGetContextParams,
|
|
105
|
+
options?: Core.RequestOptions,
|
|
106
|
+
): Core.APIPromise<PeerGetContextResponse>;
|
|
107
|
+
getContext(
|
|
108
|
+
workspaceId: string,
|
|
109
|
+
peerId: string,
|
|
110
|
+
options?: Core.RequestOptions,
|
|
111
|
+
): Core.APIPromise<PeerGetContextResponse>;
|
|
112
|
+
getContext(
|
|
113
|
+
workspaceId: string,
|
|
114
|
+
peerId: string,
|
|
115
|
+
query: PeerGetContextParams | Core.RequestOptions = {},
|
|
116
|
+
options?: Core.RequestOptions,
|
|
117
|
+
): Core.APIPromise<PeerGetContextResponse> {
|
|
118
|
+
if (isRequestOptions(query)) {
|
|
119
|
+
return this.getContext(workspaceId, peerId, {}, query);
|
|
120
|
+
}
|
|
121
|
+
return this._client.get(`/v2/workspaces/${workspaceId}/peers/${peerId}/context`, { query, ...options });
|
|
122
|
+
}
|
|
123
|
+
|
|
90
124
|
/**
|
|
91
125
|
* Get a Peer by ID
|
|
92
126
|
*
|
|
@@ -113,6 +147,26 @@ export class Peers extends APIResource {
|
|
|
113
147
|
return this._client.post(`/v2/workspaces/${workspaceId}/peers/${peerId}/search`, { body, ...options });
|
|
114
148
|
}
|
|
115
149
|
|
|
150
|
+
/**
|
|
151
|
+
* Set a peer card for a specific peer relationship.
|
|
152
|
+
*
|
|
153
|
+
* Sets the peer card that the observer peer has for the target peer. If no target
|
|
154
|
+
* is specified, sets the observer's own peer card.
|
|
155
|
+
*/
|
|
156
|
+
setCard(
|
|
157
|
+
workspaceId: string,
|
|
158
|
+
peerId: string,
|
|
159
|
+
params: PeerSetCardParams,
|
|
160
|
+
options?: Core.RequestOptions,
|
|
161
|
+
): Core.APIPromise<PeerCardResponse> {
|
|
162
|
+
const { target, ...body } = params;
|
|
163
|
+
return this._client.put(`/v2/workspaces/${workspaceId}/peers/${peerId}/card`, {
|
|
164
|
+
query: { target },
|
|
165
|
+
body,
|
|
166
|
+
...options,
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
|
|
116
170
|
/**
|
|
117
171
|
* Get a peer's working representation for a session.
|
|
118
172
|
*
|
|
@@ -172,10 +226,6 @@ export interface Peer {
|
|
|
172
226
|
metadata?: { [key: string]: unknown };
|
|
173
227
|
}
|
|
174
228
|
|
|
175
|
-
export interface SessionGet {
|
|
176
|
-
filters?: { [key: string]: unknown } | null;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
229
|
export interface PeerCardResponse {
|
|
180
230
|
/**
|
|
181
231
|
* The peer card content, or None if not found
|
|
@@ -183,10 +233,130 @@ export interface PeerCardResponse {
|
|
|
183
233
|
peer_card?: Array<string> | null;
|
|
184
234
|
}
|
|
185
235
|
|
|
236
|
+
export interface SessionGet {
|
|
237
|
+
filters?: { [key: string]: unknown } | null;
|
|
238
|
+
}
|
|
239
|
+
|
|
186
240
|
export interface PeerChatResponse {
|
|
187
241
|
content: string;
|
|
188
242
|
}
|
|
189
243
|
|
|
244
|
+
/**
|
|
245
|
+
* Context for a peer, including representation and peer card.
|
|
246
|
+
*/
|
|
247
|
+
export interface PeerGetContextResponse {
|
|
248
|
+
/**
|
|
249
|
+
* The ID of the peer
|
|
250
|
+
*/
|
|
251
|
+
peer_id: string;
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* The ID of the target peer being observed
|
|
255
|
+
*/
|
|
256
|
+
target_id: string;
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* The peer card for the target peer from the observer's perspective
|
|
260
|
+
*/
|
|
261
|
+
peer_card?: Array<string> | null;
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* A Representation is a traversable and diffable map of observations. At the base,
|
|
265
|
+
* we have a list of explicit observations, derived from a peer's messages.
|
|
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.
|
|
281
|
+
*/
|
|
282
|
+
representation?: PeerGetContextResponse.Representation | null;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
export namespace PeerGetContextResponse {
|
|
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
|
+
}
|
|
358
|
+
}
|
|
359
|
+
|
|
190
360
|
export type PeerSearchResponse = Array<MessagesAPI.Message>;
|
|
191
361
|
|
|
192
362
|
export type PeerWorkingRepresentationResponse = { [key: string]: unknown };
|
|
@@ -231,6 +401,41 @@ export interface PeerChatParams {
|
|
|
231
401
|
target?: string | null;
|
|
232
402
|
}
|
|
233
403
|
|
|
404
|
+
export interface PeerGetContextParams {
|
|
405
|
+
/**
|
|
406
|
+
* Whether to include the most derived observations in the representation
|
|
407
|
+
*/
|
|
408
|
+
include_most_derived?: boolean;
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* Maximum number of observations to include in the representation
|
|
412
|
+
*/
|
|
413
|
+
max_observations?: number | null;
|
|
414
|
+
|
|
415
|
+
/**
|
|
416
|
+
* Only used if `search_query` is provided. Maximum distance for semantically
|
|
417
|
+
* relevant observations
|
|
418
|
+
*/
|
|
419
|
+
search_max_distance?: number | null;
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* Optional query to curate the representation around semantic search results
|
|
423
|
+
*/
|
|
424
|
+
search_query?: string | null;
|
|
425
|
+
|
|
426
|
+
/**
|
|
427
|
+
* Only used if `search_query` is provided. Number of semantic-search-retrieved
|
|
428
|
+
* observations to include
|
|
429
|
+
*/
|
|
430
|
+
search_top_k?: number | null;
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* The target peer to get context for. If not provided, returns the peer's own
|
|
434
|
+
* context (self-observation)
|
|
435
|
+
*/
|
|
436
|
+
target?: string | null;
|
|
437
|
+
}
|
|
438
|
+
|
|
234
439
|
export interface PeerGetOrCreateParams {
|
|
235
440
|
id: string;
|
|
236
441
|
|
|
@@ -256,7 +461,49 @@ export interface PeerSearchParams {
|
|
|
256
461
|
limit?: number;
|
|
257
462
|
}
|
|
258
463
|
|
|
464
|
+
export interface PeerSetCardParams {
|
|
465
|
+
/**
|
|
466
|
+
* Body param: The peer card content to set
|
|
467
|
+
*/
|
|
468
|
+
peer_card: Array<string>;
|
|
469
|
+
|
|
470
|
+
/**
|
|
471
|
+
* Query param: The peer whose card to set. If not provided, sets the observer's
|
|
472
|
+
* own card
|
|
473
|
+
*/
|
|
474
|
+
target?: string | null;
|
|
475
|
+
}
|
|
476
|
+
|
|
259
477
|
export interface PeerWorkingRepresentationParams {
|
|
478
|
+
/**
|
|
479
|
+
* Only used if `search_query` is provided. Whether to include the most derived
|
|
480
|
+
* observations in the representation
|
|
481
|
+
*/
|
|
482
|
+
include_most_derived?: boolean | null;
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* Only used if `search_query` is provided. Maximum number of observations to
|
|
486
|
+
* include in the representation
|
|
487
|
+
*/
|
|
488
|
+
max_observations?: number | null;
|
|
489
|
+
|
|
490
|
+
/**
|
|
491
|
+
* Only used if `search_query` is provided. Maximum distance to search for
|
|
492
|
+
* semantically relevant observations
|
|
493
|
+
*/
|
|
494
|
+
search_max_distance?: number | null;
|
|
495
|
+
|
|
496
|
+
/**
|
|
497
|
+
* Optional input to curate the representation around semantic search results
|
|
498
|
+
*/
|
|
499
|
+
search_query?: string | null;
|
|
500
|
+
|
|
501
|
+
/**
|
|
502
|
+
* Only used if `search_query` is provided. Number of semantic-search-retrieved
|
|
503
|
+
* observations to include in the representation
|
|
504
|
+
*/
|
|
505
|
+
search_top_k?: number | null;
|
|
506
|
+
|
|
260
507
|
/**
|
|
261
508
|
* Get the working representation within this session
|
|
262
509
|
*/
|
|
@@ -277,9 +524,10 @@ export declare namespace Peers {
|
|
|
277
524
|
type PagePeer as PagePeer,
|
|
278
525
|
type PageSession as PageSession,
|
|
279
526
|
type Peer as Peer,
|
|
280
|
-
type SessionGet as SessionGet,
|
|
281
527
|
type PeerCardResponse as PeerCardResponse,
|
|
528
|
+
type SessionGet as SessionGet,
|
|
282
529
|
type PeerChatResponse as PeerChatResponse,
|
|
530
|
+
type PeerGetContextResponse as PeerGetContextResponse,
|
|
283
531
|
type PeerSearchResponse as PeerSearchResponse,
|
|
284
532
|
type PeerWorkingRepresentationResponse as PeerWorkingRepresentationResponse,
|
|
285
533
|
PeersPage as PeersPage,
|
|
@@ -287,8 +535,10 @@ export declare namespace Peers {
|
|
|
287
535
|
type PeerListParams as PeerListParams,
|
|
288
536
|
type PeerCardParams as PeerCardParams,
|
|
289
537
|
type PeerChatParams as PeerChatParams,
|
|
538
|
+
type PeerGetContextParams as PeerGetContextParams,
|
|
290
539
|
type PeerGetOrCreateParams as PeerGetOrCreateParams,
|
|
291
540
|
type PeerSearchParams as PeerSearchParams,
|
|
541
|
+
type PeerSetCardParams as PeerSetCardParams,
|
|
292
542
|
type PeerWorkingRepresentationParams as PeerWorkingRepresentationParams,
|
|
293
543
|
};
|
|
294
544
|
|