()
| 287 | } |
| 288 | |
| 289 | function vectorQuerySql(): string { |
| 290 | return ` |
| 291 | select |
| 292 | id, |
| 293 | doc_path as docPath, |
| 294 | title, |
| 295 | heading, |
| 296 | content |
| 297 | from chunks |
| 298 | order by vec_distance_cosine(embedding, vec_f32(?)) asc |
| 299 | limit ? |
| 300 | ` |
| 301 | } |
| 302 | |
| 303 | function payloadToText(payload: unknown): string { |
| 304 | if (typeof payload === `string`) { |