Skip to content

Commit 1c56548

Browse files
romanlutzCopilot
andcommitted
DOCS: expand use_entra_auth deprecation guidance and drop v prefix
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent ce47dea commit 1c56548

6 files changed

Lines changed: 46 additions & 20 deletions

File tree

pyrit/prompt_converter/azure_speech_audio_to_text_converter.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,16 @@ def __init__(
6666
If omitted, Entra ID auth via ``DefaultAzureCredential`` is used automatically.
6767
azure_speech_resource_id (str, Optional): The resource ID for accessing the service when using
6868
Entra ID auth. Required when using a callable token provider or when no API key is available.
69-
use_entra_auth (bool, Optional): **Deprecated.** Will be removed in v0.15.0.
70-
Authentication is now auto-detected from the provided credentials.
69+
use_entra_auth (bool, Optional): **Deprecated.** Will be removed in 0.15.0.
70+
Authentication is now selected automatically based on what you pass to
71+
``azure_speech_key`` (and ``AZURE_SPEECH_KEY`` env var):
72+
73+
- Pass a **string** API key (or set ``AZURE_SPEECH_KEY``) to use API-key auth.
74+
- Pass a **callable token provider** (sync or async returning a token string)
75+
to use Entra ID with a custom token; ``azure_speech_resource_id`` must also
76+
be set.
77+
- Omit ``azure_speech_key`` entirely to use Entra ID via
78+
``DefaultAzureCredential``; ``azure_speech_resource_id`` must be set.
7179
recognition_language (str): Recognition voice language. Defaults to "en-US".
7280
For more on supported languages, see the following link:
7381
https://learn.microsoft.com/en-us/azure/ai-services/speech-service/language-support
@@ -79,9 +87,8 @@ def __init__(
7987
print_deprecation_message(
8088
old_item="AzureSpeechAudioToTextConverter(use_entra_auth=...)",
8189
new_item=(
82-
"AzureSpeechAudioToTextConverter(...) with automatic auth detection: "
83-
"pass a key string for key auth, a callable token provider for token auth, "
84-
"or omit for automatic Entra ID auth"
90+
"AzureSpeechAudioToTextConverter("
91+
"azure_speech_key=<api-key-string-or-callable-token-provider-or-omit>)"
8592
),
8693
removed_in="0.15.0",
8794
)

pyrit/prompt_converter/azure_speech_text_to_audio_converter.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,16 @@ def __init__(
7070
If omitted, Entra ID auth via ``DefaultAzureCredential`` is used automatically.
7171
azure_speech_resource_id (str, Optional): The resource ID for accessing the service when using
7272
Entra ID auth. Required when using a callable token provider or when no API key is available.
73-
use_entra_auth (bool, Optional): **Deprecated.** Will be removed in v0.15.0.
74-
Authentication is now auto-detected from the provided credentials.
73+
use_entra_auth (bool, Optional): **Deprecated.** Will be removed in 0.15.0.
74+
Authentication is now selected automatically based on what you pass to
75+
``azure_speech_key`` (and ``AZURE_SPEECH_KEY`` env var):
76+
77+
- Pass a **string** API key (or set ``AZURE_SPEECH_KEY``) to use API-key auth.
78+
- Pass a **callable token provider** (sync or async returning a token string)
79+
to use Entra ID with a custom token; ``azure_speech_resource_id`` must also
80+
be set.
81+
- Omit ``azure_speech_key`` entirely to use Entra ID via
82+
``DefaultAzureCredential``; ``azure_speech_resource_id`` must be set.
7583
synthesis_language (str): Synthesis voice language.
7684
synthesis_voice_name (str): Synthesis voice name.
7785
For more details see the following link for synthesis language and synthesis voice:
@@ -85,9 +93,8 @@ def __init__(
8593
print_deprecation_message(
8694
old_item="AzureSpeechTextToAudioConverter(use_entra_auth=...)",
8795
new_item=(
88-
"AzureSpeechTextToAudioConverter(...) with automatic auth detection: "
89-
"pass a key string for key auth, a callable token provider for token auth, "
90-
"or omit for automatic Entra ID auth"
96+
"AzureSpeechTextToAudioConverter("
97+
"azure_speech_key=<api-key-string-or-callable-token-provider-or-omit>)"
9198
),
9299
removed_in="0.15.0",
93100
)

pyrit/prompt_target/azure_ml_chat_target.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def __init__(
8585
message_normalizer (MessageListNormalizer[Any] | None): **Deprecated.** Use
8686
``custom_configuration`` with ``CapabilityHandlingPolicy`` instead. Previously used for
8787
models that do not allow system prompts.
88-
Will be removed in v0.15.0.
88+
Will be removed in 0.15.0.
8989
max_new_tokens (int): The maximum number of tokens to generate in the response.
9090
Defaults to 400.
9191
temperature (float): The temperature for generating diverse responses. 1.0 is most random,
@@ -120,7 +120,7 @@ def __init__(
120120
raise ValueError(
121121
"Cannot specify both 'message_normalizer' and 'custom_configuration'. "
122122
"Use 'custom_configuration' only; 'message_normalizer' is deprecated and "
123-
"will be removed in v0.15.0."
123+
"will be removed in 0.15.0."
124124
)
125125
print_deprecation_message(
126126
old_item="AzureMLChatTarget(message_normalizer=...)",

pyrit/score/audio_transcript_scorer.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,12 @@ def __init__(
114114
Args:
115115
text_capable_scorer (Scorer): A scorer capable of processing text that will be used to score
116116
the transcribed audio content.
117-
use_entra_auth (bool, Optional): **Deprecated.** Will be removed in v0.15.0.
118-
Authentication is now auto-detected by the underlying converter.
117+
use_entra_auth (bool, Optional): **Deprecated.** Will be removed in 0.15.0.
118+
Authentication is now configured on the underlying
119+
``AzureSpeechAudioToTextConverter`` via its ``azure_speech_key`` parameter:
120+
pass a string API key (or set ``AZURE_SPEECH_KEY``) for key auth, a callable
121+
token provider for Entra ID with a custom token, or omit it to use Entra ID
122+
via ``DefaultAzureCredential``.
119123
120124
Raises:
121125
ValueError: If text_capable_scorer does not support text data type.
@@ -124,8 +128,8 @@ def __init__(
124128
print_deprecation_message(
125129
old_item="AudioTranscriptHelper(use_entra_auth=...)",
126130
new_item=(
127-
"AudioTranscriptHelper(...) (authentication is now auto-detected "
128-
"by the underlying AzureSpeechAudioToTextConverter)"
131+
"AudioTranscriptHelper(...) (configure auth on the underlying "
132+
"AzureSpeechAudioToTextConverter via azure_speech_key)"
129133
),
130134
removed_in="0.15.0",
131135
)

pyrit/score/float_scale/audio_float_scale_scorer.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,12 @@ def __init__(
3434
text_capable_scorer: A FloatScaleScorer capable of processing text.
3535
This scorer will be used to evaluate the transcribed audio content.
3636
validator: Validator for the scorer. Defaults to audio_path data type validator.
37-
use_entra_auth: **Deprecated.** Will be removed in v0.15.0.
38-
Authentication is now auto-detected by the underlying converter.
37+
use_entra_auth: **Deprecated.** Will be removed in 0.15.0.
38+
Authentication is now configured on the underlying
39+
``AzureSpeechAudioToTextConverter`` via its ``azure_speech_key`` parameter:
40+
pass a string API key (or set ``AZURE_SPEECH_KEY``) for key auth, a callable
41+
token provider for Entra ID with a custom token, or omit it to use Entra ID
42+
via ``DefaultAzureCredential``.
3943
4044
Raises:
4145
ValueError: If text_capable_scorer does not support text data type.

pyrit/score/true_false/audio_true_false_scorer.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,12 @@ def __init__(
3434
text_capable_scorer: A TrueFalseScorer capable of processing text.
3535
This scorer will be used to evaluate the transcribed audio content.
3636
validator: Validator for the scorer. Defaults to audio_path data type validator.
37-
use_entra_auth: **Deprecated.** Will be removed in v0.15.0.
38-
Authentication is now auto-detected by the underlying converter.
37+
use_entra_auth: **Deprecated.** Will be removed in 0.15.0.
38+
Authentication is now configured on the underlying
39+
``AzureSpeechAudioToTextConverter`` via its ``azure_speech_key`` parameter:
40+
pass a string API key (or set ``AZURE_SPEECH_KEY``) for key auth, a callable
41+
token provider for Entra ID with a custom token, or omit it to use Entra ID
42+
via ``DefaultAzureCredential``.
3943
4044
Raises:
4145
ValueError: If text_capable_scorer does not support text data type.

0 commit comments

Comments
 (0)