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

Proposal: Unified Provider Configuration Management #1114

Open
DAAE-Na-Yunchae opened this issue Feb 6, 2025 · 1 comment
Open

Proposal: Unified Provider Configuration Management #1114

DAAE-Na-Yunchae opened this issue Feb 6, 2025 · 1 comment

Comments

@DAAE-Na-Yunchae
Copy link
Contributor

DAAE-Na-Yunchae commented Feb 6, 2025

Provider Configuration Enhancement

Is your feature request related to a problem? Please describe.
There are two main issues with the current configuration management:

  1. Another provider (Azure OpenAI) settings are scattered between environment variables and config override files, making management complex.
  2. The JSON-based configuration approach lacks type safety and flexibility.

Describe the solution you'd like

I propose two possible improvements:

ex1) Unified Azure OpenAI Configuration:

{
    "AZURE_OPENAI": {
        "API_VERSION": "2024-08-01-preview",
        "ENDPOINT": "your-endpoint",
        "API_KEY": "your-api-key"
        "EMBEDDING": "azure_openai:embedding-3-large"
    },
    "RETRIEVER": "tavily",
}

ex2) Type-safe Functional Configuration Approach:

@dataclass
class AzureOpenAIConfig:
    api_version: str
    endpoint: str
    api_key: str

@dataclass
class AppConfig:
    azure_openai: AzureOpenAIConfig
    retriever: str
    embedding: str
    # ... other settings

def configure_app(config: AppConfig) -> None:
    pass

Describe alternatives you've considered

  1. Maintaining the current environment variables approach
  2. Creating a separate Azure OpenAI configuration file
  3. Using the Builder pattern for configuration setup

Additional context

Benefits of the functional approach:

  • Type safety and IDE autocompletion
  • Configuration error detection before runtime
  • Easier dependency management between settings
  • Improved testability
  • Gradual adoption possible for backward compatibility with existing configuration methods
@ElishaKay
Copy link
Collaborator

Welcome @DAAE-Na-Yunchae

Sounds interesting

Happy to see the PR for what you have in mind

Also looping in @kga245 who laid the groundwork for the JSON config files & @danieldekay who's been polishing the Azure OpenAI support as we go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants