Skip to content

Swap order of IServiceProvider/IChatClient to ChatClientBuilder delegate? #5660

@stephentoub

Description

@stephentoub

ChatClientBuilder now has the following overloads:

public ChatClientBuilder Use(Func<IChatClient, IChatClient> clientFactory)
public ChatClientBuilder Use(Func<IServiceProvider, IChatClient, IChatClient> clientFactory)

Shouldn't the order of IServiceProvider and IChatClient be swapped in the second one? Effectively the IServiceProvider is an optional argument to the factory delegate, and such arguments typically come later than the required ones. I realize there are other components in the DI ecosystem that accept the args in this order, but that feels wrong to me, too.

Same for the embedding generator.

cc: @SteveSandersonMS

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions