Skip to content

Commit 838fd6e

Browse files
committed
Added RESP2 and RESP3 return information
1 parent c91a8e6 commit 838fd6e

File tree

6 files changed

+126
-24
lines changed

6 files changed

+126
-24
lines changed

content/commands/vemb/index.md

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ Return the approximate vector associated with a given element in the vector set.
2424

2525
```shell
2626
VEMB word_embeddings SQL
27-
```
28-
29-
```text
3027
1) "0.18208661675453186"
3128
2) "0.08535309880971909"
3229
3) "0.1365649551153183"
@@ -41,18 +38,12 @@ To retrieve the raw internal representation, use the `RAW` option:
4138

4239
```shell
4340
VEMB word_embeddings apple RAW
41+
1) int8
42+
2) "\xf1\xdc\xfd\x1e\xcc%E...\xde\x1f\xfbN" # artificially shortened for this example
43+
3) "3.1426539421081543"
44+
4) "0.17898885905742645"
4445
```
4546

46-
This returns an array with the following:
47-
48-
1. The quantization type: `fp32`, `bin`, or `q8`.
49-
2. A string blob with raw data:
50-
- 4-byte floats for `fp32`
51-
- A bitmap for binary quantization
52-
- A byte array for `q8`
53-
3. The L2 norm of the vector before normalization.
54-
4. *(Only for `q8`)*: The quantization range. Multiply this by integer components to recover normalized values.
55-
5647
## Required arguments
5748

5849
<details open>

content/commands/vgetattr/index.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,6 @@ Return the JSON attributes associated with an element in a vector set.
2626
VGETATTR key element
2727
```
2828

29-
The command returns:
30-
31-
- the JSON string if the element exists and has attributes,
32-
- `null` if the element has no attributes,
33-
- or `null` if the key or element does not exist.
34-
3529
## Required arguments
3630

3731
<details open>

content/commands/vinfo/index.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ Return metadata and internal details about a vector set, including size, dimensi
2424

2525
```shell
2626
VINFO word_embeddings
27-
```
28-
29-
```text
3027
1) quant-type
3128
2) int8
3229
3) vector-dim

content/commands/vsetattr/index.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ To remove attributes, pass an empty JSON string:
3434
VSETATTR key element ""
3535
```
3636

37-
The command returns `1` if the element exists and the attributes were set or updated, or `0` if the key or element does not exist.
38-
3937
## Required arguments
4038

4139
<details open>

