Skip to content

Python: Use Pydantic for configuration #131

@AdityaGudimella

Description

@AdityaGudimella

We have a few configuration classes in the python version like BackendConfig, OpenAIConfig, AzureOpenAIConfig etc. We perform operations like loading these configs from .env files using helper methods like utils.settings::openai_settings_from_dot_env etc. We also have a class named Verify that verifies config values like checking that a value is not None etc. Pydantic is a popular open-source library that is particularly used in such cases. All the above mentioned functionality is built into Pydantic. I propose that we use pydantic for our configuration and replace the Verify class and the helper functions like utils.settings::openai_settings_from_dot_env with pydantic functions.

What are your thoughts on this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    kernelIssues or pull requests impacting the core kernelpythonPull requests for the Python Semantic Kernel

    Type

    No type

    Projects

    Status

    Sprint: Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions