vector-js icon indicating copy to clipboard operation
vector-js copied to clipboard

Mandatory vector field causes type errors

Open as-celegen opened this issue 1 year ago • 2 comments

Upsert Command

https://github.com/upstash/vector-js/blob/801c6668fb79ba180cdcf9e21b605dd1d59b15b8/README.md?plain=1#L76-L84 Here it is shown upsert command can be called without the vector or data fields to update the metadata information in the index but this is not compatible with the defined type for argument of the upsert command in: https://github.com/upstash/vector-js/blob/801c6668fb79ba180cdcf9e21b605dd1d59b15b8/src/commands/client/upsert/index.ts#L5-L16 https://github.com/upstash/vector-js/blob/801c6668fb79ba180cdcf9e21b605dd1d59b15b8/src/commands/client/upsert/index.ts#L19-L21

Fetch, Range, Query

Commands fetch, query and range has a field called "includeVector" in their argument to specify whether vector field will be included in their return value. However their returned type specify vector field as always returned.

https://github.com/upstash/vector-js/blob/801c6668fb79ba180cdcf9e21b605dd1d59b15b8/src/commands/client/types.ts#L1-L5

https://github.com/upstash/vector-js/blob/801c6668fb79ba180cdcf9e21b605dd1d59b15b8/src/commands/client/fetch/index.ts#L4-L7 https://github.com/upstash/vector-js/blob/801c6668fb79ba180cdcf9e21b605dd1d59b15b8/src/commands/client/fetch/index.ts#L9

https://github.com/upstash/vector-js/blob/801c6668fb79ba180cdcf9e21b605dd1d59b15b8/src/commands/client/range/index.ts#L4-L9 https://github.com/upstash/vector-js/blob/801c6668fb79ba180cdcf9e21b605dd1d59b15b8/src/commands/client/range/index.ts#L11-L14

https://github.com/upstash/vector-js/blob/801c6668fb79ba180cdcf9e21b605dd1d59b15b8/src/commands/client/query/index.ts#L3-L8 https://github.com/upstash/vector-js/blob/801c6668fb79ba180cdcf9e21b605dd1d59b15b8/src/commands/client/query/index.ts#L10-L15

as-celegen avatar May 05 '24 14:05 as-celegen

Hey,

thanks for the heads up here. We'll prioritize this and solve it as soon as possible.

fahreddinozcan avatar May 05 '24 23:05 fahreddinozcan

Hey, we've fixed the problem with the upsert method. However, there's a problem with the includeVector issue which is caused by TypeScript. We'll work on it and keep you updated.

fahreddinozcan avatar May 13 '24 15:05 fahreddinozcan