Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ litellm = [
# platforms cannot be pinned back selectively. 1.91.x is the last line with a
# universal wheel that installs everywhere. Revisit once litellm ships macOS
# and musllinux wheels.
"litellm>=1.83.0,<1.92.0",
"litellm>=1.84.0,<1.92.0",
]

# all includes all functional dependencies excluding the ones from the "dev" dependency group
Expand All @@ -151,7 +151,7 @@ all = [
"flask>=3.1.3",
"ipykernel>=6.29.5",
"jupyter>=1.1.1",
"litellm>=1.83.0,<1.92.0", # 1.92.0+ drops the universal wheel (no mac/musl/old-glibc/win-arm64); see litellm group
"litellm>=1.84.0,<1.92.0", # 1.92.0+ drops the universal wheel (no mac/musl/old-glibc/win-arm64); see litellm group
"ollama>=0.5.1",
"opencv-python>=4.11.0.86",
"playwright>=1.49.0",
Expand Down
14 changes: 5 additions & 9 deletions pyrit/prompt_target/openai/openai_video_target.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,7 @@ async def _send_text_plus_image_to_video_async(
logger.info("Text+Image-to-video mode: Using image as first frame")
input_file = await self._prepare_image_input_async(image_piece=image_piece)
return await self._handle_openai_request_async(
# Azure continues to support the Videos API despite its OpenAI deprecation.
api_call=lambda: self._client.videos.create_and_poll( # ty: ignore[deprecated]
api_call=lambda: self._client.videos.create_and_poll(
model=self._model_name,
prompt=prompt,
size=self._size,
Expand All @@ -284,8 +283,7 @@ async def _send_text_to_video_async(self, *, prompt: str, request: Message) -> M
The response Message with the generated video path.
"""
return await self._handle_openai_request_async(
# Azure continues to support the Videos API despite its OpenAI deprecation.
api_call=lambda: self._client.videos.create_and_poll( # ty: ignore[deprecated]
api_call=lambda: self._client.videos.create_and_poll(
model=self._model_name,
prompt=prompt,
size=self._size,
Expand Down Expand Up @@ -339,12 +337,11 @@ async def _remix_and_poll_async(self, *, video_id: str, prompt: str) -> Any:
Returns:
The completed Video object from the OpenAI SDK.
"""
# Azure continues to support the Videos API despite its OpenAI deprecation.
video = await self._client.videos.remix(video_id, prompt=prompt) # ty: ignore[deprecated]
video = await self._client.videos.remix(video_id, prompt=prompt)

# Poll until completion if not already done
if video.status not in ["completed", "failed"]:
video = await self._client.videos.poll(video.id) # ty: ignore[deprecated]
video = await self._client.videos.poll(video.id)

return video

Expand Down Expand Up @@ -394,8 +391,7 @@ async def _construct_message_from_response_async(self, response: Any, request: A
logger.info(f"Video was remixed from: {video.remixed_from_video_id}")

# Download video content using SDK
# Azure continues to support the Videos API despite its OpenAI deprecation.
video_response = await self._client.videos.download_content(video.id) # ty: ignore[deprecated]
video_response = await self._client.videos.download_content(video.id)
# Extract bytes from HttpxBinaryResponseContent
video_content = video_response.content

Expand Down
66 changes: 9 additions & 57 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading