FEAT: Runtime capability discovery for prompt targets#1
Draft
hannahwestra25 wants to merge 56 commits into
Draft
FEAT: Runtime capability discovery for prompt targets#1hannahwestra25 wants to merge 56 commits into
hannahwestra25 wants to merge 56 commits into
Conversation
c4f012e to
a3873b5
Compare
…lities in verify_target_async
…soft#1692) Co-authored-by: Roman Lutz <romanlutz@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Roman Lutz <romanlutz@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ft#1701) Co-authored-by: Roman Lutz <romanlutz@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ra/query_target_capabilities
…ra/query_target_capabilities
…icrosoft#1713) Co-authored-by: Roman Lutz <romanlutz@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…microsoft#1709) Co-authored-by: Roman Lutz <romanlutz@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ft#1710) Co-authored-by: Roman Lutz <romanlutz@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…crosoft#1707) Co-authored-by: Roman Lutz <romanlutz@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…narios (microsoft#1695) Co-authored-by: Behnam Ousat <behnamousat@microsoft.com>
…icrosoft#1718) Co-authored-by: Roman Lutz <romanlutz@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ra/query_target_capabilities
Co-authored-by: Roman Lutz <romanlutz13@gmail.com>
…ra/query_target_capabilities
…ings (microsoft#1723) Co-authored-by: Roman Lutz <romanlutz@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Roman Lutz <romanlutz@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Richard Lundeen <rlundeen@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…rosoft#1711) Co-authored-by: Roman Lutz <romanlutz@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…crosoft#1705) Co-authored-by: Roman Lutz <romanlutz@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…icrosoft#1706) Co-authored-by: Roman Lutz <romanlutz@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Roman Lutz <romanlutz@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Roman Lutz <romanlutz13@gmail.com>
…ra/query_target_capabilities
…ra/query_target_capabilities
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds
query_target_capabilities_asyncandverify_target_modalities_asyncso consumers can probe what aPromptTargetactually supports, instead of trusting its declaredTargetConfiguration. Useful for custom OpenAI-compatible endpoints, gateways that strip features, and models whose support drifts.API (query_target_capabilities.py, exported from
pyrit.prompt_target):query_target_capabilities_async(*, target, capabilities=None)— sends a minimal probe per capability (SYSTEM_PROMPT,MULTI_MESSAGE_PIECES,MULTI_TURN,JSON_OUTPUT,JSON_SCHEMA) and returns the verified set. Capabilities without a probe fall back to declared support.verify_target_modalities_async(*, target, test_modalities=None, test_assets=None)— probes input modality combinations; skips those whose assets are missing.During probing the target's configuration is temporarily replaced with a permissive one so
_validate_requestdoesn't short-circuit, and is always restored on exit.Tests and Documentation
Tests: test_query_target_capabilities.py covers each probe, the restore guarantee (incl. exception path), subset filtering, modality probing with present/missing assets, and the no-probe fallback.
Docs: new notebook 6_1_target_capabilities.ipynb plus an updated section in 0_prompt_targets.md.