From 246dc051f11eb072dc0dacd9f2cc6b43ab19cb31 Mon Sep 17 00:00:00 2001 From: Marut Pandya Date: Wed, 7 May 2025 16:39:02 -0700 Subject: [PATCH] Create README.md --- examples/env_vars/README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 examples/env_vars/README.md diff --git a/examples/env_vars/README.md b/examples/env_vars/README.md new file mode 100644 index 0000000..9fea093 --- /dev/null +++ b/examples/env_vars/README.md @@ -0,0 +1,29 @@ +### Auto Environment Loading for ServerlessResource +## Overview +The `ServerlessResource` class automatically loads environment variables from your .env file, simplifying configuration management for serverless deployments. +Features + +- ***Zero-configuration***: Environment variables load automatically when creating a ServerlessResource +- ***Override capability***: Custom environment variables can still be provided when needed +- ***Simple integration***: Works with existing .env file. + + +```python +# Create with auto-loaded environment variables +resource = ServerlessResource( + name="inference-api", + templateId="template123" + # env automatically populated from .env file +) +``` + +or + +```python +# You can Override the env vars in config +resource = ServerlessResource( + name="inference-api", + templateId="template123" + env={"CUSTOM_VAR": "custom_value"} +) +```