Fixing samples with minor changes. 1. Adding model details for Anthropic, 2. Moving to environment variables for endpoint and deployment details

This commit is contained in:
Chetan Toshniwal
2026-03-30 21:04:07 -07:00
committed by Eduard van Valkenburg
Unverified
parent 95fd5ec658
commit 30920e1f9d
8 changed files with 52 additions and 37 deletions
@@ -1,10 +1,14 @@
# Copyright (c) Microsoft. All rights reserved.
import asyncio
import os
from agent_framework.foundry import FoundryAgent
from azure.identity import AzureCliCredential
from dotenv import load_dotenv
# Load environment variables from .env file
load_dotenv()
"""
Foundry Agent — Connect to a pre-configured agent in Microsoft Foundry
@@ -21,9 +25,9 @@ Environment variables:
async def main() -> None:
agent = FoundryAgent(
project_endpoint="https://your-project.services.ai.azure.com",
agent_name="my-prompt-agent",
agent_version="1.0",
project_endpoint=os.environ["FOUNDRY_PROJECT_ENDPOINT"],
agent_name=os.environ["FOUNDRY_AGENT_NAME"],
agent_version=os.environ["FOUNDRY_AGENT_VERSION"],
credential=AzureCliCredential(),
)