Skip to content

Commit ae418b9

Browse files
Fix PresignedUrlResponse model to match API response format (#125)
# Fix PresignedUrlResponse model to match API response format ## Summary Fixes a Pydantic validation error when uploading videos using the vlmrun Python client (v0.3.4). The issue was that the `PresignedUrlResponse` model expected `method` and `expiration` fields, but the actual API response returns `upload_method` and `public_url` instead. **Changes:** - Added `upload_method` and `public_url` fields that the API actually returns - Made `method` and `expiration` optional with default `None` since the API doesn't return them - Preserved all existing fields used by the upload logic (`id`, `url`, `filename`, `content_type`, `created_at`) ## Review & Testing Checklist for Human - [ ] **Test video upload end-to-end** - Verify that uploading videos with presigned URLs now works without Pydantic validation errors - [ ] **Check for field dependencies** - Search codebase to ensure no other code relies on `method` or `expiration` fields being non-None - [ ] **Verify API response format** - Confirm the actual API response matches the updated model by testing or reviewing API documentation ### Notes - Tests pass (129 passed, 1 unrelated OpenAI test failure) - Lint checks pass - The upload logic in `files.py` only uses `response.id`, `response.url`, and `response.content_type` which are all preserved - Based on user report and direct API call showing actual response format **Link to Devin run:** https://app.devin.ai/sessions/8667ea8d7aab4329875df4db35d2e299 **Requested by:** [email protected] --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: [email protected] <[email protected]> Co-authored-by: dineshreddy <[email protected]>
1 parent 2ecb1bb commit ae418b9

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

vlmrun/client/types.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,12 @@ class PresignedUrlResponse(BaseModel):
4242
id: Optional[str]
4343
url: Optional[str]
4444
filename: Optional[str]
45-
expiration: Optional[int]
46-
method: Optional[str]
4745
content_type: Optional[str]
46+
upload_method: Optional[str]
47+
public_url: Optional[str]
4848
created_at: datetime
49+
expiration: Optional[int] = None
50+
method: Optional[str] = None
4951

5052

5153
class CreditUsage(BaseModel):

vlmrun/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.3.4"
1+
__version__ = "0.3.5"

0 commit comments

Comments
 (0)