Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

BUG: OpenAITTSTarget accepts any speed, so an out-of-range value is only sent to the API on every request

オープン
#3,445 コメント 1 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

@ShivamSharma43 がすでに取り組んでいます。

2026年10月22日 から。

  • #1 @huong8373tt-beep による — オープン
  • #3447 @ShivamSharma43 による — オープン
  • #3461 @huong8373tt-beep による — マージされずにクローズ

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
python
領域
backend

調査の方向性

The issue identifies OpenAITTSTarget.__init__ and _send_prompt_to_target_async; locate those entry points in the PyRIT source and check how OpenAIVideoTarget validates duration. Add coverage for the listed invalid speed values and for None and valid boundary values. Done when invalid speeds raise ValueError at construction while None remains accepted; linked pull request #3447 is already open.

索引モデルが issue の本文から書いたものです。

説明

Describe the bug

OpenAITTSTarget.__init__ documents speed as "Select a value from 0.25 to 4.0", which is the range of the OpenAI speech API's speed parameter, but stores whatever is passed. _send_prompt_to_target_async then puts it in every request body (if self._speed is not None: body_parameters["speed"] = self._speed).

So speed=10, speed=-1.0, speed=0, speed=float("nan") or speed=True all construct a target without error, and the mistake only surfaces when each request reaches the API. The value is also recorded in the target's identifier as if it were valid. OpenAIVideoTarget already rejects an unsupported duration at the target instead of leaving it to the API.

Steps/Code to Reproduce
import asyncio
from pyrit.setup import IN_MEMORY, initialize_pyrit_async

asyncio.run(initialize_pyrit_async(memory_db_type=IN_MEMORY))

from pyrit.prompt_target import OpenAITTSTarget

for speed in (10, -1.0, 0, float("nan"), True):
    target = OpenAITTSTarget(model_name="tts-1", endpoint="https://api.openai.com/v1", api_key="sk-test", speed=speed)
    print(repr(speed), "-> accepted, will send speed =", repr(target._speed))
Expected Results

A speed that is not a finite number from 0.25 to 4.0 raises a ValueError when the target is created. None keeps the API default.

Actual Results
10 -> accepted, will send speed = 10
-1.0 -> accepted, will send speed = -1.0
0 -> accepted, will send speed = 0
nan -> accepted, will send speed = nan
True -> accepted, will send speed = True
Screenshots

N/A

Versions
  • OS: Windows 11
  • Python version: 3.11.9
  • PyRIT version: installed from main (898b3bdc) in editable mode
主要言語
Python
スター
4.6k
フォーク
962
平均マージ
2日 13時間
マージ済み PR(30日)
423

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/PyRIT のほかの issue

microsoft/PyRIT の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。