-
Notifications
You must be signed in to change notification settings - Fork 201
Commit 85a4955
authored
Bolt 6.0 support with vector types (#1214)
Introduce Bolt 6.0 support, which includes vector types.
Example:
```python
from neo4j.vector import Vector
# Create a vector (raw big-endian byte buffer by default)
v = Vector(b"\x00\x01\x02\x03", "i16")
# or (less performant, but much more user-friendly)
v = Vector.from_native([1, 513], "i16")
# `v` can now be used as query parameter
# Get a vector
v = driver.execute_query(
"MATCH (d:Doc) RETURN d.embedding AS v LIMIT 1",
database_="neo4j",
).records[0]["v"]
# Working with the vector
print(f"Got vector of type {v.dtype} with {len(v)} elements: {v}")
print("raw bytes:", v.raw())
print("python list:", v.to_native())
print("as numpy array:", v.to_numpy())
```1 parent 23f8242 commit 85a4955
File tree
64 files changed
+5946
-48
lines changed- docs/source
- types
- src/neo4j
- _async
- io
- work
- _codec
- hydration
- v1
- v2
- v3
- packstream
- v1
- _optional_deps
- _sync
- io
- work
- time
- testkitbackend
- tests/unit
- async_/io
- common
- codec/hydration
- v1
- v2
- v3
- vector
- work
- sync/io
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
64 files changed
+5946
-48
lines changedLines changed: 4 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
22 | 22 |
| |
23 | 23 |
| |
24 | 24 |
| |
25 | - | ||
25 | + | ||
26 | 26 |
| |
27 | 27 |
| |
28 | 28 |
| |
| |||
345 | 345 |
| |
346 | 346 |
| |
347 | 347 |
| |
348 | + | ||
349 | + | ||
350 | + | ||
348 | 351 |
| |
349 | 352 |
| |
350 | 353 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
9 | 9 |
| |
10 | 10 |
| |
11 | 11 |
| |
12 | + | ||
12 | 13 |
| |
13 | 14 |
| |
14 | 15 |
| |
| |||
36 | 37 |
| |
37 | 38 |
| |
38 | 39 |
| |
40 | + | ||
41 | + | ||
39 | 42 |
| |
40 | 43 |
| |
41 | 44 |
| |
| |||
47 | 50 |
| |
48 | 51 |
| |
49 | 52 |
| |
53 | + | ||
50 | 54 |
| |
51 | 55 |
| |
52 | 56 |
| |
|
Lines changed: 18 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | + | ||
2 | + | ||
3 | + | ||
4 | + | ||
5 | + | ||
6 | + | ||
7 | + | ||
8 | + | ||
9 | + | ||
10 | + | ||
11 | + | ||
12 | + | ||
13 | + | ||
14 | + | ||
15 | + | ||
16 | + | ||
17 | + | ||
18 | + |
Lines changed: 6 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
54 | 54 |
| |
55 | 55 |
| |
56 | 56 |
| |
57 | - | ||
57 | + | ||
58 | 58 |
| |
59 | 59 |
| |
60 | - | ||
60 | + | ||
61 | 61 |
| |
62 | - | ||
62 | + | ||
63 | 63 |
| |
64 | 64 |
| |
65 | 65 |
| |
| |||
207 | 207 |
| |
208 | 208 |
| |
209 | 209 |
| |
210 | - | ||
211 | - | ||
210 | + | ||
211 | + | ||
212 | + | ||
212 | 213 |
| |
213 | 214 |
| |
214 | 215 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
37 | 37 |
| |
38 | 38 |
| |
39 | 39 |
| |
40 | + | ||
40 | 41 |
| |
41 | 42 |
| |
42 | 43 |
| |
|
0 commit comments