Commit c9246ac
committed
fix(langchain): sort similarity_search() results by distance + tighten test
- Sort vector_search results client-side by r.distance (ascending) to
match the public contract promised in the docstring
- Replace isinstance(results, list) with results == [] assertion to
explicitly enforce the empty-vector guard contract1 parent 7c4d4c0 commit c9246ac
2 files changed
Lines changed: 9 additions & 6 deletions
File tree
- langchain-coordinode/langchain_coordinode
- tests/integration/adapters
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
227 | 230 | | |
228 | 231 | | |
229 | 232 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
| 171 | + | |
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| |||
0 commit comments