Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Resolves failing Foundry samples by replacing hardcoded project endpoint and model values with environment variable reads.
41% 86%+45 ptsof test cases passed
Passed 19 of 22 test cases with the skill, and 9 of 22 without it.
3 of 3 safety checks passed
Not used yet
Some samples (notably those under 01-get-started) hardcode the Foundry
project endpoint and model directly in the FoundryChatClient constructor
using placeholder values, for example:
client = FoundryChatClient(
project_endpoint="https://your-project.services.ai.azure.com",
model="gpt-4o",
credential=AzureCliCredential(),
)
These placeholder values are not real and the sample cannot run as written. The validation environment provides the real values through environment variables, so the sample must read them from the environment instead.
When you detect a hardcoded/placeholder project_endpoint (or model) that
is causing the sample to fail with missing or invalid setup:
project_endpoint value with a read from the
FOUNDRY_PROJECT_ENDPOINT environment variable.model value with a read from the FOUNDRY_MODEL
environment variable.import os is present at the top of the file.The corrected constructor should look like:
import os
client = FoundryChatClient(
project_endpoint=os.environ["FOUNDRY_PROJECT_ENDPOINT"],
model=os.environ["FOUNDRY_MODEL"],
credential=AzureCliCredential(),
)
These samples are intentionally written with hardcoded placeholders, so this
Next to this one in the catalogue, plus more from the same author.