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
{{ message }}
Repository navigation
.Net: [MEVD] Make store/collection options mutable #11715
Connectors have option bag types for the store and collection levels. In some connectors, these are mutable (e.g. WeaviateVectorStoreOptions), while in others they're immutable (e.g. PostgresVectorStoreOptions).
The immutable types present certain challenges. For example, in #10492 (see #11682 (comment) specifically), we're making the connector DI methods look up IEmbeddingGenerator in DI, and add it to the vector store options; but if the user also provides e.g. a PostgresVectorStoreOptions, we can't inject the resolved IEmbeddingGenerator into it, since the type is immutable.
We could add copy constructors to all the option types to work around this; but it may be simpler to just make the types mutable, as they're nothing more than option bags. This would mean that we need to copy the contents into the connector when initializing, rather than simply referencing the options instance, in case the user later mutates the option bag.
Regardless what we decide, it's probably a good idea to do a pass and make things consistent across the connectors.
changed the title [-][MEVD] Consider making store/collection options mutable (align for consistency in any case)[/-][+].Net: [MEVD] Consider making store/collection options mutable (align for consistency in any case)[/+]on Apr 24, 2025
changed the title [-].Net: [MEVD] Consider making store/collection options mutable (align for consistency in any case)[/-][+].Net: [MEVD] Make store/collection options mutable[/+]on May 6, 2025
Activity
[-][MEVD] Consider making store/collection options mutable (align for consistency in any case)[/-][+].Net: [MEVD] Consider making store/collection options mutable (align for consistency in any case)[/+]roji commentedon Apr 25, 2025
See this discussion on whether it's OK for the DI methods to override user-provided options with an DI-injected embedding generator.
[-].Net: [MEVD] Consider making store/collection options mutable (align for consistency in any case)[/-][+].Net: [MEVD] Make store/collection options mutable[/+]Make MEVD store/collection option bags mutable
Make MEVD store/collection option bags mutable (#11911)
Copy store/collection options to protect against mutation
Copy store/collection options to protect against mutation (#11915)