@weaviate/agents 0.0.0 → 1.9.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.
@@ -136,6 +136,7 @@ it("runs the query agent ask", () => __awaiter(void 0, void 0, void 0, function*
136
136
  },
137
137
  },
138
138
  uuid_value: "e6dc0a31-76f8-4bd3-b563-677ced6eb557",
139
+ tenant: "tenant_a",
139
140
  },
140
141
  ],
141
142
  aggregations: [],
@@ -152,6 +153,7 @@ it("runs the query agent ask", () => __awaiter(void 0, void 0, void 0, function*
152
153
  {
153
154
  object_id: "123",
154
155
  collection: "test-collection",
156
+ tenant: "tenant_a",
155
157
  },
156
158
  ],
157
159
  };
@@ -198,6 +200,7 @@ it("runs the query agent ask", () => __awaiter(void 0, void 0, void 0, function*
198
200
  },
199
201
  },
200
202
  uuidValue: "e6dc0a31-76f8-4bd3-b563-677ced6eb557",
203
+ tenant: "tenant_a",
201
204
  },
202
205
  ],
203
206
  aggregations: [],
@@ -214,6 +217,7 @@ it("runs the query agent ask", () => __awaiter(void 0, void 0, void 0, function*
214
217
  {
215
218
  objectId: "123",
216
219
  collection: "test-collection",
220
+ tenant: "tenant_a",
217
221
  },
218
222
  ],
219
223
  display: expect.any(Function),
@@ -241,6 +245,7 @@ it("search-only mode success: caches searches and sends on subsequent request",
241
245
  collection: "test_collection",
242
246
  sort_property: undefined,
243
247
  uuid_value: undefined,
248
+ tenant: "tenant_a",
244
249
  },
245
250
  {
246
251
  query: undefined,
@@ -21,12 +21,14 @@ export type ApiSearch = {
21
21
  collection: string;
22
22
  sort_property?: ApiQuerySort;
23
23
  uuid_value?: string;
24
+ tenant?: string;
24
25
  };
25
26
  export type ApiAggregation = {
26
27
  groupby_property?: string;
27
28
  aggregation: ApiPropertyAggregation;
28
29
  filters?: ApiPropertyFilter | ApiFilterAndOr;
29
30
  collection: string;
31
+ tenant?: string;
30
32
  };
31
33
  export type ApiFilterAndOr = {
32
34
  combine: "AND" | "OR";
@@ -172,6 +174,7 @@ export type ApiUsage = {
172
174
  export type ApiSource = {
173
175
  object_id: string;
174
176
  collection: string;
177
+ tenant?: string;
175
178
  };
176
179
  export type ApiReturnMetadata = {
177
180
  creation_time: Date | null;
@@ -13,6 +13,7 @@ export function mapAskModeResponse(response, outputFormat) {
13
13
  aggregation: mapPropertyAggregation(aggregation.aggregation),
14
14
  filters: aggregation.filters ? mapFilter(aggregation.filters) : undefined,
15
15
  collection: aggregation.collection,
16
+ tenant: aggregation.tenant,
16
17
  })),
17
18
  usage: mapUsage(response.usage),
18
19
  totalTime: response.total_time,
@@ -39,6 +40,7 @@ const mapSearches = (searches) => searches.map((search) => ({
39
40
  ? mapQuerySort(search.sort_property)
40
41
  : undefined,
41
42
  uuidValue: search.uuid_value,
43
+ tenant: search.tenant,
42
44
  }));
43
45
  const mapQuerySort = (sort) => ({
44
46
  propertyName: sort.property_name,
@@ -229,6 +231,7 @@ const mapPropertyAggregation = (aggregation) => ({
229
231
  const mapSources = (sources) => sources.map((source) => ({
230
232
  objectId: source.object_id,
231
233
  collection: source.collection,
234
+ tenant: source.tenant,
232
235
  }));
233
236
  const display = (response) => {
234
237
  console.log(JSON.stringify(response, undefined, 2));
@@ -38,12 +38,14 @@ export type Search = {
38
38
  collection: string;
39
39
  sortProperty?: QuerySort;
40
40
  uuidValue?: string;
41
+ tenant?: string;
41
42
  };
42
43
  export type Aggregation = {
43
44
  groupbyProperty?: string;
44
45
  aggregation: PropertyAggregation;
45
46
  filters?: PropertyFilter | FilterAndOr;
46
47
  collection: string;
48
+ tenant?: string;
47
49
  };
48
50
  export type FilterAndOr = {
49
51
  combine: "AND" | "OR";
@@ -259,6 +261,7 @@ export type Usage = {
259
261
  export type Source = {
260
262
  objectId: string;
261
263
  collection: string;
264
+ tenant?: string;
262
265
  };
263
266
  export type QueryWithCollection = {
264
267
  query: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@weaviate/agents",
3
- "version": "0.0.0",
3
+ "version": "1.9.0",
4
4
  "description": "JS/TS client for Weaviate Agents",
5
5
  "exports": "./dist/index.js",
6
6
  "type": "module",