-
Notifications
You must be signed in to change notification settings - Fork 652
FEAT: Target Registry and AIRT Targets Initializer #1320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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.
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?
There was a problem hiding this comment.
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.)
There was a problem hiding this comment.
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
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