Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

FEAT: Support PDF and file inputs via `binary_path` in OpenAI chat and response targets

Đang mở
#3,274 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

@PranavD2905 đang làm issue này rồi.

Từ ngày 16/10/2026.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
ai, api

Hướng nghiên cứu

Start from the binary_path message pieces that PDFConverter already produces, then read how OpenAIChatTarget and OpenAIResponseTarget build their request payloads and declare input capabilities. Reading the storage abstraction used to load files is also needed. Done means a request containing a PDF plus text serializes correctly for both targets, passes capability validation, survives history rebuilding, and has regression tests and a documented example.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

feature-request help wanted
Is your feature request related to a problem? Please describe.

PyRIT represents files such as PDFs using binary_path, and converters such as PDFConverter already produce this type. However, OpenAIChatTarget and OpenAIResponseTarget do not currently support sending these files as native file inputs.

This leaves a gap between generating a file and submitting it to a model for document-based testing.

Describe the solution you'd like

Support binary_path message pieces in both targets, starting with PDFs and extending to other file formats where the selected API and model support them.

Expected behavior:

  • Read the referenced file through PyRIT's storage abstraction and serialize it into the appropriate Chat Completions or Responses API file-input format.
  • Support file-only messages, files alongside text instructions, and multiple files where supported by the API.
  • Update target input capabilities so requests containing binary_path pass validation.
  • Preserve file inputs when rebuilding conversation history.
  • Surface clear errors for unreadable files and unsupported inputs. Document API/model-specific format and size restrictions rather than implying that all binary files are supported.

Include request-serialization and regression tests for both targets, plus a documented example that sends a PDF with a text instruction.

Describe alternatives you've considered, if relevant

Extracting text from the PDF or converting its pages to images can work for some use cases, but changes how the model receives the document and does not exercise native file handling.

Manually building API requests outside these targets requires users to duplicate request-building logic.

Additional context

Related issues #423, #415, and #541 cover file generation and injection. This request covers the separate target responsibility of sending those files to the model.

Ngôn ngữ chính
Python
Star
4.6k
Fork
944
Merge trung bình
2 ngày 18 giờ
Pull request đã merge (30 ngày)
358

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoft/PyRIT

Tất cả issue của microsoft/PyRIT

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.