You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the clients allow some flexibility for accepting single values or multiple values in a few different contexts. For example, the method to add records supports supplying an single string or an array of strings for the ids field. This is nice but it can lead to unintuitive code IMO:
addRecords(collection,{ids: "record_id",// <= this looks surprising since this field is called "ids"embeddings: [1,2,3],})
Describe the proposed solution
One potential solution would be to allow the request params object to be one of a couple of different flavors:
This would give clients more structure so they would get type errors if they attempted to pass in, for example an array of ids, but a single embedding. It also just leads to more readable code IMO.
This change would apply to both the add/update/upsert methods as well as the query methods.
Alternatives considered
One alternative here would be to add singular convenience methods, e.g. addRecord() which only accepts the single record add variant.
Importance
nice to have
Additional Information
No response
The text was updated successfully, but these errors were encountered:
Describe the problem
Currently, the clients allow some flexibility for accepting single values or multiple values in a few different contexts. For example, the method to add records supports supplying an single string or an array of strings for the
ids
field. This is nice but it can lead to unintuitive code IMO:Describe the proposed solution
One potential solution would be to allow the request params object to be one of a couple of different flavors:
This would give clients more structure so they would get type errors if they attempted to pass in, for example an array of ids, but a single embedding. It also just leads to more readable code IMO.
This change would apply to both the add/update/upsert methods as well as the query methods.
Alternatives considered
One alternative here would be to add singular convenience methods, e.g.
addRecord()
which only accepts the single record add variant.Importance
nice to have
Additional Information
No response
The text was updated successfully, but these errors were encountered: