-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.Net: Using the VectorStoreGenericDataModel when the Key data type is unknown at compile time #9701
Comments
Thanks for the scenario @f2bo, we haven't really considered it before. var collection = vectorStore.GetCollection<object, VectorStoreGenericDataModel<object>>(collectionName, vectorStoreRecordDefinition); Note that if the object key = 5;
await collection.GetAsync(key); We would need to do some prototyping on this, and add support in each vector store implementation, but let us know if this would work for your use case. |
I hadn't used the generic data model before and only just started experimenting with an idea when I noticed this problem, so it's too early to tell. It does feel less robust but I imagine that it would work. I'll report back if I find that using object is impractical. Thank you! |
@f2bo, did you also have another solution in mind or do you just mean object is less robust than using the strongly typed key types? |
Sorry. Don't attach too much weight to my comment. I did mean it felt less robust than using a strongly typed key type but I suppose that given that the data type is determined at runtime, you probably can't do better than this. As I said, I don't yet have a complete picture of where I'm going with this. |
Assume a scenario where the vector store record definitions are loaded from a a configuration file. For example:
This file is read at runtime to create a
VectorStoreRecordDefinition
for a given collection. Notice that theKey
property has different data types for each collection,string
andint
respectively.Once a record definition has been created, it's time to operate on the corresponding collection. The generic data model is meant to be used in scenarios where the database schema is unknown at compile time. However, it's key data type needs to be known at compile time.
How do you use it when the key data type needs to be specified at runtime. Is there a pattern that you recommend in such a scenario?
The text was updated successfully, but these errors were encountered: