Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions python/samples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@ Individual sample READMEs and PEP 723 metadata list any additional packages.

### Environment Variables

Samples call `load_dotenv()` to automatically load environment variables from a `.env` file in the `python/` directory. This is a convenience for local development and testing.
Environment setup varies by sample. The [getting-started samples](./01-get-started/README.md#prerequisites) pass
example `project_endpoint` and `model` values directly to `FoundryChatClient`; replace those values before
running them. Setting environment variables alone does not override these explicit constructor arguments.

For samples that call `load_dotenv()`, a `.env` file in the `python/` directory is a convenient way to load
environment variables for local development and testing.

**For local development**, set up your environment using any of these methods:

Expand Down Expand Up @@ -96,7 +101,9 @@ precedence is:
If you keep both OpenAI and Azure variables in your shell, the generic clients stay on OpenAI until
you pass an explicit Azure input.

For the getting-started samples, you'll need at minimum:
To use these environment variables in the getting-started samples, first remove the explicit `project_endpoint`
and `model` arguments from the client constructor. For the `.env` setup in Option 1, also call `load_dotenv()`
before creating the client:
```bash
FOUNDRY_PROJECT_ENDPOINT="your-foundry-project-endpoint"
FOUNDRY_MODEL="gpt-4o"
Expand Down
Loading