Function
cosineDistance
(
column: SQLWrapper | AnyColumn,
value: number[] | string[] | TypedQueryBuilder<any> | string,
)
Source from the content-addressed store, hash-verified
| 123 | * ``` |
| 124 | */ |
| 125 | export function cosineDistance( |
| 126 | column: SQLWrapper | AnyColumn, |
| 127 | value: number[] | string[] | TypedQueryBuilder<any> | string, |
| 128 | ): SQL { |
| 129 | if (Array.isArray(value)) { |
| 130 | return sql`${column} <=> ${toSql(value)}`; |
| 131 | } |
| 132 | return sql`${column} <=> ${value}`; |
| 133 | } |
| 134 | |
| 135 | /** |
| 136 | * Hamming distance between two strings or vectors of equal length is the number of positions at which the |
Callers
nothing calls this directly
Tested by
no test coverage detected