Skip to content

MAINT: Remove redundant PromptTarget from OpenAI target subclasses#1882

Open
hannahwestra25 wants to merge 2 commits into
microsoft:mainfrom
hannahwestra25:hannahwestra25/remove-realtime-target-duplicate-inherit
Open

MAINT: Remove redundant PromptTarget from OpenAI target subclasses#1882
hannahwestra25 wants to merge 2 commits into
microsoft:mainfrom
hannahwestra25:hannahwestra25/remove-realtime-target-duplicate-inherit

Conversation

@hannahwestra25
Copy link
Copy Markdown
Contributor

Description

OpenAITarget already inherits from PromptTarget, so listing PromptTarget explicitly in the bases of OpenAIChatTarget, OpenAIResponseTarget, and RealtimeTarget is redundant. This PR removes the duplicate base class and the now-unused from pyrit.prompt_target.common.prompt_target import PromptTarget import in each file.

Changes

  • pyrit/prompt_target/openai/openai_chat_target.py: class OpenAIChatTarget(OpenAITarget, PromptTarget) -> class OpenAIChatTarget(OpenAITarget)
  • pyrit/prompt_target/openai/openai_response_target.py: class OpenAIResponseTarget(OpenAITarget, PromptTarget) -> class OpenAIResponseTarget(OpenAITarget)
  • pyrit/prompt_target/openai/openai_realtime_target.py: class RealtimeTarget(OpenAITarget, PromptTarget) -> class RealtimeTarget(OpenAITarget)

Behavior change

None. All three classes remain subclasses of PromptTarget via OpenAITarget (verified with issubclass for each class).

hannahwestra25 and others added 2 commits June 1, 2026 17:55
OpenAITarget already inherits from PromptTarget, so listing PromptTarget
explicitly in the bases of OpenAIChatTarget, OpenAIResponseTarget, and
RealtimeTarget is redundant. Drop the duplicate base and the now-unused
import in each file. No behavior change; all three classes remain
subclasses of PromptTarget via OpenAITarget.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

3 participants