Expose the per-file Downloads API (/v1/downloads) in the SDK

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

Chưa có ai nhận issue này.

Đá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
70/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
node.js, openapi, python
Lĩnh vực
api, backend-api-design

Hướng nghiên cứu

Bắt đầu bằng cách tìm đặc tả OpenAPI và tài liệu API được tạo, bao gồm api.md trong các SDK. Thêm ba thao tác /v1/downloads đã được lập tài liệu và cập nhật mô tả về các lượt tải xuống của phiên, sau đó xác minh rằng quá trình tạo sinh tạo ra downloads.list, downloads.retrieve và downloads.delete cho các SDK Python và Node.

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

Mô tả

What exists today

The only way to retrieve downloaded files through the SDK is client.sessions.downloads.list(id). It calls GET /v1/sessions/{id}/downloads with Accept: application/zip and hands back the raw response (BinaryAPIResponse in Python, Response in Node): a zip archive containing every file the session downloaded. Nothing in the method's description says so. The generated docstring is just "Session Downloads", so the first hint that you are holding a zip is the response body.

What's missing

Browserbase documents a per-file Downloads API that is not in the SDK at all. Neither SDK has a downloads resource, and api.md in each lists only the zip endpoint and sessions.recording.downloads. The documented endpoints:

Feature overview: https://docs.browserbase.com/features/downloads

Why it matters

  • Per-file access with mimeType and size filters and pagination, instead of one opaque archive per session.
  • No zip round-trip when you want a single file: fetch it by id and you are done.
  • A caller can gate on one body's magic bytes, or compare size / checksum from the listing, before doing anything with the file.

Our integration ended up dropping the SDK for these calls and using raw httpx against /v1/downloads for exactly these reasons. The client's get() plus make_request_options() covers the gap in the meantime, but it means hand-writing the types the generator would otherwise produce.

Ask

  1. Add the three /v1/downloads endpoints to the OpenAPI spec so they generate into both the Python and Node SDKs as a downloads resource (list, retrieve, delete).
  2. While there, give GET /v1/sessions/{id}/downloads a description that says it returns a zip archive of all files downloaded during the session, so sessions.downloads.list() documents its return type.
Ngôn ngữ chính
Python
Star
93
Fork
16
Merge trung bình
11 phút
Pull request đã merge (30 ngày)
3

Hướng dẫn đóng góp

Mở 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 browserbase/sdk-python

Tất cả issue của browserbase/sdk-python

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.