diff --git a/python/samples/README.md b/python/samples/README.md index 874d1e5915..f87e5bed0c 100644 --- a/python/samples/README.md +++ b/python/samples/README.md @@ -184,8 +184,8 @@ This directory contains samples demonstrating the capabilities of Microsoft Agen | File | Description | |------|-------------| -| [`getting_started/evaluation/azure_ai_foundry/red_team_agent_sample.py`](./getting_started/evaluation/azure_ai_foundry/red_team_agent_sample.py) | Red team agent evaluation sample for Azure AI Foundry | -| [`getting_started/evaluation/azure_ai_foundry/evaluation/self_reflection.py`](./getting_started/evaluation/azure_ai_foundry/evaluation/self_reflection.py) | LLM self-reflection with AI Foundry graders example | +| [`getting_started/evaluation/azure_ai_foundry/red_teaming/red_team_agent_sample.py`](./getting_started/evaluation/azure_ai_foundry/red_teaming/red_team_agent_sample.py) | Red team agent evaluation sample for Azure AI Foundry | +| [`getting_started/evaluation/azure_ai_foundry/self_reflection/self_reflection.py`](./getting_started/evaluation/azure_ai_foundry/self_reflection/self_reflection.py) | LLM self-reflection with AI Foundry graders example | ## MCP (Model Context Protocol) diff --git a/python/samples/getting_started/evaluation/azure_ai_foundry/.env.example b/python/samples/getting_started/evaluation/azure_ai_foundry/red_teaming/.env.example similarity index 100% rename from python/samples/getting_started/evaluation/azure_ai_foundry/.env.example rename to python/samples/getting_started/evaluation/azure_ai_foundry/red_teaming/.env.example diff --git a/python/samples/getting_started/evaluation/azure_ai_foundry/README.md b/python/samples/getting_started/evaluation/azure_ai_foundry/red_teaming/README.md similarity index 100% rename from python/samples/getting_started/evaluation/azure_ai_foundry/README.md rename to python/samples/getting_started/evaluation/azure_ai_foundry/red_teaming/README.md diff --git a/python/samples/getting_started/evaluation/azure_ai_foundry/red_team_agent_sample.py b/python/samples/getting_started/evaluation/azure_ai_foundry/red_teaming/red_team_agent_sample.py similarity index 100% rename from python/samples/getting_started/evaluation/azure_ai_foundry/red_team_agent_sample.py rename to python/samples/getting_started/evaluation/azure_ai_foundry/red_teaming/red_team_agent_sample.py diff --git a/python/samples/getting_started/evaluation/azure_ai_foundry/evaluation/.env.example b/python/samples/getting_started/evaluation/azure_ai_foundry/self_reflection/.env.example similarity index 100% rename from python/samples/getting_started/evaluation/azure_ai_foundry/evaluation/.env.example rename to python/samples/getting_started/evaluation/azure_ai_foundry/self_reflection/.env.example diff --git a/python/samples/getting_started/evaluation/azure_ai_foundry/evaluation/README.md b/python/samples/getting_started/evaluation/azure_ai_foundry/self_reflection/README.md similarity index 100% rename from python/samples/getting_started/evaluation/azure_ai_foundry/evaluation/README.md rename to python/samples/getting_started/evaluation/azure_ai_foundry/self_reflection/README.md diff --git a/python/samples/getting_started/evaluation/azure_ai_foundry/evaluation/resources/suboptimal_groundedness_prompts.jsonl b/python/samples/getting_started/evaluation/azure_ai_foundry/self_reflection/resources/suboptimal_groundedness_prompts.jsonl similarity index 100% rename from python/samples/getting_started/evaluation/azure_ai_foundry/evaluation/resources/suboptimal_groundedness_prompts.jsonl rename to python/samples/getting_started/evaluation/azure_ai_foundry/self_reflection/resources/suboptimal_groundedness_prompts.jsonl diff --git a/python/samples/getting_started/evaluation/azure_ai_foundry/evaluation/self_reflection.py b/python/samples/getting_started/evaluation/azure_ai_foundry/self_reflection/self_reflection.py similarity index 99% rename from python/samples/getting_started/evaluation/azure_ai_foundry/evaluation/self_reflection.py rename to python/samples/getting_started/evaluation/azure_ai_foundry/self_reflection/self_reflection.py index c20e31f896..76ed8d6e65 100644 --- a/python/samples/getting_started/evaluation/azure_ai_foundry/evaluation/self_reflection.py +++ b/python/samples/getting_started/evaluation/azure_ai_foundry/self_reflection/self_reflection.py @@ -1,3 +1,18 @@ +# Copyright (c) Microsoft. All rights reserved. +# type: ignore +import asyncio +import os +import time +import argparse +import pandas as pd +from typing import Any +from dotenv import load_dotenv + +from agent_framework import ChatAgent, ChatMessage +from agent_framework.azure import AzureOpenAIChatClient +from azure.identity import AzureCliCredential +from azure.ai.evaluation import GroundednessEvaluator, AzureOpenAIModelConfiguration + """ Self-Reflection LLM Runner @@ -21,19 +36,6 @@ -n 10 # Optional: process only first 10 prompts """ -import asyncio -import os -import time -import argparse -import pandas as pd -from typing import Dict, Any, Optional -from dotenv import load_dotenv - -from agent_framework import ChatAgent, ChatMessage -from agent_framework.azure import AzureOpenAIChatClient -from azure.identity import AzureCliCredential -from azure.ai.evaluation import GroundednessEvaluator, AzureOpenAIModelConfiguration - DEFAULT_AGENT_MODEL = "gpt-4.1" DEFAULT_JUDGE_MODEL = "gpt-4.1"