@honcho-ai/core 1.8.0 → 2.1.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.
Files changed (112) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/LICENSE +1 -1
  3. package/README.md +12 -1
  4. package/index.d.mts +2 -5
  5. package/index.d.ts +2 -5
  6. package/index.d.ts.map +1 -1
  7. package/index.js +0 -3
  8. package/index.js.map +1 -1
  9. package/index.mjs +0 -3
  10. package/index.mjs.map +1 -1
  11. package/package.json +1 -1
  12. package/resources/index.d.ts +1 -2
  13. package/resources/index.d.ts.map +1 -1
  14. package/resources/index.js +1 -3
  15. package/resources/index.js.map +1 -1
  16. package/resources/index.mjs +0 -1
  17. package/resources/index.mjs.map +1 -1
  18. package/resources/workspaces/conclusions.d.ts +109 -0
  19. package/resources/workspaces/conclusions.d.ts.map +1 -0
  20. package/resources/workspaces/conclusions.js +54 -0
  21. package/resources/workspaces/conclusions.js.map +1 -0
  22. package/resources/workspaces/conclusions.mjs +49 -0
  23. package/resources/workspaces/conclusions.mjs.map +1 -0
  24. package/resources/workspaces/index.d.ts +6 -5
  25. package/resources/workspaces/index.d.ts.map +1 -1
  26. package/resources/workspaces/index.js +6 -4
  27. package/resources/workspaces/index.js.map +1 -1
  28. package/resources/workspaces/index.mjs +2 -1
  29. package/resources/workspaces/index.mjs.map +1 -1
  30. package/resources/workspaces/peers/index.d.ts +1 -1
  31. package/resources/workspaces/peers/index.d.ts.map +1 -1
  32. package/resources/workspaces/peers/index.js.map +1 -1
  33. package/resources/workspaces/peers/index.mjs.map +1 -1
  34. package/resources/workspaces/peers/peers.d.ts +83 -152
  35. package/resources/workspaces/peers/peers.d.ts.map +1 -1
  36. package/resources/workspaces/peers/peers.js +24 -20
  37. package/resources/workspaces/peers/peers.js.map +1 -1
  38. package/resources/workspaces/peers/peers.mjs +24 -20
  39. package/resources/workspaces/peers/peers.mjs.map +1 -1
  40. package/resources/workspaces/peers/sessions.d.ts +1 -1
  41. package/resources/workspaces/queue.d.ts +82 -0
  42. package/resources/workspaces/queue.d.ts.map +1 -0
  43. package/resources/workspaces/queue.js +16 -0
  44. package/resources/workspaces/queue.js.map +1 -0
  45. package/resources/workspaces/queue.mjs +12 -0
  46. package/resources/workspaces/queue.mjs.map +1 -0
  47. package/resources/workspaces/sessions/index.d.ts +2 -2
  48. package/resources/workspaces/sessions/index.d.ts.map +1 -1
  49. package/resources/workspaces/sessions/index.js.map +1 -1
  50. package/resources/workspaces/sessions/index.mjs.map +1 -1
  51. package/resources/workspaces/sessions/messages.d.ts +10 -13
  52. package/resources/workspaces/sessions/messages.d.ts.map +1 -1
  53. package/resources/workspaces/sessions/messages.js +10 -8
  54. package/resources/workspaces/sessions/messages.js.map +1 -1
  55. package/resources/workspaces/sessions/messages.mjs +10 -8
  56. package/resources/workspaces/sessions/messages.mjs.map +1 -1
  57. package/resources/workspaces/sessions/peers.d.ts +15 -12
  58. package/resources/workspaces/sessions/peers.d.ts.map +1 -1
  59. package/resources/workspaces/sessions/peers.js +12 -7
  60. package/resources/workspaces/sessions/peers.js.map +1 -1
  61. package/resources/workspaces/sessions/peers.mjs +12 -7
  62. package/resources/workspaces/sessions/peers.mjs.map +1 -1
  63. package/resources/workspaces/sessions/sessions.d.ts +43 -58
  64. package/resources/workspaces/sessions/sessions.d.ts.map +1 -1
  65. package/resources/workspaces/sessions/sessions.js +21 -19
  66. package/resources/workspaces/sessions/sessions.js.map +1 -1
  67. package/resources/workspaces/sessions/sessions.mjs +21 -19
  68. package/resources/workspaces/sessions/sessions.mjs.map +1 -1
  69. package/resources/workspaces/webhooks.d.ts +2 -3
  70. package/resources/workspaces/webhooks.d.ts.map +1 -1
  71. package/resources/workspaces/webhooks.js +4 -1
  72. package/resources/workspaces/webhooks.js.map +1 -1
  73. package/resources/workspaces/webhooks.mjs +4 -1
  74. package/resources/workspaces/webhooks.mjs.map +1 -1
  75. package/resources/workspaces/workspaces.d.ts +73 -125
  76. package/resources/workspaces/workspaces.d.ts.map +1 -1
  77. package/resources/workspaces/workspaces.js +34 -25
  78. package/resources/workspaces/workspaces.js.map +1 -1
  79. package/resources/workspaces/workspaces.mjs +36 -27
  80. package/resources/workspaces/workspaces.mjs.map +1 -1
  81. package/src/index.ts +4 -17
  82. package/src/resources/index.ts +2 -5
  83. package/src/resources/workspaces/conclusions.ts +178 -0
  84. package/src/resources/workspaces/index.ts +18 -26
  85. package/src/resources/workspaces/peers/index.ts +4 -5
  86. package/src/resources/workspaces/peers/peers.ts +104 -182
  87. package/src/resources/workspaces/peers/sessions.ts +1 -1
  88. package/src/resources/workspaces/queue.ts +111 -0
  89. package/src/resources/workspaces/sessions/index.ts +2 -3
  90. package/src/resources/workspaces/sessions/messages.ts +22 -26
  91. package/src/resources/workspaces/sessions/peers.ts +16 -14
  92. package/src/resources/workspaces/sessions/sessions.ts +56 -72
  93. package/src/resources/workspaces/webhooks.ts +5 -5
  94. package/src/resources/workspaces/workspaces.ts +125 -209
  95. package/src/version.ts +1 -1
  96. package/version.d.ts +1 -1
  97. package/version.js +1 -1
  98. package/version.mjs +1 -1
  99. package/resources/keys.d.ts +0 -29
  100. package/resources/keys.d.ts.map +0 -1
  101. package/resources/keys.js +0 -20
  102. package/resources/keys.js.map +0 -1
  103. package/resources/keys.mjs +0 -16
  104. package/resources/keys.mjs.map +0 -1
  105. package/resources/workspaces/observations.d.ts +0 -156
  106. package/resources/workspaces/observations.d.ts.map +0 -1
  107. package/resources/workspaces/observations.js +0 -58
  108. package/resources/workspaces/observations.js.map +0 -1
  109. package/resources/workspaces/observations.mjs +0 -53
  110. package/resources/workspaces/observations.mjs.map +0 -1
  111. package/src/resources/keys.ts +0 -51
  112. package/src/resources/workspaces/observations.ts +0 -238
