eval: Add support for reading from a .env file (#29426)

This PR adds support for the eval to read environment variables from a
`.env` file located in the `crates/eval` directory.

For instance, you can use it to set your Anthropic API key:

```
ANTHROPIC_API_KEY=<secret>
```

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers
2025-04-25 15:53:02 +00:00
committed by GitHub
parent 4f9cadabf7
commit a5405fcbd7
6 changed files with 18 additions and 1 deletions
Generated
+7
View File
@@ -4548,6 +4548,12 @@ dependencies = [
"syn 2.0.100",
]
[[package]]
name = "dotenv"
version = "0.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f"
[[package]]
name = "dotenvy"
version = "0.15.7"
@@ -4970,6 +4976,7 @@ dependencies = [
"collections",
"context_server",
"dirs 5.0.1",
"dotenv",
"env_logger 0.11.8",
"extension",
"fs",