From 352e761577c430907ba3fce95e0d8d25eda636e7 Mon Sep 17 00:00:00 2001 From: Rohit Prasad Date: Mon, 7 Oct 2024 17:54:37 -0700 Subject: [PATCH] Update README.md Added note on adding support for a new provider. --- README.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8ee4ecb9..4fbff44a 100644 --- a/README.md +++ b/README.md @@ -88,4 +88,29 @@ the code for both commercial and non-commercial purposes. If you would like to contribute, please read our [Contributing Guide](CONTRIBUTING.md) - +## Adding support for a provider +We have made easy for a provider or volunteer to add support for a new platform. +### Naming Convention for Provider Modules + +A convention-based approach is followed for loading providers, which relies on strict naming conventions for both the module name and the class name. The format to follow is based on the model identifier in the form of `provider:model`. + +- The provider's module file must be named in the format `_provider.py`. +- The class inside this module must follow the format: the provider name with the first letter capitalized, followed by the suffix `Provider`. + +#### Examples: + +- **AWS**: + The provider class should be defined as: + ```python + class AwsProvider(BaseProvider) + ``` + in providers/aws_provider.py. + +- **OpenAI**: + The provider class should be defined as: + ```python + class OpenaiProvider(BaseProvider) + ``` + in providers/openai_provider.py + +This convention simplifies the addition of new providers and ensures consistency across provider implementations.