Skip to content
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

Add method to select the OpenAI component based on configuration #5789

Merged
merged 25 commits into from
Sep 24, 2024

Conversation

sebastienros
Copy link
Member

@sebastienros sebastienros commented Sep 19, 2024

Fixes #5755
Contributes to #4567
Completes #5621

Microsoft Reviewers: Open in CodeFlow

@sebastienros
Copy link
Member Author

The method name is still an open discussion.

@sebastienros
Copy link
Member Author

Choosing the best name for a method is crucial for clarity and maintainability. Both names you provided have their merits, but let's break them down:
AddOpenAIClientFromConfiguration: This name clearly indicates that the method adds an OpenAI client based on some configuration settings. It's straightforward and tells the user exactly what the method does.
AddAzureOrDefaultOpenAIClient: This name suggests that the method adds an OpenAI client, either from Azure or a default configuration. It implies a fallback mechanism, which might be useful if the primary configuration is not available.
Given these options, I would recommend AddOpenAIClientFromConfiguration. This name is more explicit about the source of the configuration and avoids potential confusion about the fallback mechanism. It keeps the method's purpose clear and concise.

@sebastienros
Copy link
Member Author

/azp run

Copy link

Azure Pipelines could not run because the pipeline triggers exclude this branch/path.

@davidfowl davidfowl added area-integrations Issues pertaining to Aspire Integrations packages azure Issues associated specifically with scenarios tied to using Azure and removed azure Issues associated specifically with scenarios tied to using Azure labels Sep 22, 2024
@eerhardt eerhardt added the azure Issues associated specifically with scenarios tied to using Azure label Sep 23, 2024
@radical
Copy link
Member

radical commented Sep 23, 2024

/azp run

Copy link

Azure Pipelines could not run because the pipeline triggers exclude this branch/path.

@sebastienros
Copy link
Member Author

I validated it's working in eShop.

Base automatically changed from sebros/openai to main September 24, 2024 01:49
@davidfowl davidfowl merged commit 3f38298 into main Sep 24, 2024
11 checks passed
@davidfowl davidfowl deleted the sebros/anyopenai branch September 24, 2024 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-integrations Issues pertaining to Aspire Integrations packages azure Issues associated specifically with scenarios tied to using Azure
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AddOpenAIRestApiClient to wrap both AzureOpenAI and OpenAI integrations
4 participants