Skip to content

Conversation

@HavenDV
Copy link
Contributor

@HavenDV HavenDV commented Sep 24, 2025

Summary by CodeRabbit

  • New Features

    • Introduced multipart file uploads with endpoints to initiate, complete, and abort uploads.
    • Supports large files by returning presigned URLs for each part, enabling parallel part uploads.
    • Provides structured responses for tracking upload IDs, file IDs, and part details.
  • Documentation

    • Added usage examples illustrating multipart upload flows, including initiating uploads, uploading parts with presigned URLs, and completing or aborting uploads.

@coderabbitai
Copy link

coderabbitai bot commented Sep 24, 2025

Walkthrough

Adds 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

Cohort / File(s) Summary of changes
Endpoints: Multipart upload
src/libs/Together/openapi.yaml
Added POST /files/multipart/initiate, /files/multipart/complete, /files/multipart/abort with 200/400/401 responses and Python examples.
Schemas: Multipart models
src/libs/Together/openapi.yaml
Introduced MultipartInitiateRequest/Response, MultipartCompleteRequest, MultipartAbortRequest, and PartInfo (PartNumber, URL, Headers).

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
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I nibble bytes and hop through parts,
Presigned trails and header hearts—
Initiate! Upload! Complete the art,
Or thump to abort and restart.
With ETags tucked in my fluffy pack,
I stitch big files, no single crack.
Hippity-hop, the chunks come back! 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title Check ❓ Inconclusive The title "feat:@coderabbitai" is a terse tag that does not describe the PR's contents; this change adds multipart file upload endpoints (initiate, complete, abort) and related schemas to openapi.yaml, so the title is too generic to inform reviewers. Please update the PR title to a concise descriptive sentence that summarizes the main change, for example: "feat(files): add multipart upload endpoints (initiate, complete, abort)".
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bot/update-openapi_202509240126

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.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot enabled auto-merge September 24, 2025 01:27
@github-actions github-actions bot merged commit 1ce9071 into main Sep 24, 2025
2 of 3 checks passed
@github-actions github-actions bot deleted the bot/update-openapi_202509240126 branch September 24, 2025 01:29
@coderabbitai coderabbitai bot changed the title feat:@coderabbitai feat:Add initiate/complete/abort multipart upload endpoints to OpenAPI Sep 24, 2025
Copy link

@coderabbitai coderabbitai bot left a 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_size

Add 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

📥 Commits

Reviewing files that changed from the base of the PR and between b4808ed and 7327636.

⛔ Files ignored due to path filters (23)
  • src/libs/Together/Generated/Together.FilesClient.CreateFilesMultipartAbort.g.cs is excluded by !**/generated/**
  • src/libs/Together/Generated/Together.FilesClient.CreateFilesMultipartComplete.g.cs is excluded by !**/generated/**
  • src/libs/Together/Generated/Together.FilesClient.CreateFilesMultipartInitiate.g.cs is excluded by !**/generated/**
  • src/libs/Together/Generated/Together.IFilesClient.CreateFilesMultipartAbort.g.cs is excluded by !**/generated/**
  • src/libs/Together/Generated/Together.IFilesClient.CreateFilesMultipartComplete.g.cs is excluded by !**/generated/**
  • src/libs/Together/Generated/Together.IFilesClient.CreateFilesMultipartInitiate.g.cs is excluded by !**/generated/**
  • src/libs/Together/Generated/Together.JsonSerializerContextTypes.g.cs is excluded by !**/generated/**
  • src/libs/Together/Generated/Together.Models.MultipartAbortRequest.Json.g.cs is excluded by !**/generated/**
  • src/libs/Together/Generated/Together.Models.MultipartAbortRequest.g.cs is excluded by !**/generated/**
  • src/libs/Together/Generated/Together.Models.MultipartCompleteRequest.Json.g.cs is excluded by !**/generated/**
  • src/libs/Together/Generated/Together.Models.MultipartCompleteRequest.g.cs is excluded by !**/generated/**
  • src/libs/Together/Generated/Together.Models.MultipartCompleteRequestPart.Json.g.cs is excluded by !**/generated/**
  • src/libs/Together/Generated/Together.Models.MultipartCompleteRequestPart.g.cs is excluded by !**/generated/**
  • src/libs/Together/Generated/Together.Models.MultipartInitiateRequest.Json.g.cs is excluded by !**/generated/**
  • src/libs/Together/Generated/Together.Models.MultipartInitiateRequest.g.cs is excluded by !**/generated/**
  • src/libs/Together/Generated/Together.Models.MultipartInitiateResponse.Json.g.cs is excluded by !**/generated/**
  • src/libs/Together/Generated/Together.Models.MultipartInitiateResponse.g.cs is excluded by !**/generated/**
  • src/libs/Together/Generated/Together.Models.PartInfo.Json.g.cs is excluded by !**/generated/**
  • src/libs/Together/Generated/Together.Models.PartInfo.g.cs is excluded by !**/generated/**
  • src/libs/Together/Generated/Together.Models.PartInfoHeaders.Json.g.cs is excluded by !**/generated/**
  • src/libs/Together/Generated/Together.Models.PartInfoHeaders.g.cs is excluded by !**/generated/**
  • src/libs/Together/Generated/Together.Models.Response2.Json.g.cs is excluded by !**/generated/**
  • src/libs/Together/Generated/Together.Models.Response2.g.cs is 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 schema

Clear and consistent with other IDs.


5468-5487: LGTM: Initiate response envelope

Matches initiate request intent.


5408-5439: Do not change PartNumber/ETag to snake_case; fix ETag example

Generated 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.

Comment on lines +1197 to +1236
/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:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

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.

Suggested change
/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.

Comment on lines +1237 to +1271
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:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

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.

Suggested change
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.

Comment on lines +1268 to +1271
- 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:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

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.

Suggested change
- 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.

Comment on lines +1272 to +1305
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"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

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.

Suggested change
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.

Comment on lines +5488 to 5508
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:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

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.

Suggested change
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants