FEAT: Target Registry and AIRT Targets Initializer#1320
FEAT: Target Registry and AIRT Targets Initializer#1320jsong468 wants to merge 4 commits intoAzure:mainfrom
Conversation
|
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( |
There was a problem hiding this comment.
should we just include every target in env_example?
There was a problem hiding this comment.
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.)
There was a problem hiding this comment.
I like the idea of including every unique target :) Worst case it's not configured and we skip it
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.
TargetRegistryfollows the pattern of the existingScorerRegistryAIRTTargetInitializeris aPyRITInitializersubclass that scans environment variables and registers available targets into theTargetRegistry. No environment variables are strictly required. The supported targets includeOpenAIChatTarget,OpenAIResponseTarget,RealtimeTarget,OpenAIImageTarget,OpenAITTSTarget,OpenAIVideoTarget, andPromptShieldTargetsupports_prepended_conversationattribute forTargetIdentifiersTests and Documentation
Unit tests for
TargetRegistryaddedNotebook example added