conare 0.11.0 → 0.12.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/README.md +11 -4
- package/dist/index.d.ts +11 -9
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -69,16 +69,23 @@ Hybrid search (vector and keyword), reranked. One result per document: its best
|
|
|
69
69
|
`score` is the reranker's when `reranked` is true, else the fused rank score of a result past the
|
|
70
70
|
rerank window (or of a query not reranked); the two scales do not compare.
|
|
71
71
|
|
|
72
|
-
Filters match metadata values
|
|
73
|
-
contains). Operators: `$eq` and
|
|
72
|
+
Filters match metadata values: `{ key: value }` means equals (or, for an array value,
|
|
73
|
+
contains). Operators: `$eq`, `$in` and the ranges below. Combine with `$and` and `$or`:
|
|
74
74
|
|
|
75
75
|
```ts
|
|
76
76
|
{ $or: [{ team: "support" }, { year: { $in: [2024, 2025] } }] }
|
|
77
77
|
{ $and: [{ lang: { $in: ["en", "de"] } }, { draft: false }] }
|
|
78
78
|
```
|
|
79
79
|
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
Ranges `$gt $gte $lt $lte` compare a number or string value (not an array item): number bounds
|
|
81
|
+
compare numbers, string bounds compare strings by their UTF-8 bytes, so ISO dates sort as dates.
|
|
82
|
+
|
|
83
|
+
```ts
|
|
84
|
+
{ year: { $gte: 2020, $lt: 2025 } }
|
|
85
|
+
{ published_at: { $gte: "2025-06-01" } }
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
There is no `$ne` or `$nin`: the API answers 400 `invalid_filter`.
|
|
82
89
|
|
|
83
90
|
### Embed and rerank
|
|
84
91
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,26 +1,28 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.12.0";
|
|
2
2
|
/** A metadata value: string, number, boolean or an array of strings. */
|
|
3
3
|
export type MetadataValue = string | number | boolean | string[];
|
|
4
4
|
export type Metadata = Record<string, MetadataValue>;
|
|
5
5
|
type Scalar = string | number | boolean;
|
|
6
6
|
/**
|
|
7
|
-
* Operators for one metadata key: `$eq` and `$
|
|
8
|
-
*
|
|
7
|
+
* Operators for one metadata key: `$eq`, `$in` and the ranges `$gt` `$gte` `$lt` `$lte`. A range
|
|
8
|
+
* compares a number or string value (not an array item): number bounds compare numbers, string
|
|
9
|
+
* bounds compare strings by their UTF-8 bytes (ISO dates sort as dates). The API answers 400
|
|
10
|
+
* invalid_filter for the operators typed `never` here, so they do not compile.
|
|
9
11
|
*/
|
|
10
12
|
export interface FilterOperators {
|
|
11
13
|
$eq?: Scalar;
|
|
12
14
|
$in?: Scalar[];
|
|
15
|
+
$gt?: number | string;
|
|
16
|
+
$gte?: number | string;
|
|
17
|
+
$lt?: number | string;
|
|
18
|
+
$lte?: number | string;
|
|
13
19
|
$ne?: never;
|
|
14
20
|
$nin?: never;
|
|
15
|
-
$gt?: never;
|
|
16
|
-
$gte?: never;
|
|
17
|
-
$lt?: never;
|
|
18
|
-
$lte?: never;
|
|
19
21
|
}
|
|
20
22
|
/**
|
|
21
23
|
* A metadata filter. `{ team: "support" }` means equals (or, for an array value, contains);
|
|
22
|
-
* use `$eq` / `$in` per key and `$and` / `$or` to combine:
|
|
23
|
-
* `{ $or: [{ team: "support" }, { year: { $
|
|
24
|
+
* use `$eq` / `$in` / ranges per key and `$and` / `$or` to combine:
|
|
25
|
+
* `{ $or: [{ team: "support" }, { year: { $gte: 2024 } }] }`.
|
|
24
26
|
*/
|
|
25
27
|
export interface Filter {
|
|
26
28
|
$and?: Filter[];
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// conare: TypeScript client for the Conare API. Zero dependencies; uses global fetch.
|
|
2
|
-
export const VERSION = "0.
|
|
2
|
+
export const VERSION = "0.12.0";
|
|
3
3
|
const DEFAULT_BASE_URL = "https://api.conare.ai";
|
|
4
4
|
const BATCH_SIZE = 100;
|
|
5
5
|
// ---- Errors ----------------------------------------------------------------
|