Skip to content

Conversation

@HavenDV
Copy link
Contributor

@HavenDV HavenDV commented Sep 4, 2025

Summary by CodeRabbit

  • New Features

    • Added a DELETE endpoint to remove fine-tuning jobs, with support for a required id and force option.
    • Standardized success response with a message field; returns clear statuses for success, not found, and server errors.
  • Documentation

    • Added public code samples for Python, TypeScript, JavaScript, and cURL demonstrating job deletion.
    • Documented request parameters, responses, and example usage for the new endpoint.

@coderabbitai
Copy link

coderabbitai bot commented Sep 4, 2025

Walkthrough

Adds a DELETE /fine-tunes/{id} endpoint with required id path and force query parameters, defines a FinetuneDeleteResponse schema, and wires responses (200/404/500). Includes x-codeSamples for Python, TypeScript, JavaScript, and cURL in src/libs/Together/openapi.yaml.

Changes

Cohort / File(s) Summary of changes
OpenAPI: Fine-tune deletion
src/libs/Together/openapi.yaml
Added DELETE /fine-tunes/{id} with required id (path) and force (query). Introduced FinetuneDeleteResponse schema and referenced it in 200 response. Documented 404/500 as ErrorData. Added x-codeSamples for Python, TypeScript, JavaScript, and cURL.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant C as Client
  participant A as API Server
  participant S as Fine-tune Service
  Note over C,A: DELETE /fine-tunes/{id}?force=true|false

  C->>A: DELETE /fine-tunes/{id}?force={bool}
  A->>S: Request delete(id, force)
  alt Job exists
    S->>S: Validate state / apply force
    S-->>A: { message }
    A-->>C: 200 FinetuneDeleteResponse
  else Job not found
    S-->>A: NotFound error
    A-->>C: 404 ErrorData
  else Internal error
    S-->>A: Server error
    A-->>C: 500 ErrorData
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I tap my paws and prune the queue,
A tidy hop—DELETE on cue.
With force or not, the jobs take flight,
A message left: “All clear, all right.”
Carrot logs green-light my spree—
Fine-tunes trimmed, more fields to see. 🥕✨

✨ 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_202509041238

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot enabled auto-merge September 4, 2025 12:39
@github-actions github-actions bot merged commit 2b5e5c9 into main Sep 4, 2025
3 of 4 checks passed
@github-actions github-actions bot deleted the bot/update-openapi_202509041238 branch September 4, 2025 12:41
@coderabbitai coderabbitai bot changed the title feat:@coderabbitai feat:Add DELETE /fine-tunes/{id}, force query, response schema, examples Sep 4, 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: 1

🧹 Nitpick comments (3)
src/libs/Together/openapi.yaml (3)

1530-1530: Remove trailing spaces on default:.

YAMLlint flagged trailing spaces; fixing the default to false (above) resolves both validity and linting.


4415-4421: Enrich delete response shape for consistency with other deletes.

Current response only returns message. Consider aligning with FileDeleteResponse by including id and deleted (and making them required). Keeps APIs predictable.

   FinetuneDeleteResponse:
     type: object
+    required:
+      - id
+      - deleted
     properties:
+      id:
+        type: string
+        description: Fine-tune ID that was deleted
+      deleted:
+        type: boolean
+        description: Whether the fine-tune job was deleted
       message:
         type: string
         description: Message indicating the result of the deletion

1514-1562: Consider 204 No Content for DELETE for REST consistency.

Other DELETEs (e.g., /endpoints/{endpointId}) return 204. If you stick with 200 + body, that’s fine—just documenting the intentional divergence is helpful.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 910e898 and 34fe679.