data/resp2_replies.json

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,6 +1204,66 @@
12041204
"UNWATCH": [
12051205
"[Simple string reply](../../develop/reference/protocol-spec#simple-strings): `OK`."
12061206
],
1207+
"VADD": [
1208+
"One of the following:",
1209+
"* [Integer reply](../../develop/reference/protocol-spec#integers): 1 if key was added; 0 if key was not added.",
1210+
"* [Simple error reply](../../develop/reference/protocol-spec#simple-errors): if the command was malformed."
1211+
],
1212+
"VCARD": [
1213+
"[Integer reply](../../develop/reference/protocol-spec#integers): 0 if the key doesn't exist or the number of elements contained in the vector set."
1214+
],
1215+
"VDIM": [
1216+
"One of the following:",
1217+
"* [Integer reply](../../develop/reference/protocol-spec#integers): the number of vector set elements.",
1218+
"* [Simple error reply](../../develop/reference/protocol-spec#simple-errors): if the key does not exist."
1219+
],
1220+
"VEMB": [
1221+
"One of the following:",
1222+
"* [Array reply](../../develop/reference/protocol-spec#arrays): of real numbers as [bulk strings](../../develop/reference/protocol-spec#bulk-strings), representing the vector.",
1223+
"* [Array reply](../../develop/reference/protocol-spec#arrays): consisting of the following elements:",
1224+
" 1. The quantization type as a [simple string](../../develop/reference/protocol-spec#simple-strings): `fp32`, `bin`, or `q8`.",
1225+
" 1. A [bulk string](../../develop/reference/protocol-spec#bulk-strings) blob with the following raw data:",
1226+
" * 4-byte floats for fp32",
1227+
" * A bitmap for binary quantization",
1228+
" * A byte array for q8",
1229+
" 1. The L2 norm, as a [simple string](../../develop/reference/protocol-spec#simple-strings), of the vector before normalization.",
1230+
" 1. (Only for q8): The quantization range as a [simple string](../../develop/reference/protocol-spec#simple-strings). Multiply this by integer components to recover normalized values."
1231+
],
1232+
"VGETATTR": [
1233+
"One of the following:",
1234+
"* [Simple string reply](../../develop/reference/protocol-spec#simple-strings) containing the JSON attribute(s).",
1235+
"* [Bulk string reply](../../develop/reference/protocol-spec#bulk-strings) (null bulk string) for unknown key or element, or when no attributes exist for the given key/element pair."
1236+
],
1237+
"VINFO": [
1238+
"One of the following:",
1239+
"* [Array reply](../../develop/reference/protocol-spec#arrays) containing metadata and internal details about a vector set, including size, dimensions, quantization type, and graph structure.",
1240+
"* [Array reply](../../develop/reference/protocol-spec#arrays) (null array reply) for unknown key."
1241+
],
1242+
"VLINKS": [
1243+
"One of the following:",
1244+
"* [Array reply](../../develop/reference/protocol-spec#arrays) containing the names of adjacent elements as [strings](../../develop/reference/protocol-spec#simple-strings); interleved with scores when using the WITHSCORES option.",
1245+
"* [Bulk string reply](../../develop/reference/protocol-spec#bulk-strings) (null bulk string) for unknown keys and/or elements."
1246+
],
1247+
"VRANDMEMBER": [
1248+
"One of the following:",
1249+
"* [Array reply](../../develop/reference/protocol-spec#arrays) containing the names of count random elements as [strings](../../develop/reference/protocol-spec#simple-strings).",
1250+
"* [Bulk string reply](../../develop/reference/protocol-spec#bulk-strings) (null bulk string) for unknown keys.",
1251+
"* [Array reply](../../develop/reference/protocol-spec#arrays) (empty array) for unknown keys when a count is specified."
1252+
],
1253+
"VREM": [
1254+
"[Integer reply](../../develop/reference/protocol-spec#integers): 0 if either element or key do not exist; 1 if the element was removed."
1255+
],
1256+
"VSETATTR": [
1257+
"One of the following:",
1258+
"* [Integer reply](../../develop/reference/protocol-spec#integers): 0 if either the key or element does not exist; 1 if the attributes were successfully added to the element.",
1259+
"* [Simple error reply](develop/reference/protocol-spec/#simple-errors) for improperly specified attribute string."
1260+
],
1261+
"VSIM": [
1262+
"One of the following:",
1263+
"* [Simple error reply](develop/reference/protocol-spec/#simple-errors) for unknown element.",
1264+
"* [Array reply](../../develop/reference/protocol-spec#arrays) (empty array) for unknown key.",
1265+
"* [Array reply](../../develop/reference/protocol-spec#arrays) with matching elements; juxtaposed with scores when used with the WITHSCORES option."
1266+
],
12071267
"WAIT": [
12081268
"[Integer reply](../../develop/reference/protocol-spec#integers): the command returns the number of replicas reached by all the writes performed in the context of the current connection."
12091269
],

