From 299db4f2a73ddb38f13f0347800371bbbac258d3 Mon Sep 17 00:00:00 2001 From: Waqas Javed <7674577+w-javed@users.noreply.github.com> Date: Mon, 15 Dec 2025 16:46:24 -0800 Subject: [PATCH 1/2] sample-fix --- sdk/ai/azure-ai-projects/.env.template | 2 +- .../samples/agents/sample_agent_retrieve_basic.py | 4 ++-- .../samples/agents/sample_agent_retrieve_basic_async.py | 4 ++-- .../samples/evaluations/sample_agent_evaluation.py | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sdk/ai/azure-ai-projects/.env.template b/sdk/ai/azure-ai-projects/.env.template index 1c18021a4e7d..5449d0303d4b 100644 --- a/sdk/ai/azure-ai-projects/.env.template +++ b/sdk/ai/azure-ai-projects/.env.template @@ -17,7 +17,7 @@ # `https://.services.ai.azure.com/api/projects/` AZURE_AI_PROJECT_ENDPOINT= AZURE_AI_MODEL_DEPLOYMENT_NAME= -AGENT_NAME= +AZURE_AI_AGENT_NAME= CONVERSATION_ID= CONNECTION_NAME= AZURE_AI_PROJECTS_AZURE_SUBSCRIPTION_ID= diff --git a/sdk/ai/azure-ai-projects/samples/agents/sample_agent_retrieve_basic.py b/sdk/ai/azure-ai-projects/samples/agents/sample_agent_retrieve_basic.py index a04bc7c64fe8..1102d326b2f3 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/sample_agent_retrieve_basic.py +++ b/sdk/ai/azure-ai-projects/samples/agents/sample_agent_retrieve_basic.py @@ -23,7 +23,7 @@ Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview page of your Microsoft Foundry portal. - 2) AGENT_NAME - The name of an existing Agent in your Microsoft Foundry project. + 2) AZURE_AI_AGENT_NAME - The name of an existing Agent in your Microsoft Foundry project. 3) CONVERSATION_ID - The ID of an existing Conversation associated with the Agent """ @@ -34,7 +34,7 @@ load_dotenv() -agent_name = os.environ["AGENT_NAME"] +agent_name = os.environ["AZURE_AI_AGENT_NAME"] conversation_id = os.environ["CONVERSATION_ID"] endpoint = os.environ["AZURE_AI_PROJECT_ENDPOINT"] diff --git a/sdk/ai/azure-ai-projects/samples/agents/sample_agent_retrieve_basic_async.py b/sdk/ai/azure-ai-projects/samples/agents/sample_agent_retrieve_basic_async.py index 16988819741c..5cae332aa01f 100644 --- a/sdk/ai/azure-ai-projects/samples/agents/sample_agent_retrieve_basic_async.py +++ b/sdk/ai/azure-ai-projects/samples/agents/sample_agent_retrieve_basic_async.py @@ -23,7 +23,7 @@ Set these environment variables with your own values: 1) AZURE_AI_PROJECT_ENDPOINT - The Azure AI Project endpoint, as found in the Overview page of your Microsoft Foundry portal. - 2) AGENT_NAME - The name of an existing Agent in your Microsoft Foundry project. + 2) AZURE_AI_AGENT_NAME - The name of an existing Agent in your Microsoft Foundry project. 3) CONVERSATION_ID - The ID of an existing Conversation associated with the Agent """ @@ -36,7 +36,7 @@ load_dotenv() endpoint = os.environ["AZURE_AI_PROJECT_ENDPOINT"] -agent_name = os.environ["AGENT_NAME"] +agent_name = os.environ["AZURE_AI_AGENT_NAME"] conversation_id = os.environ["CONVERSATION_ID"] diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/sample_agent_evaluation.py b/sdk/ai/azure-ai-projects/samples/evaluations/sample_agent_evaluation.py index 8dc67f31fa1d..e11a993bd84a 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/sample_agent_evaluation.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/sample_agent_evaluation.py @@ -66,7 +66,7 @@ "type": "azure_ai_evaluator", "name": "violence_detection", "evaluator_name": "builtin.violence", - "data_mapping": {"query": "{{item.query}}", "response": "{{item.response}}"}, + "data_mapping": {"query": "{{item.query}}", "response": "{{sample.output_text}}"}, } ] eval_object = openai_client.evals.create( @@ -123,8 +123,8 @@ else: print("\n✗ Evaluation run failed.") - openai_client.evals.delete(eval_id=eval_object.id) + # openai_client.evals.delete(eval_id=eval_object.id) print("Evaluation deleted") - project_client.agents.delete(agent_name=agent.name) + # project_client.agents.delete(agent_name=agent.name) print("Agent deleted") From b126fe2b7e64d98918f3e25e077db3cd5060f53b Mon Sep 17 00:00:00 2001 From: Waqas Javed <7674577+w-javed@users.noreply.github.com> Date: Mon, 15 Dec 2025 16:49:58 -0800 Subject: [PATCH 2/2] revert --- .../samples/evaluations/sample_agent_evaluation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/ai/azure-ai-projects/samples/evaluations/sample_agent_evaluation.py b/sdk/ai/azure-ai-projects/samples/evaluations/sample_agent_evaluation.py index e11a993bd84a..4d6cd4a098c0 100644 --- a/sdk/ai/azure-ai-projects/samples/evaluations/sample_agent_evaluation.py +++ b/sdk/ai/azure-ai-projects/samples/evaluations/sample_agent_evaluation.py @@ -123,8 +123,8 @@ else: print("\n✗ Evaluation run failed.") - # openai_client.evals.delete(eval_id=eval_object.id) + openai_client.evals.delete(eval_id=eval_object.id) print("Evaluation deleted") - # project_client.agents.delete(agent_name=agent.name) + project_client.agents.delete(agent_name=agent.name) print("Agent deleted")