Skip to content

MAINT Remove v0.13.0 deprecated APIs: FoundryScenario alias and piece.role in conversation_analytics#1623

Open
adrian-gavrila wants to merge 4 commits intomicrosoft:mainfrom
adrian-gavrila:adrian-gavrila/remove-foundry-scenario-deprecation
Open

MAINT Remove v0.13.0 deprecated APIs: FoundryScenario alias and piece.role in conversation_analytics#1623
adrian-gavrila wants to merge 4 commits intomicrosoft:mainfrom
adrian-gavrila:adrian-gavrila/remove-foundry-scenario-deprecation

Conversation

@adrian-gavrila
Copy link
Copy Markdown
Contributor

@adrian-gavrila adrian-gavrila commented Apr 16, 2026

Description

Cleanup pass for APIs scheduled for removal in v0.13.0.

  • Remove the FoundryScenario alias (replaced by RedTeamAgent) and update the partner contract test accordingly.
  • Replace piece.role with piece.api_role in ConversationAnalytics
  • Fix test_conversation_analytics.py to mock get_message_pieces() with MessagePiece objects instead of PromptMemoryEntry, matching the MemoryInterface contract.
  • Trailing-newline fix in red_team_agent.py.

Related: #1618, #1620

Tests and Documentation

  • Partner contract tests (7/7), foundry unit tests (47/47), and analytics tests (2/2) pass.
  • Full pre-commit (including strict mypy) passes.
  • No doc/notebook changes; JupyText not re-run

Adrian Gavrila and others added 2 commits April 16, 2026 12:10
Remove the FoundryScenario class that was deprecated in favor of
RedTeamAgent and marked for removal in version 0.13.0. Update the
partner contract test to validate RedTeamAgent directly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes the deprecated FoundryScenario alias from the Foundry scenario surface area (scheduled for removal in 0.13.0), standardizing partner-facing usage on RedTeamAgent.

Changes:

  • Removed the FoundryScenario alias class and stopped exporting it from the Foundry scenario module.
  • Updated the azure-ai-evaluation partner contract test to validate RedTeamAgent importability instead of FoundryScenario.
  • Updated ConversationAnalytics to use api_role when emitting conversation messages with similarity.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
tests/partner_integration/azure_ai_evaluation/test_foundry_scenario_contract.py Updates the partner contract to reference/import RedTeamAgent instead of the removed alias.
pyrit/scenario/scenarios/foundry/red_team_agent.py Removes the deprecated FoundryScenario alias implementation.
pyrit/scenario/scenarios/foundry/init.py Removes FoundryScenario from exports, leaving FoundryStrategy and RedTeamAgent.
pyrit/analytics/conversation_analytics.py Switches from memory.role to memory.api_role when building similarity results.

Comment thread pyrit/analytics/conversation_analytics.py
Comment thread pyrit/analytics/conversation_analytics.py
@adrian-gavrila adrian-gavrila changed the title MAINT Remove FoundryScenario deprecated alias scheduled for 0.13.0 MAINT Remove v0.13.0 deprecated APIs: FoundryScenario alias and piece.role in conversation_analytics Apr 16, 2026
@adrian-gavrila adrian-gavrila requested a review from Copilot April 16, 2026 18:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comment thread tests/unit/analytics/test_conversation_analytics.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants