Skip to content

.Net: [MEVD] Make store/collection options mutable #11715

Description

@roji

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.

/cc westey (@westey-m) Dmytro Struk (@dmytrostruk) Adam Sitnik (@adamsitnik)

Activity

  1. added
    .NETIssue or Pull requests regarding .NET code
    BuildFeatures planned for next Build conference
    msft.ext.vectordataRelated to Microsoft.Extensions.VectorData
    on Apr 24, 2025
  2. 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
  3. roji commented on Apr 25, 2025

    @roji
    MemberAuthor

    See this discussion on whether it's OK for the DI methods to override user-provided options with an DI-injected embedding generator.

  4. moved this from Backlog to Sprint: In Progress in Semantic Kernelon May 6, 2025
  5. 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
  6. added a commit that references this issue on May 6, 2025
    99b7646
  7. moved this from Sprint: In Progress to Sprint: In Review in Semantic Kernelon May 6, 2025
  8. added a commit that references this issue on May 6, 2025
    0cdbc10
  9. moved this from Sprint: In Review to Sprint: Done in Semantic Kernelon May 6, 2025
  10. moved this from Sprint: Done to Sprint: In Progress in Semantic Kernelon May 6, 2025
  11. added a commit that references this issue on May 6, 2025
    8d5c9d0
  12. moved this from Sprint: In Progress to Sprint: In Review in Semantic Kernelon May 6, 2025
  13. added a commit that references this issue on May 7, 2025
    d34cfce
  14. moved this from Sprint: In Review to Sprint: Done in Semantic Kernelon May 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

.NETIssue or Pull requests regarding .NET codeBuildFeatures planned for next Build conferencemsft.ext.vectordataRelated to Microsoft.Extensions.VectorDatatriage

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions