-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat:Add initiate/complete/abort multipart upload endpoints to OpenAPI #154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughAdds three multipart file-upload endpoints (initiate, complete, abort) to the OpenAPI spec and introduces associated request/response schemas, including PartInfo with presigned URL and headers for each part. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Client
participant API as Together API
participant Store as Object Storage
rect rgb(235, 245, 255)
note over Client,API: Initiate multipart upload
Client->>API: POST /files/multipart/initiate {filename, file_size, num_parts, purpose, file_type}
API-->>Client: {upload_id, file_id, parts:[{PartNumber, URL, Headers}]}
end
loop For each part
note over Client,Store: Direct upload via presigned URL
Client->>Store: PUT PartN to URL with Headers
Store-->>Client: 200 OK + ETag
end
alt Complete upload
Client->>API: POST /files/multipart/complete {upload_id, file_id, parts:[{PartNumber, ETag}]}
API-->>Client: 200 FileResponse
else Abort upload
Client->>API: POST /files/multipart/abort {upload_id, file_id}
API-->>Client: 200 {success:true}
end
note over API: 400 validation errors, 401 unauthorized on failures
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 5
🧹 Nitpick comments (1)
src/libs/Together/openapi.yaml (1)
5440-5467: Minor: enforce non-negative file_sizeAdd a minimum to guard against invalid inputs.
MultipartInitiateRequest: required: - filename - file_size - num_parts - purpose - file_type type: object properties: file_size: type: integer description: Total size of the file in bytes format: int64 + minimum: 1 example: 7516192768
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (23)
src/libs/Together/Generated/Together.FilesClient.CreateFilesMultipartAbort.g.csis excluded by!**/generated/**src/libs/Together/Generated/Together.FilesClient.CreateFilesMultipartComplete.g.csis excluded by!**/generated/**src/libs/Together/Generated/Together.FilesClient.CreateFilesMultipartInitiate.g.csis excluded by!**/generated/**src/libs/Together/Generated/Together.IFilesClient.CreateFilesMultipartAbort.g.csis excluded by!**/generated/**src/libs/Together/Generated/Together.IFilesClient.CreateFilesMultipartComplete.g.csis excluded by!**/generated/**src/libs/Together/Generated/Together.IFilesClient.CreateFilesMultipartInitiate.g.csis excluded by!**/generated/**src/libs/Together/Generated/Together.JsonSerializerContextTypes.g.csis excluded by!**/generated/**src/libs/Together/Generated/Together.Models.MultipartAbortRequest.Json.g.csis excluded by!**/generated/**src/libs/Together/Generated/Together.Models.MultipartAbortRequest.g.csis excluded by!**/generated/**src/libs/Together/Generated/Together.Models.MultipartCompleteRequest.Json.g.csis excluded by!**/generated/**src/libs/Together/Generated/Together.Models.MultipartCompleteRequest.g.csis excluded by!**/generated/**src/libs/Together/Generated/Together.Models.MultipartCompleteRequestPart.Json.g.csis excluded by!**/generated/**src/libs/Together/Generated/Together.Models.MultipartCompleteRequestPart.g.csis excluded by!**/generated/**src/libs/Together/Generated/Together.Models.MultipartInitiateRequest.Json.g.csis excluded by!**/generated/**src/libs/Together/Generated/Together.Models.MultipartInitiateRequest.g.csis excluded by!**/generated/**src/libs/Together/Generated/Together.Models.MultipartInitiateResponse.Json.g.csis excluded by!**/generated/**src/libs/Together/Generated/Together.Models.MultipartInitiateResponse.g.csis excluded by!**/generated/**src/libs/Together/Generated/Together.Models.PartInfo.Json.g.csis excluded by!**/generated/**src/libs/Together/Generated/Together.Models.PartInfo.g.csis excluded by!**/generated/**src/libs/Together/Generated/Together.Models.PartInfoHeaders.Json.g.csis excluded by!**/generated/**src/libs/Together/Generated/Together.Models.PartInfoHeaders.g.csis excluded by!**/generated/**src/libs/Together/Generated/Together.Models.Response2.Json.g.csis excluded by!**/generated/**src/libs/Together/Generated/Together.Models.Response2.g.csis excluded by!**/generated/**
📒 Files selected for processing (1)
src/libs/Together/openapi.yaml(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Test / Build, test and publish
🔇 Additional comments (3)
src/libs/Together/openapi.yaml (3)
5393-5407: LGTM: Abort request schemaClear and consistent with other IDs.
5468-5487: LGTM: Initiate response envelopeMatches initiate request intent.
5408-5439: Do not change PartNumber/ETag to snake_case; fix ETag exampleGenerated clients and examples use PascalCase property names — changing to snake_case would be a breaking API change (see src/libs/Together/openapi.yaml and src/libs/Together/Generated/Together.Models.MultipartCompleteRequestPart.g.cs). Keep PartNumber/ETag as-is. Update the OpenAPI example to remove the surrounding quotes (example: abc123def456) and change the description to "ETag returned from S3 part upload (supply raw ETag without surrounding quotes)". If upstream actually requires the quotes, document that behavior explicitly and align clients/docs accordingly.
Likely an incorrect or invalid review comment.
| /files/multipart/abort: | ||
| post: | ||
| tags: | ||
| - Files | ||
| summary: Abort multipart upload | ||
| description: Abort a multipart upload and clean up any uploaded parts. | ||
| requestBody: | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: '#/components/schemas/MultipartAbortRequest' | ||
| required: true | ||
| responses: | ||
| '200': | ||
| description: Multipart upload aborted successfully | ||
| content: | ||
| application/json: | ||
| schema: | ||
| type: object | ||
| properties: | ||
| success: | ||
| type: boolean | ||
| example: true | ||
| '400': | ||
| description: Bad Request | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: '#/components/schemas/ErrorData' | ||
| '401': | ||
| description: Unauthorized | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: '#/components/schemas/ErrorData' | ||
| x-codeSamples: | ||
| - label: Together AI SDK (Python) | ||
| lang: Python | ||
| source: "from together import Together\nimport os\n\nclient = Together(\n api_key=os.environ.get(\"TOGETHER_API_KEY\"),\n)\n\nclient.files.multipart.abort(\n upload_id=\"upload-123\",\n file_id=\"file-456\"\n)\n" | ||
| /files/multipart/complete: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add operationId and standard 429/500 responses for parity
Bring this in line with other endpoints and improve codegen.
/files/multipart/abort:
post:
tags:
- Files
summary: Abort multipart upload
description: Abort a multipart upload and clean up any uploaded parts.
+ operationId: files-multipart-abort
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/MultipartAbortRequest'
required: true
responses:
'200':
description: Multipart upload aborted successfully
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
example: true
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorData'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorData'
+ '429':
+ description: RateLimit
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ErrorData'
+ '500':
+ description: Internal Server Error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ErrorData'📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| /files/multipart/abort: | |
| post: | |
| tags: | |
| - Files | |
| summary: Abort multipart upload | |
| description: Abort a multipart upload and clean up any uploaded parts. | |
| requestBody: | |
| content: | |
| application/json: | |
| schema: | |
| $ref: '#/components/schemas/MultipartAbortRequest' | |
| required: true | |
| responses: | |
| '200': | |
| description: Multipart upload aborted successfully | |
| content: | |
| application/json: | |
| schema: | |
| type: object | |
| properties: | |
| success: | |
| type: boolean | |
| example: true | |
| '400': | |
| description: Bad Request | |
| content: | |
| application/json: | |
| schema: | |
| $ref: '#/components/schemas/ErrorData' | |
| '401': | |
| description: Unauthorized | |
| content: | |
| application/json: | |
| schema: | |
| $ref: '#/components/schemas/ErrorData' | |
| x-codeSamples: | |
| - label: Together AI SDK (Python) | |
| lang: Python | |
| source: "from together import Together\nimport os\n\nclient = Together(\n api_key=os.environ.get(\"TOGETHER_API_KEY\"),\n)\n\nclient.files.multipart.abort(\n upload_id=\"upload-123\",\n file_id=\"file-456\"\n)\n" | |
| /files/multipart/complete: | |
| /files/multipart/abort: | |
| post: | |
| tags: | |
| - Files | |
| summary: Abort multipart upload | |
| description: Abort a multipart upload and clean up any uploaded parts. | |
| operationId: files-multipart-abort | |
| requestBody: | |
| content: | |
| application/json: | |
| schema: | |
| $ref: '#/components/schemas/MultipartAbortRequest' | |
| required: true | |
| responses: | |
| '200': | |
| description: Multipart upload aborted successfully | |
| content: | |
| application/json: | |
| schema: | |
| type: object | |
| properties: | |
| success: | |
| type: boolean | |
| example: true | |
| '400': | |
| description: Bad Request | |
| content: | |
| application/json: | |
| schema: | |
| $ref: '#/components/schemas/ErrorData' | |
| '401': | |
| description: Unauthorized | |
| content: | |
| application/json: | |
| schema: | |
| $ref: '#/components/schemas/ErrorData' | |
| '429': | |
| description: RateLimit | |
| content: | |
| application/json: | |
| schema: | |
| $ref: '#/components/schemas/ErrorData' | |
| '500': | |
| description: Internal Server Error | |
| content: | |
| application/json: | |
| schema: | |
| $ref: '#/components/schemas/ErrorData' | |
| x-codeSamples: | |
| - label: Together AI SDK (Python) | |
| lang: Python | |
| source: "from together import Together\nimport os\n\nclient = Together(\n api_key=os.environ.get(\"TOGETHER_API_KEY\"),\n)\n\nclient.files.multipart.abort(\n upload_id=\"upload-123\",\n file_id=\"file-456\"\n)\n" | |
| /files/multipart/complete: |
🤖 Prompt for AI Agents
In src/libs/Together/openapi.yaml around lines 1197 to 1236, the POST
/files/multipart/abort operation is missing an operationId and the standard 429
and 500 response definitions used elsewhere; add an operationId (e.g.,
files.multipart.abort) directly under the post verb, and add '429' and '500'
responses alongside the existing 200/400/401 responses using the same ErrorData
schema (application/json -> $ref: '#/components/schemas/ErrorData') so the
endpoint matches other specs and enables consistent codegen.
| post: | ||
| tags: | ||
| - Files | ||
| summary: Complete multipart upload | ||
| description: Complete a multipart upload by providing ETags for all uploaded parts. | ||
| requestBody: | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: '#/components/schemas/MultipartCompleteRequest' | ||
| required: true | ||
| responses: | ||
| '200': | ||
| description: Multipart upload completed successfully | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: '#/components/schemas/FileResponse' | ||
| '400': | ||
| description: Bad Request | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: '#/components/schemas/ErrorData' | ||
| '401': | ||
| description: Unauthorized | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: '#/components/schemas/ErrorData' | ||
| x-codeSamples: | ||
| - label: Together AI SDK (Python) | ||
| lang: Python | ||
| source: "from together import Together\nimport os\n\nclient = Together(\n api_key=os.environ.get(\"TOGETHER_API_KEY\"),\n)\n\nresponse = client.files.multipart.complete(\n upload_id=\"upload-123\",\n file_id=\"file-456\",\n parts=[\n {\"PartNumber\": 1, \"ETag\": \"etag1\"},\n {\"PartNumber\": 2, \"ETag\": \"etag2\"}\n ]\n)\n\nprint(response.id)\n" | ||
| /files/multipart/initiate: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add operationId and 429/500 responses
Align with existing patterns and aid SDK generation.
/files/multipart/complete:
post:
tags:
- Files
summary: Complete multipart upload
description: Complete a multipart upload by providing ETags for all uploaded parts.
+ operationId: files-multipart-complete
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/MultipartCompleteRequest'
required: true
responses:
'200':
description: Multipart upload completed successfully
content:
application/json:
schema:
$ref: '#/components/schemas/FileResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorData'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorData'
+ '429':
+ description: RateLimit
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ErrorData'
+ '500':
+ description: Internal Server Error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ErrorData'📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| post: | |
| tags: | |
| - Files | |
| summary: Complete multipart upload | |
| description: Complete a multipart upload by providing ETags for all uploaded parts. | |
| requestBody: | |
| content: | |
| application/json: | |
| schema: | |
| $ref: '#/components/schemas/MultipartCompleteRequest' | |
| required: true | |
| responses: | |
| '200': | |
| description: Multipart upload completed successfully | |
| content: | |
| application/json: | |
| schema: | |
| $ref: '#/components/schemas/FileResponse' | |
| '400': | |
| description: Bad Request | |
| content: | |
| application/json: | |
| schema: | |
| $ref: '#/components/schemas/ErrorData' | |
| '401': | |
| description: Unauthorized | |
| content: | |
| application/json: | |
| schema: | |
| $ref: '#/components/schemas/ErrorData' | |
| x-codeSamples: | |
| - label: Together AI SDK (Python) | |
| lang: Python | |
| source: "from together import Together\nimport os\n\nclient = Together(\n api_key=os.environ.get(\"TOGETHER_API_KEY\"),\n)\n\nresponse = client.files.multipart.complete(\n upload_id=\"upload-123\",\n file_id=\"file-456\",\n parts=[\n {\"PartNumber\": 1, \"ETag\": \"etag1\"},\n {\"PartNumber\": 2, \"ETag\": \"etag2\"}\n ]\n)\n\nprint(response.id)\n" | |
| /files/multipart/initiate: | |
| post: | |
| tags: | |
| - Files | |
| summary: Complete multipart upload | |
| description: Complete a multipart upload by providing ETags for all uploaded parts. | |
| operationId: files-multipart-complete | |
| requestBody: | |
| content: | |
| application/json: | |
| schema: | |
| $ref: '#/components/schemas/MultipartCompleteRequest' | |
| required: true | |
| responses: | |
| '200': | |
| description: Multipart upload completed successfully | |
| content: | |
| application/json: | |
| schema: | |
| $ref: '#/components/schemas/FileResponse' | |
| '400': | |
| description: Bad Request | |
| content: | |
| application/json: | |
| schema: | |
| $ref: '#/components/schemas/ErrorData' | |
| '401': | |
| description: Unauthorized | |
| content: | |
| application/json: | |
| schema: | |
| $ref: '#/components/schemas/ErrorData' | |
| '429': | |
| description: RateLimit | |
| content: | |
| application/json: | |
| schema: | |
| $ref: '#/components/schemas/ErrorData' | |
| '500': | |
| description: Internal Server Error | |
| content: | |
| application/json: | |
| schema: | |
| $ref: '#/components/schemas/ErrorData' | |
| x-codeSamples: | |
| - label: Together AI SDK (Python) | |
| lang: Python | |
| source: "from together import Together\nimport os\n\nclient = Together(\n api_key=os.environ.get(\"TOGETHER_API_KEY\"),\n)\n\nresponse = client.files.multipart.complete(\n upload_id=\"upload-123\",\n file_id=\"file-456\",\n parts=[\n {\"PartNumber\": 1, \"ETag\": \"etag1\"},\n {\"PartNumber\": 2, \"ETag\": \"etag2\"}\n ]\n)\n\nprint(response.id)\n" | |
| /files/multipart/initiate: |
🤖 Prompt for AI Agents
In src/libs/Together/openapi.yaml around lines 1237 to 1271, the POST
/files/multipart/complete operation is missing an operationId and lacks standard
429 and 500 response entries; add a unique operationId following the repo
pattern (e.g., Files.multipartComplete) and add '429' (Too Many Requests) and
'500' (Internal Server Error) response objects mirroring the existing error
schema entries (application/json -> $ref: '#/components/schemas/ErrorData') so
SDK generators and callers handle rate limits and server errors consistently.
| - label: Together AI SDK (Python) | ||
| lang: Python | ||
| source: "from together import Together\nimport os\n\nclient = Together(\n api_key=os.environ.get(\"TOGETHER_API_KEY\"),\n)\n\nresponse = client.files.multipart.complete(\n upload_id=\"upload-123\",\n file_id=\"file-456\",\n parts=[\n {\"PartNumber\": 1, \"ETag\": \"etag1\"},\n {\"PartNumber\": 2, \"ETag\": \"etag2\"}\n ]\n)\n\nprint(response.id)\n" | ||
| /files/multipart/initiate: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update code sample to match field casing (see rename suggestion below)
Switch to snake_case for consistency across the API.
response = client.files.multipart.complete(
upload_id="upload-123",
file_id="file-456",
parts=[
- {"PartNumber": 1, "ETag": "etag1"},
- {"PartNumber": 2, "ETag": "etag2"}
+ {"part_number": 1, "etag": "etag1"},
+ {"part_number": 2, "etag": "etag2"}
]
)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - label: Together AI SDK (Python) | |
| lang: Python | |
| source: "from together import Together\nimport os\n\nclient = Together(\n api_key=os.environ.get(\"TOGETHER_API_KEY\"),\n)\n\nresponse = client.files.multipart.complete(\n upload_id=\"upload-123\",\n file_id=\"file-456\",\n parts=[\n {\"PartNumber\": 1, \"ETag\": \"etag1\"},\n {\"PartNumber\": 2, \"ETag\": \"etag2\"}\n ]\n)\n\nprint(response.id)\n" | |
| /files/multipart/initiate: | |
| - label: Together AI SDK (Python) | |
| lang: Python | |
| source: "from together import Together\nimport os\n\nclient = Together(\n api_key=os.environ.get(\"TOGETHER_API_KEY\"),\n)\n\nresponse = client.files.multipart.complete(\n upload_id=\"upload-123\",\n file_id=\"file-456\",\n parts=[\n {\"part_number\": 1, \"etag\": \"etag1\"},\n {\"part_number\": 2, \"etag\": \"etag2\"}\n ]\n)\n\nprint(response.id)\n" | |
| /files/multipart/initiate: |
🤖 Prompt for AI Agents
In src/libs/Together/openapi.yaml around lines 1268 to 1271, the Python example
uses mixed camelCase/TitleCase fields in the parts array ("PartNumber" and
"ETag"); update the sample to use snake_case to match the API (e.g.,
"part_number" and "etag") so the parts entries and any other renamed fields
follow snake_case consistency (keep upload_id and file_id as-is), and ensure the
sample request structure mirrors the API field names exactly.
| post: | ||
| tags: | ||
| - Files | ||
| summary: Initiate multipart upload | ||
| description: Initiate a multipart upload for large files (>5GB) with presigned URLs for each part. | ||
| requestBody: | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: '#/components/schemas/MultipartInitiateRequest' | ||
| required: true | ||
| responses: | ||
| '200': | ||
| description: Multipart upload initiated successfully | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: '#/components/schemas/MultipartInitiateResponse' | ||
| '400': | ||
| description: Bad Request | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: '#/components/schemas/ErrorData' | ||
| '401': | ||
| description: Unauthorized | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: '#/components/schemas/ErrorData' | ||
| x-codeSamples: | ||
| - label: Together AI SDK (Python) | ||
| lang: Python | ||
| source: "from together import Together\nimport os\n\nclient = Together(\n api_key=os.environ.get(\"TOGETHER_API_KEY\"),\n)\n\nresponse = client.files.multipart.initiate(\n filename=\"large_dataset.jsonl\",\n file_size=7516192768, # 7GB\n num_parts=75,\n purpose=\"fine-tune\",\n file_type=\"jsonl\"\n)\n\nprint(response.upload_id)\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add operationId and 429/500 responses
Consistent with other endpoints and improves client generation.
/files/multipart/initiate:
post:
tags:
- Files
summary: Initiate multipart upload
description: Initiate a multipart upload for large files (>5GB) with presigned URLs for each part.
+ operationId: files-multipart-initiate
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/MultipartInitiateRequest'
required: true
responses:
'200':
description: Multipart upload initiated successfully
content:
application/json:
schema:
$ref: '#/components/schemas/MultipartInitiateResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorData'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorData'
+ '429':
+ description: RateLimit
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ErrorData'
+ '500':
+ description: Internal Server Error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ErrorData'📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| post: | |
| tags: | |
| - Files | |
| summary: Initiate multipart upload | |
| description: Initiate a multipart upload for large files (>5GB) with presigned URLs for each part. | |
| requestBody: | |
| content: | |
| application/json: | |
| schema: | |
| $ref: '#/components/schemas/MultipartInitiateRequest' | |
| required: true | |
| responses: | |
| '200': | |
| description: Multipart upload initiated successfully | |
| content: | |
| application/json: | |
| schema: | |
| $ref: '#/components/schemas/MultipartInitiateResponse' | |
| '400': | |
| description: Bad Request | |
| content: | |
| application/json: | |
| schema: | |
| $ref: '#/components/schemas/ErrorData' | |
| '401': | |
| description: Unauthorized | |
| content: | |
| application/json: | |
| schema: | |
| $ref: '#/components/schemas/ErrorData' | |
| x-codeSamples: | |
| - label: Together AI SDK (Python) | |
| lang: Python | |
| source: "from together import Together\nimport os\n\nclient = Together(\n api_key=os.environ.get(\"TOGETHER_API_KEY\"),\n)\n\nresponse = client.files.multipart.initiate(\n filename=\"large_dataset.jsonl\",\n file_size=7516192768, # 7GB\n num_parts=75,\n purpose=\"fine-tune\",\n file_type=\"jsonl\"\n)\n\nprint(response.upload_id)\n" | |
| post: | |
| tags: | |
| - Files | |
| summary: Initiate multipart upload | |
| description: Initiate a multipart upload for large files (>5GB) with presigned URLs for each part. | |
| operationId: files-multipart-initiate | |
| requestBody: | |
| content: | |
| application/json: | |
| schema: | |
| $ref: '#/components/schemas/MultipartInitiateRequest' | |
| required: true | |
| responses: | |
| '200': | |
| description: Multipart upload initiated successfully | |
| content: | |
| application/json: | |
| schema: | |
| $ref: '#/components/schemas/MultipartInitiateResponse' | |
| '400': | |
| description: Bad Request | |
| content: | |
| application/json: | |
| schema: | |
| $ref: '#/components/schemas/ErrorData' | |
| '401': | |
| description: Unauthorized | |
| content: | |
| application/json: | |
| schema: | |
| $ref: '#/components/schemas/ErrorData' | |
| '429': | |
| description: RateLimit | |
| content: | |
| application/json: | |
| schema: | |
| $ref: '#/components/schemas/ErrorData' | |
| '500': | |
| description: Internal Server Error | |
| content: | |
| application/json: | |
| schema: | |
| $ref: '#/components/schemas/ErrorData' | |
| x-codeSamples: | |
| - label: Together AI SDK (Python) | |
| lang: Python | |
| source: "from together import Together\nimport os\n\nclient = Together(\n api_key=os.environ.get(\"TOGETHER_API_KEY\"),\n)\n\nresponse = client.files.multipart.initiate(\n filename=\"large_dataset.jsonl\",\n file_size=7516192768, # 7GB\n num_parts=75,\n purpose=\"fine-tune\",\n file_type=\"jsonl\"\n)\n\nprint(response.upload_id)\n" |
🤖 Prompt for AI Agents
In src/libs/Together/openapi.yaml around lines 1272 to 1305, the POST /files
multipart initiate operation is missing an operationId and 429/500 responses;
add an operationId (e.g., files.multipart.initiate) under the post and add 429
and 500 response entries mirroring other endpoints that return application/json
with schema $ref: '#/components/schemas/ErrorData' and appropriate descriptions
(e.g., Too Many Requests and Internal Server Error) so client generators and
error handling are consistent.
| required: | ||
| - PartNumber | ||
| - URL | ||
| type: object | ||
| properties: | ||
| Headers: | ||
| type: object | ||
| additionalProperties: | ||
| type: string | ||
| description: Headers to include with the upload request | ||
| example: | ||
| Authorization: Bearer token | ||
| PartNumber: | ||
| type: integer | ||
| description: Part number (1-based) | ||
| example: 1 | ||
| URL: | ||
| type: string | ||
| description: Presigned URL for uploading this part | ||
| example: https://s3.amazonaws.com/... | ||
| Pricing: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use snake_case in PartInfo; add URL format; fix headers example
Unify casing with API, add uri format, and avoid misleading Authorization example for presigned uploads.
PartInfo:
required:
- - PartNumber
- - URL
+ - part_number
+ - url
type: object
properties:
- Headers:
+ headers:
type: object
additionalProperties:
type: string
description: Headers to include with the upload request
- example:
- Authorization: Bearer token
- PartNumber:
+ example:
+ x-amz-server-side-encryption: AES256
+ Content-Type: application/octet-stream
+ part_number:
type: integer
description: Part number (1-based)
example: 1
- URL:
+ url:
type: string
description: Presigned URL for uploading this part
+ format: uri
example: https://s3.amazonaws.com/...📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| required: | |
| - PartNumber | |
| - URL | |
| type: object | |
| properties: | |
| Headers: | |
| type: object | |
| additionalProperties: | |
| type: string | |
| description: Headers to include with the upload request | |
| example: | |
| Authorization: Bearer token | |
| PartNumber: | |
| type: integer | |
| description: Part number (1-based) | |
| example: 1 | |
| URL: | |
| type: string | |
| description: Presigned URL for uploading this part | |
| example: https://s3.amazonaws.com/... | |
| Pricing: | |
| required: | |
| - part_number | |
| - url | |
| type: object | |
| properties: | |
| headers: | |
| type: object | |
| additionalProperties: | |
| type: string | |
| description: Headers to include with the upload request | |
| example: | |
| x-amz-server-side-encryption: AES256 | |
| Content-Type: application/octet-stream | |
| part_number: | |
| type: integer | |
| description: Part number (1-based) | |
| example: 1 | |
| url: | |
| type: string | |
| description: Presigned URL for uploading this part | |
| format: uri | |
| example: https://s3.amazonaws.com/... | |
| Pricing: |
🤖 Prompt for AI Agents
In src/libs/Together/openapi.yaml around lines 5488 to 5508, the PartInfo object
uses mixed/camelCase and lacks a URL format and its Headers example is
misleading; rename fields to snake_case (part_number, url), set the URL schema
to format: uri, and update the Headers example to neutral key(s) (e.g.,
Content-Type: application/octet-stream) or remove Authorization so it doesn't
imply presigned upload requires an auth header; keep required names updated to
match snake_case.
Summary by CodeRabbit
New Features
Documentation