Skip to content

Commit 3b606b6

Browse files
author
Hanchi Wang
committed
Update Redteaming agent to go through FDP
1 parent 2bbc1da commit 3b606b6

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

samples/agent-catalog/msft-agent-samples/semantic-kernel-sdk/ai-redteaming-agent/README.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,8 @@ AZURE_OPENAI_ENDPOINT=https://your-resource-name.openai.azure.com/
4040
AZURE_OPENAI_DEPLOYMENT_NAME=your-deployment-name
4141
AZURE_OPENAI_API_KEY=your-api-key
4242
43-
# Azure AI Project Configuration
44-
AZURE_SUBSCRIPTION_ID=your-subscription-id
45-
AZURE_RESOURCE_GROUP=your-resource-group
46-
AZURE_PROJECT_NAME=your-project-name
43+
# Azure AI Project Endpoint, get it on Azure AI Froundry UI project home page
44+
AZURE_AI_PROJECT_ENDPOINT=https://your-resource-name.services.ai.azure.com/api/projects/your-project-name
4745
```
4846

4947
### 3. Configure Target Model
@@ -86,9 +84,7 @@ Then, update the `main` function to use your new target function:
8684
```python
8785
# Initialize the RedTeamPlugin with the target function
8886
red_team_plugin = RedTeamPlugin(
89-
subscription_id=subscription_id,
90-
resource_group=resource_group,
91-
project_name=project_name,
87+
azure_ai_project_endpoint=ai_project_endpoint,
9288
target_func=call_custom_api # Use your new function here
9389
)
9490
```
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
azure-ai-evaluation[redteam]
1+
azure-ai-evaluation[redteam] >= 1.8.0
22
semantic-kernel
33
python-dotenv
44
requests

samples/agent-catalog/msft-agent-samples/semantic-kernel-sdk/ai-redteaming-agent/template.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@ async def main():
4747
api_key = os.environ.get("AZURE_OPENAI_API_KEY")
4848

4949
# Get Azure AI Project details from environment variables
50-
subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID")
51-
resource_group = os.environ.get("AZURE_RESOURCE_GROUP")
52-
project_name = os.environ.get("AZURE_PROJECT_NAME")
50+
ai_project_endpoint = os.environ.get("AZURE_AI_PROJECT_ENDPOINT")
5351

5452
# Initialize the service
5553
service = AzureChatCompletion(
@@ -60,9 +58,7 @@ async def main():
6058

6159
# Initialize the RedTeamPlugin with the target function
6260
red_team_plugin = RedTeamPlugin(
63-
subscription_id=subscription_id,
64-
resource_group=resource_group,
65-
project_name=project_name,
61+
azure_ai_project_endpoint=ai_project_endpoint,
6662
target_func=call_ollama
6763
)
6864

0 commit comments

Comments
 (0)