@@ -1,156 +0,0 @@
1
- import { APIResource } from "../../resource.js";
2
- import * as Core from "../../core.js";
3
- import { Page, type PageParams } from "../../pagination.js";
4
- export declare class Observations extends APIResource {
5
- /**
6
- * Create one or more observations.
7
- *
8
- * Creates observations (theory-of-mind facts) for the specified observer/observed
9
- * peer pairs. Each observation must reference existing peers and a session within
10
- * the workspace. Embeddings are automatically generated for semantic search.
11
- *
12
- * Maximum of 100 observations per request.
13
- */
14
- create(workspaceId: string, body: ObservationCreateParams, options?: Core.RequestOptions): Core.APIPromise<ObservationCreateResponse>;
15
- /**
16
- * List all observations using custom filters. Observations are listed by recency
17
- * unless `reverse` is set to `true`.
18
- *
19
- * Observations can be filtered by session_id, observer_id and observed_id using
20
- * the filters parameter.
21
- */
22
- list(workspaceId: string, params?: ObservationListParams, options?: Core.RequestOptions): Core.PagePromise<ObservationsPage, Observation>;
23
- list(workspaceId: string, options?: Core.RequestOptions): Core.PagePromise<ObservationsPage, Observation>;
24
- /**
25
- * Delete a specific observation.
26
- *
27
- * This permanently deletes the observation (document) from the theory-of-mind
28
- * system. This action cannot be undone.
29
- */
30
- delete(workspaceId: string, observationId: string, options?: Core.RequestOptions): Core.APIPromise<unknown>;
31
- /**
32
- * Query observations using semantic search.
33
- *
34
- * Performs vector similarity search on observations to find semantically relevant
35
- * results. Observer and observed are required for semantic search and must be
36
- * provided in filters.
37
- */
38
- query(workspaceId: string, body: ObservationQueryParams, options?: Core.RequestOptions): Core.APIPromise<ObservationQueryResponse>;
39
- }
40
- export declare class ObservationsPage extends Page<Observation> {
41
- }
42
- /**
43
- * Observation response - external view of a document
44
- */
45
- export interface Observation {
46
- id: string;
47
- content: string;
48
- created_at: string;
49
- /**
50
- * The peer being observed
51
- */
52
- observed_id: string;
53
- /**
54
- * The peer who made the observation
55
- */
56
- observer_id: string;
57
- session_id: string;
58
- }
59
- /**
60
- * Schema for creating a single observation
61
- */
62
- export interface ObservationCreate {
63
- content: string;
64
- /**
65
- * The peer being observed
66
- */
67
- observed_id: string;
68
- /**
69
- * The peer making the observation
70
- */
71
- observer_id: string;
72
- /**
73
- * The session this observation relates to
74
- */
75
- session_id: string;
76
- }
77
- /**
78
- * Schema for listing observations with optional filters
79
- */
80
- export interface ObservationGet {
81
- filters?: {
82
- [key: string]: unknown;
83
- } | null;
84
- }
85
- /**
86
- * Query parameters for semantic search of observations
87
- */
88
- export interface ObservationQuery {
89
- /**
90
- * Semantic search query
91
- */
92
- query: string;
93
- /**
94
- * Maximum cosine distance threshold for results
95
- */
96
- distance?: number | null;
97
- /**
98
- * Additional filters to apply
99
- */
100
- filters?: {
101
- [key: string]: unknown;
102
- } | null;
103
- /**
104
- * Number of results to return
105
- */
106
- top_k?: number;
107
- }
108
- export interface PageObservation {
109
- items: Array<Observation>;
110
- page: number;
111
- size: number;
112
- pages?: number;
113
- total?: number;
114
- }
115
- export type ObservationCreateResponse = Array<Observation>;
116
- export type ObservationDeleteResponse = unknown;
117
- export type ObservationQueryResponse = Array<Observation>;
118
- export interface ObservationCreateParams {
119
- observations: Array<ObservationCreate>;
120
- }
121
- export interface ObservationListParams extends PageParams {
122
- /**
123
- * Query param: Whether to reverse the order of results
124
- */
125
- reverse?: boolean | null;
126
- /**
127
- * Body param:
128
- */
129
- filters?: {
130
- [key: string]: unknown;
131
- } | null;
132
- }
133
- export interface ObservationQueryParams {
134
- /**
135
- * Semantic search query
136
- */
137
- query: string;
138
- /**
139
- * Maximum cosine distance threshold for results
140
- */
141
- distance?: number | null;
142
- /**
143
- * Additional filters to apply
144
- */
145
- filters?: {
146
- [key: string]: unknown;
147
- } | null;
148
- /**
149
- * Number of results to return
150
- */
151
- top_k?: number;
152
- }
153
- export declare namespace Observations {
154
- export { type Observation as Observation, type ObservationCreate as ObservationCreate, type ObservationGet as ObservationGet, type ObservationQuery as ObservationQuery, type PageObservation as PageObservation, type ObservationCreateResponse as ObservationCreateResponse, type ObservationDeleteResponse as ObservationDeleteResponse, type ObservationQueryResponse as ObservationQueryResponse, ObservationsPage as ObservationsPage, type ObservationCreateParams as ObservationCreateParams, type ObservationListParams as ObservationListParams, type ObservationQueryParams as ObservationQueryParams, };
155
- }
156
- //# sourceMappingURL=observations.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"observations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,YAAY,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC;CACxC;AAED,MAAM,WAAW,qBAAsB,SAAQ,UAAU;IACvD;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAEzB;;OAEG;IACH,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;CAC7C;AAED,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB;;OAEG;IACH,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;IAE5C;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAID,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EACL,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,gBAAgB,IAAI,gBAAgB,EACpC,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
@@ -1,58 +0,0 @@
1
- "use strict";
2
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.ObservationsPage = exports.Observations = void 0;
5
- const resource_1 = require("../../resource.js");
6
- const core_1 = require("../../core.js");
7
- const pagination_1 = require("../../pagination.js");
8
- class Observations extends resource_1.APIResource {
9
- /**
10
- * Create one or more observations.
11
- *
12
- * Creates observations (theory-of-mind facts) for the specified observer/observed
13
- * peer pairs. Each observation must reference existing peers and a session within
14
- * the workspace. Embeddings are automatically generated for semantic search.
15
- *
16
- * Maximum of 100 observations per request.
17
- */
18
- create(workspaceId, body, options) {
19
- return this._client.post(`/v2/workspaces/${workspaceId}/observations`, { body, ...options });
20
- }
21
- list(workspaceId, params = {}, options) {
22
- if ((0, core_1.isRequestOptions)(params)) {
23
- return this.list(workspaceId, {}, params);
24
- }
25
- const { page, reverse, size, ...body } = params;
26
- return this._client.getAPIList(`/v2/workspaces/${workspaceId}/observations/list`, ObservationsPage, {
27
- query: { page, reverse, size },
28
- body,
29
- method: 'post',
30
- ...options,
31
- });
32
- }
33
- /**
34
- * Delete a specific observation.
35
- *
36
- * This permanently deletes the observation (document) from the theory-of-mind
37
- * system. This action cannot be undone.
38
- */
39
- delete(workspaceId, observationId, options) {
40
- return this._client.delete(`/v2/workspaces/${workspaceId}/observations/${observationId}`, options);
41
- }
42
- /**
43
- * Query observations using semantic search.
44
- *
45
- * Performs vector similarity search on observations to find semantically relevant
46
- * results. Observer and observed are required for semantic search and must be
47
- * provided in filters.
48
- */
49
- query(workspaceId, body, options) {
50
- return this._client.post(`/v2/workspaces/${workspaceId}/observations/query`, { body, ...options });
51
- }
52
- }
53
- exports.Observations = Observations;
54
- class ObservationsPage extends pagination_1.Page {
55
- }
56
- exports.ObservationsPage = ObservationsPage;
57
- Observations.ObservationsPage = ObservationsPage;
58
- //# sourceMappingURL=observations.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"observations.js","sourceRoot":"","sources":["../../src/resources/workspaces/observations.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,gDAA6C;AAC7C,wCAA8C;AAE9C,oDAAyD;AAEzD,MAAa,YAAa,SAAQ,sBAAW;IAC3C;;;;;;;;OAQG;IACH,MAAM,CACJ,WAAmB,E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OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
- import { APIResource } from "../../resource.mjs";
3
- import { isRequestOptions } from "../../core.mjs";
4
- import { Page } from "../../pagination.mjs";
5
- export class Observations extends APIResource {
6
- /**
7
- * Create one or more observations.
8
- *
9
- * Creates observations (theory-of-mind facts) for the specified observer/observed
10
- * peer pairs. Each observation must reference existing peers and a session within
11
- * the workspace. Embeddings are automatically generated for semantic search.
12
- *
13
- * Maximum of 100 observations per request.
14
- */
15
- create(workspaceId, body, options) {
16
- return this._client.post(`/v2/workspaces/${workspaceId}/observations`, { body, ...options });
17
- }
18
- list(workspaceId, params = {}, options) {
19
- if (isRequestOptions(params)) {
20
- return this.list(workspaceId, {}, params);
21
- }
22
- const { page, reverse, size, ...body } = params;
23
- return this._client.getAPIList(`/v2/workspaces/${workspaceId}/observations/list`, ObservationsPage, {
24
- query: { page, reverse, size },
25
- body,
26
- method: 'post',
27
- ...options,
28
- });
29
- }
30
- /**
31
- * Delete a specific observation.
32
- *
33
- * This permanently deletes the observation (document) from the theory-of-mind
34
- * system. This action cannot be undone.
35
- */
36
- delete(workspaceId, observationId, options) {
37
- return this._client.delete(`/v2/workspaces/${workspaceId}/observations/${observationId}`, options);
38
- }
39
- /**
40
- * Query observations using semantic search.
41
- *
42
- * Performs vector similarity search on observations to find semantically relevant
43
- * results. Observer and observed are required for semantic search and must be
44
- * provided in filters.
45
- */
46
- query(workspaceId, body, options) {
47
- return this._client.post(`/v2/workspaces/${workspaceId}/observations/query`, { body, ...options });
48
- }
49
- }
50
- export class ObservationsPage extends Page {
51
- }
52
- Observations.ObservationsPage = ObservationsPage;
53
- //# sourceMappingURL=observations.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"observations.mjs","sourceRoot":"","sources":["../../src/resources/workspaces/observations.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;OAEpB,EAAE,IAAI,EAAmB;AAEhC,MAAM,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,CAAC"}
@@ -1,51 +0,0 @@
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 Keys extends APIResource {
8
- /**
9
- * Create a new Key
10
- */
11
- create(params?: KeyCreateParams, options?: Core.RequestOptions): Core.APIPromise<unknown>;
12
- create(options?: Core.RequestOptions): Core.APIPromise<unknown>;
13
- create(
14
- params: KeyCreateParams | Core.RequestOptions = {},
15
- options?: Core.RequestOptions,
16
- ): Core.APIPromise<unknown> {
17
- if (isRequestOptions(params)) {
18
- return this.create({}, params);
19
- }
20
- const { expires_at, peer_id, session_id, workspace_id } = params;
21
- return this._client.post('/v2/keys', {
22
- query: { expires_at, peer_id, session_id, workspace_id },
23
- ...options,
24
- });
25
- }
26
- }
27
-
28
- export type KeyCreateResponse = unknown;
29
-
30
- export interface KeyCreateParams {
31
- expires_at?: string | null;
32
-
33
- /**
34
- * ID of the peer to scope the key to
35
- */
36
- peer_id?: string | null;
37
-
38
- /**
39
- * ID of the session to scope the key to
40
- */
41
- session_id?: string | null;
42
-
43
- /**
44
- * ID of the workspace to scope the key to
45
- */
46
- workspace_id?: string | null;
47
- }
48
-
49
- export declare namespace Keys {
50
- export { type KeyCreateResponse as KeyCreateResponse, type KeyCreateParams as KeyCreateParams };
51
- }
@@ -1,238 +0,0 @@
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
- * Create one or more observations.
11
- *
12
- * Creates observations (theory-of-mind facts) for the specified observer/observed
13
- * peer pairs. Each observation must reference existing peers and a session within
14
- * the workspace. Embeddings are automatically generated for semantic search.
15
- *
16
- * Maximum of 100 observations per request.
17
- */
18
- create(
19
- workspaceId: string,
20
- body: ObservationCreateParams,
21
- options?: Core.RequestOptions,
22
- ): Core.APIPromise<ObservationCreateResponse> {
23
- return this._client.post(`/v2/workspaces/${workspaceId}/observations`, { body, ...options });
24
- }
25
-
26
- /**
27
- * List all observations using custom filters. Observations are listed by recency
28
- * unless `reverse` is set to `true`.
29
- *
30
- * Observations can be filtered by session_id, observer_id and observed_id using
31
- * the filters parameter.
32
- */
33
- list(
34
- workspaceId: string,
35
- params?: ObservationListParams,
36
- options?: Core.RequestOptions,
37
- ): Core.PagePromise<ObservationsPage, Observation>;
38
- list(workspaceId: string, options?: Core.RequestOptions): Core.PagePromise<ObservationsPage, Observation>;
39
- list(
40
- workspaceId: string,
41
- params: ObservationListParams | Core.RequestOptions = {},
42
- options?: Core.RequestOptions,
43
- ): Core.PagePromise<ObservationsPage, Observation> {
44
- if (isRequestOptions(params)) {
45
- return this.list(workspaceId, {}, params);
46
- }
47
- const { page, reverse, size, ...body } = params;
48
- return this._client.getAPIList(`/v2/workspaces/${workspaceId}/observations/list`, ObservationsPage, {
49
- query: { page, reverse, size },
50
- body,
51
- method: 'post',
52
- ...options,
53
- });
54
- }
55
-
56
- /**
57
- * Delete a specific observation.
58
- *
59
- * This permanently deletes the observation (document) from the theory-of-mind
60
- * system. This action cannot be undone.
61
- */
62
- delete(
63
- workspaceId: string,
64
- observationId: string,
65
- options?: Core.RequestOptions,
66
- ): Core.APIPromise<unknown> {
67
- return this._client.delete(`/v2/workspaces/${workspaceId}/observations/${observationId}`, options);
68
- }
69
-
70
- /**
71
- * Query observations using semantic search.
72
- *
73
- * Performs vector similarity search on observations to find semantically relevant
74
- * results. Observer and observed are required for semantic search and must be
75
- * provided in filters.
76
- */
77
- query(
78
- workspaceId: string,
79
- body: ObservationQueryParams,
80
- options?: Core.RequestOptions,
81
- ): Core.APIPromise<ObservationQueryResponse> {
82
- return this._client.post(`/v2/workspaces/${workspaceId}/observations/query`, { body, ...options });
83
- }
84
- }
85
-
86
- export class ObservationsPage extends Page<Observation> {}
87
-
88
- /**
89
- * Observation response - external view of a document
90
- */
91
- export interface Observation {
92
- id: string;
93
-
94
- content: string;
95
-
96
- created_at: string;
97
-
98
- /**
99
- * The peer being observed
100
- */
101
- observed_id: string;
102
-
103
- /**
104
- * The peer who made the observation
105
- */
106
- observer_id: string;
107
-
108
- session_id: string;
109
- }
110
-
111
- /**
112
- * Schema for creating a single observation
113
- */
114
- export interface ObservationCreate {
115
- content: string;
116
-
117
- /**
118
- * The peer being observed
119
- */
120
- observed_id: string;
121
-
122
- /**
123
- * The peer making the observation
124
- */
125
- observer_id: string;
126
-
127
- /**
128
- * The session this observation relates to
129
- */
130
- session_id: string;
131
- }
132
-
133
- /**
134
- * Schema for listing observations with optional filters
135
- */
136
- export interface ObservationGet {
137
- filters?: { [key: string]: unknown } | null;
138
- }
139
-
140
- /**
141
- * Query parameters for semantic search of observations
142
- */
143
- export interface ObservationQuery {
144
- /**
145
- * Semantic search query
146
- */
147
- query: string;
148
-
149
- /**
150
- * Maximum cosine distance threshold for results
151
- */
152
- distance?: number | null;
153
-
154
- /**
155
- * Additional filters to apply
156
- */
157
- filters?: { [key: string]: unknown } | null;
158
-
159
- /**
160
- * Number of results to return
161
- */
162
- top_k?: number;
163
- }
164
-
165
- export interface PageObservation {
166
- items: Array<Observation>;
167
-
168
- page: number;
169
-
170
- size: number;
171
-
172
- pages?: number;
173
-
174
- total?: number;
175
- }
176
-
177
- export type ObservationCreateResponse = Array<Observation>;
178
-
179
- export type ObservationDeleteResponse = unknown;
180
-
181
- export type ObservationQueryResponse = Array<Observation>;
182
-
183
- export interface ObservationCreateParams {
184
- observations: Array<ObservationCreate>;
185
- }
186
-
187
- export interface ObservationListParams extends PageParams {
188
- /**
189
- * Query param: Whether to reverse the order of results
190
- */
191
- reverse?: boolean | null;
192
-
193
- /**
194
- * Body param:
195
- */
196
- filters?: { [key: string]: unknown } | null;
197
- }
198
-
199
- export interface ObservationQueryParams {
200
- /**
201
- * Semantic search query
202
- */
203
- query: string;
204
-
205
- /**
206
- * Maximum cosine distance threshold for results
207
- */
208
- distance?: number | null;
209
-
210
- /**
211
- * Additional filters to apply
212
- */
213
- filters?: { [key: string]: unknown } | null;
214
-
215
- /**
216
- * Number of results to return
217
- */
218
- top_k?: number;
219
- }
220
-
221
- Observations.ObservationsPage = ObservationsPage;
222
-
223
- export declare namespace Observations {
224
- export {
225
- type Observation as Observation,
226
- type ObservationCreate as ObservationCreate,
227
- type ObservationGet as ObservationGet,
228
- type ObservationQuery as ObservationQuery,
229
- type PageObservation as PageObservation,
230
- type ObservationCreateResponse as ObservationCreateResponse,
231
- type ObservationDeleteResponse as ObservationDeleteResponse,
232
- type ObservationQueryResponse as ObservationQueryResponse,
233
- ObservationsPage as ObservationsPage,
234
- type ObservationCreateParams as ObservationCreateParams,
235
- type ObservationListParams as ObservationListParams,
236
- type ObservationQueryParams as ObservationQueryParams,
237
- };
238
- }