-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat:Add DELETE /fine-tunes/{id}, force query, response schema, examples #149
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 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
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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
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: 1
🧹 Nitpick comments (3)
src/libs/Together/openapi.yaml (3)
1530-1530: Remove trailing spaces ondefault:.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 withFileDeleteResponseby includingidanddeleted(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.
⛔ Files ignored due to path filters (5)
src/libs/Together/Generated/Together.FineTuningClient.DeleteFineTunesById.g.csis excluded by!**/generated/**src/libs/Together/Generated/Together.IFineTuningClient.DeleteFineTunesById.g.csis excluded by!**/generated/**src/libs/Together/Generated/Together.JsonSerializerContextTypes.g.csis excluded by!**/generated/**src/libs/Together/Generated/Together.Models.FinetuneDeleteResponse.Json.g.csis excluded by!**/generated/**src/libs/Together/Generated/Together.Models.FinetuneDeleteResponse.g.csis 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
| 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" |
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.
🛠️ Refactor suggestion
Fix required 'force' param and invalid default; align contract with SDKs and add operationId.
forceis 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.
| 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.
Summary by CodeRabbit
New Features
Documentation