data/resp3_replies.json

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,6 +1269,68 @@
12691269
"UNWATCH": [
12701270
"[Simple string reply](../../develop/reference/protocol-spec#simple-strings): `OK`."
12711271
],
1272+
"VADD": [
1273+
"One of the following:",
1274+
"* [Boolean reply](../../develop/reference/protocol-spec#booleans): true if key was added; false if key was not added.",
1275+
"* [Simple error reply](../../develop/reference/protocol-spec#simple-errors): if the command was malformed."
1276+
],
1277+
"VCARD": [
1278+
"[Integer reply](../../develop/reference/protocol-spec#integers): 0 if the key doesn't exist or the number of elements contained in the vector set."
1279+
],
1280+
"VDIM": [
1281+
"One of the following:",
1282+
"* [Integer reply](../../develop/reference/protocol-spec#integers): the number of vector set elements.",
1283+
"* [Simple error reply](../../develop/reference/protocol-spec#simple-errors): if the key does not exist."
1284+
],
1285+
"VEMB": [
1286+
"One of the following:",
1287+
"* [Array reply](../../develop/reference/protocol-spec#arrays): of [doubles](../../develop/reference/protocol-spec#doubles), representing the vector.",
1288+
"* [Array reply](../../develop/reference/protocol-spec#arrays): consisting of the following elements:",
1289+
" 1. The quantization type as a [simple string](../../develop/reference/protocol-spec#simple-strings): `fp32`, `bin`, or `q8`.",
1290+
" 1. A [bulk string](../../develop/reference/protocol-spec#bulk-strings) blob with the following raw data:",
1291+
" * 4-byte floats for fp32",
1292+
" * A bitmap for binary quantization",
1293+
" * A byte array for q8",
1294+
" 1. The [double](../../develop/reference/protocol-spec#doubles) L2 norm of the vector before normalization.",
1295+
" 1. (Only for q8): The quantization range as a [double](../../develop/reference/protocol-spec#doubles). Multiply this by integer components to recover normalized values."
1296+
],
1297+
"VGETATTR": [
1298+
"One of the following:",
1299+
"* [Simple string reply](../../develop/reference/protocol-spec#simple-strings) containing the JSON attribute(s).",
1300+
"* [Null reply](../../develop/reference/protocol-spec#nulls) for unknown key or element, or when no attributes exist for the given key/element pair."
1301+
],
1302+
"VINFO": [
1303+
"One of the following:",
1304+
"* [Array reply](../../develop/reference/protocol-spec#arrays) containing metadata and internal details about a vector set, including size, dimensions, quantization type, and graph structure.",
1305+
"* [Null reply](../../develop/reference/protocol-spec#nulls) for unknown key."
1306+
],
1307+
"VLINKS": [
1308+
"One of the following:",
1309+
"* [Array reply](../../develop/reference/protocol-spec#arrays) containing the names of adjacent elements as [strings](../../develop/reference/protocol-spec#simple-strings) when used without the WITHSCORES option.",
1310+
"* [Map reply](../../develop/reference/protocol-spec#maps) containing the names of adjecent elements as [strings](../../develop/reference/protocol-spec#simple-strings), together with their scores as [doubles](../../develop/reference/protocol-spec#doubles) when used with the WITHSCORES option.",
1311+
"* [Null reply](../../develop/reference/protocol-spec#nulls) for unknown keys and/or elements."
1312+
],
1313+
"VRANDMEMBER": [
1314+
"One of the following:",
1315+
"* [Array reply](../../develop/reference/protocol-spec#arrays) containing the names of *count* random elements as [strings](../../develop/reference/protocol-spec#simple-strings).",
1316+
"* [Null reply](../../develop/reference/protocol-spec#nulls) for unknown keys.",
1317+
"* [Array reply](../../develop/reference/protocol-spec#arrays) (empty array) for unknown keys when a count is specified."
1318+
],
1319+
"VREM": [
1320+
"[Boolean reply](../../develop/reference/protocol-spec#booleans): false if either element or key do not exist; true if the element was removed."
1321+
],
1322+
"VSETATTR": [
1323+
"One of the following:",
1324+
"* [Boolean reply](../../develop/reference/protocol-spec#booleans): false if either the key or element does not exist; true if the attributes were successfully added to the element.",
1325+
"* [Simple error reply](develop/reference/protocol-spec/#simple-errors) for improperly specified attribute string."
1326+
],
1327+
"VSIM": [
1328+
"One of the following:",
1329+
"* [Simple error reply](develop/reference/protocol-spec/#simple-errors) for unknown element.",
1330+
"* [Array reply](../../develop/reference/protocol-spec#arrays) (empty array) for unknown key.",
1331+
"* [Array reply](../../develop/reference/protocol-spec#arrays) with matching elements.",
1332+
"* [Map reply](../../develop/reference/protocol-spec#maps) with matching elements and [double](../../develop/reference/protocol-spec#doubles) scores when used with the WITHSCORES option."
1333+
],
12721334
"WAIT": [
12731335
"[Integer reply](../../develop/reference/protocol-spec#integers): the number of replicas reached by all the writes performed in the context of the current connection."
12741336
],

0 commit comments

Comments
 (0)