Skip to content

Conversation

@jsong468
Copy link
Contributor

@jsong468 jsong468 commented Jan 22, 2026

Description

This PR adds a Target Registry feature for storing instances of targets to be re-used and an AIRT initializer that instantiates a wide range of commonly used targets using environment variables. These additions will be useful for the GUI as they enable us to load commonly used targets and have them ready to use.

  • TargetRegistry follows the pattern of the existing ScorerRegistry
  • The AIRTTargetInitializer is a PyRITInitializer subclass that scans environment variables and registers available targets into the TargetRegistry. No environment variables are strictly required. The supported targets include OpenAIChatTarget, OpenAIResponseTarget, RealtimeTarget, OpenAIImageTarget, OpenAITTSTarget, OpenAIVideoTarget, and PromptShieldTarget
  • Introduces a new supports_prepended_conversation attribute for TargetIdentifiers
  • Updated outdated instance registry notebook following Identifier refactor

Tests and Documentation

Unit tests for TargetRegistry added
Notebook example added

@romanlutz
Copy link
Contributor

The GUI may need to know if it's possible to set the system prompt on a target. Can we provide that information in the registry?

@jsong468
Copy link
Contributor Author

The GUI may need to know if it's possible to set the system prompt on a target. Can we provide that information in the registry?

Do you mean PromptChatTarget vs ChatTarget? This can be an attribute of the TargetMetadata possibly? @romanlutz

@romanlutz
Copy link
Contributor

The GUI may need to know if it's possible to set the system prompt on a target. Can we provide that information in the registry?

Do you mean PromptChatTarget vs ChatTarget? This can be an attribute of the TargetMetadata possibly? @romanlutz

Exactly

model_var="OPENAI_VIDEO_MODEL",
underlying_model_var="OPENAI_VIDEO_UNDERLYING_MODEL",
),
TargetConfig(
Copy link
Contributor

Choose a reason for hiding this comment

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

should we just include every target in env_example?

Copy link
Contributor Author

@jsong468 jsong468 Jan 30, 2026

Choose a reason for hiding this comment

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

don't have a strong opinion about this, I kept it slightly more concise by including all the dynamically configured ones as well as the adversarial ones (e.g. OPENAI_CHAT_ENDPOINT DEFAULT_OPENAI_FRONTEND_ENDPOINT OPENAI_RESPONSES_ENDPOINT). If we included every target, we would exclude those default dynamically populated ones and just include the other ones? (otherwise, we'll have duplicates.)

Copy link
Contributor

Choose a reason for hiding this comment

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

I like the idea of including every unique target :) Worst case it's not configured and we skip it

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