⛔ Files ignored due to path filters (5)
  • src/libs/Together/Generated/Together.FineTuningClient.DeleteFineTunesById.g.cs is excluded by !**/generated/**
  • src/libs/Together/Generated/Together.IFineTuningClient.DeleteFineTunesById.g.cs is excluded by !**/generated/**
  • src/libs/Together/Generated/Together.JsonSerializerContextTypes.g.cs is excluded by !**/generated/**
  • src/libs/Together/Generated/Together.Models.FinetuneDeleteResponse.Json.g.cs is excluded by !**/generated/**
  • src/libs/Together/Generated/Together.Models.FinetuneDeleteResponse.g.cs is excluded by !**/generated/**
📒 Files selected for processing (1)
  • src/libs/Together/openapi.yaml (2 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
src/libs/Together/openapi.yaml

[error] 1530-1530: trailing spaces

(trailing-spaces)

⏰ 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

Comment on lines +1514 to +1562
delete:
tags:
- Fine-tuning
summary: Delete a fine-tune job
description: Delete a fine-tuning job.
parameters:
- name: id
in: path
required: true
schema:
type: string
- name: force
in: query
required: true
schema:
type: boolean
default:
responses:
'200':
description: Fine-tune job deleted successfully
content:
application/json:
schema:
$ref: '#/components/schemas/FinetuneDeleteResponse'
'404':
description: Fine-tune job not found
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.fine_tuning.delete(id=\"ft-id\")\n\nprint(response)\n"
- label: Together AI SDK (TypeScript)
lang: TypeScript
source: "import Together from \"together-ai\";\n\nconst client = new Together({\n apiKey: process.env.TOGETHER_API_KEY,\n});\n\nconst response = await client.fineTune.delete(\"ft-id\");\n\nconsole.log(response);\n"
- label: Together AI SDK (JavaScript)
lang: JavaScript
source: "import Together from \"together-ai\";\n\nconst client = new Together({\n apiKey: process.env.TOGETHER_API_KEY,\n});\n\nconst response = await client.fineTune.delete(\"ft-id\");\n\nconsole.log(response);\n"
- label: cURL
lang: Shell
source: "curl -X \"DELETE\" \"https://api.together.xyz/v1/fine-tunes/ft-id?force=false\" \\\n -H \"Authorization: Bearer $TOGETHER_API_KEY\" \\\n -H \"Content-Type: application/json\"\n"
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

⚠️ Potential issue

Fix required 'force' param and invalid default; align contract with SDKs and add operationId.

  • force is marked required but SDK samples omit it; contract mismatch.
  • default: is empty (null) for a boolean, invalid per OpenAPI and flagged by yamllint.
  • Missing operationId; add for better codegen.
  • Add descriptions/examples and 400 response for bad input.

Apply:

   delete:
     tags:
       - Fine-tuning
     summary: Delete a fine-tune job
     description: Delete a fine-tuning job.
+    operationId: fine-tunes-delete
     parameters:
       - name: id
         in: path
         required: true
         schema:
           type: string
+        description: Fine-tune ID to delete. A string that starts with `ft-`.
+        example: ft-01234567890123456789
       - name: force
         in: query
-        required: true
+        required: false
+        description: Force delete even if the job is running or queued. When false, deletion may fail for non-terminal jobs.
         schema:
           type: boolean
-          default: 
+          default: false
+        example: false
     responses:
+      '400':
+        description: Bad Request
+        content:
+          application/json:
+            schema:
+              $ref: '#/components/schemas/ErrorData'
       '200':
         description: Fine-tune job deleted successfully
         content:
           application/json:
             schema:
               $ref: '#/components/schemas/FinetuneDeleteResponse'
📝 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
delete:
tags:
- Fine-tuning
summary: Delete a fine-tune job
description: Delete a fine-tuning job.
parameters:
- name: id
in: path
required: true
schema:
type: string
- name: force
in: query
required: true
schema:
type: boolean
default:
responses:
'200':
description: Fine-tune job deleted successfully
content:
application/json:
schema:
$ref: '#/components/schemas/FinetuneDeleteResponse'
'404':
description: Fine-tune job not found
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.fine_tuning.delete(id=\"ft-id\")\n\nprint(response)\n"
- label: Together AI SDK (TypeScript)
lang: TypeScript
source: "import Together from \"together-ai\";\n\nconst client = new Together({\n apiKey: process.env.TOGETHER_API_KEY,\n});\n\nconst response = await client.fineTune.delete(\"ft-id\");\n\nconsole.log(response);\n"
- label: Together AI SDK (JavaScript)
lang: JavaScript
source: "import Together from \"together-ai\";\n\nconst client = new Together({\n apiKey: process.env.TOGETHER_API_KEY,\n});\n\nconst response = await client.fineTune.delete(\"ft-id\");\n\nconsole.log(response);\n"
- label: cURL
lang: Shell
source: "curl -X \"DELETE\" \"https://api.together.xyz/v1/fine-tunes/ft-id?force=false\" \\\n -H \"Authorization: Bearer $TOGETHER_API_KEY\" \\\n -H \"Content-Type: application/json\"\n"
delete:
tags:
- Fine-tuning
summary: Delete a fine-tune job
description: Delete a fine-tuning job.
operationId: fine-tunes-delete
parameters:
- name: id
in: path
required: true
description: Fine-tune ID to delete. A string that starts with `ft-`.
example: ft-01234567890123456789
schema:
type: string
- name: force
in: query
required: false
description: Force delete even if the job is running or queued. When false, deletion may fail for non-terminal jobs.
schema:
type: boolean
default: false
example: false
responses:
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorData'
'200':
description: Fine-tune job deleted successfully
content:
application/json:
schema:
$ref: '#/components/schemas/FinetuneDeleteResponse'
'404':
description: Fine-tune job not found
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.fine_tuning.delete(id=\"ft-id\")\n\nprint(response)\n"
- label: Together AI SDK (TypeScript)
lang: TypeScript
source: "import Together from \"together-ai\";\n\nconst client = new Together({\n apiKey: process.env.TOGETHER_API_KEY,\n});\n\nconst response = await client.fineTune.delete(\"ft-id\");\n\nconsole.log(response);\n"
- label: Together AI SDK (JavaScript)
lang: JavaScript
source: "import Together from \"together-ai\";\n\nconst client = new Together({\n apiKey: process.env.TOGETHER_API_KEY,\n});\n\nconst response = await client.fineTune.delete(\"ft-id\");\n\nconsole.log(response);\n"
- label: cURL
lang: Shell
source: "curl -X \"DELETE\" \"https://api.together.xyz/v1/fine-tunes/ft-id?force=false\" \\\n -H \"Authorization: Bearer $TOGETHER_API_KEY\" \\\n -H \"Content-Type: application/json\"\n"
🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 1530-1530: trailing spaces

(trailing-spaces)

🤖 Prompt for AI Agents
In src/libs/Together/openapi.yaml around lines 1514-1562, the DELETE fine-tune
endpoint has an invalid and inconsistent `force` parameter (marked required, has
an empty default, and SDK samples omit it), and the operation lacks an
operationId and a 400 response; update the parameter to be optional (remove
required: true), set a valid boolean default (e.g. default: false), add a brief
description and example for `force` (e.g. "Force deletion even if job is
running"), add an operationId like `deleteFineTune`, and add a 400 response
entry for invalid input (with ErrorData schema) so the contract aligns with SDK
usage and passes OpenAPI/YAML linting.

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