Closed leehuwuj closed 1 month ago
Latest commit: 53531419aa4267caf30a8cb865ab55ffcfdb133c
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
The settings.py
file in the FastAPI streaming template has been refactored to improve the selection logic for the model_provider
. The update replaces the if-elif-else
blocks with a match
statement, enhancing readability and maintainability. Additionally, a new function, init_azure_openai()
, has been introduced to streamline the initialization process for Azure OpenAI models.
File Path | Change Summary |
---|---|
templates/types/streaming/fastapi/... |
Replaced if-elif-else blocks with match statement for model_provider selection. |
templates/types/streaming/fastapi/... |
Added init_azure_openai() function for Azure OpenAI model setup. |
sequenceDiagram
participant User
participant App
participant AzureOpenAI
User->>App: Initialize settings
App->>App: match model_provider
App->>AzureOpenAI: init_azure_openai()
AzureOpenAI-->>App: Azure OpenAI setup complete
App-->>User: Settings initialized
In code, where choices once did dwell,
A match now casts its magic spell,
Azure OpenAI joins the fray,
To brighten up our coding day.
With functions clear and logic neat,
Our streaming app feels quite elite!
🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summary by CodeRabbit
New Features
Refactor
if-elif-else
blocks with a more efficientmatch
statement.