Skip to content

Commit 95ac642

Browse files
Update api spec (#686)
* YOYO NEW API SPEC! * I have generated the library! --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent d1c9bff commit 95ac642

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

kittycad.rs.patch.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@
267267
"op": "add",
268268
"path": "/paths/~1ml~1text-to-cad~1multi-file~1iteration/post/x-rust",
269269
"value": {
270-
"example": "/// Iterate on a CAD model with a prompt.\n/// \n/// This endpoint can iterate on multi-file models.\n/// \n/// Even if you give specific ranges to edit, the model might change more than just those in order to make the changes you requested without breaking the code.\n/// \n/// You always get the whole code back, even if you only changed a small part of it. This endpoint will always return all the code back, including files that were not changed. If your original source code imported a stl/gltf/step/etc file, the output will not include that file since the model will never change non-kcl files. The endpoint will only return the kcl files that were changed.\n/// \n/// This operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.\nasync fn example_ml_create_text_to_cad_multi_file_iteration() -> anyhow::Result<()> {\n let client = kittycad::Client::new_from_env();\n let result: kittycad::types::TextToCadMultiFileIteration = client\n .ml()\n .create_text_to_cad_multi_file_iteration(\n vec![kittycad::types::multipart::Attachment {\n name: \"thing\".to_string(),\n filename: Some(\"myfile.json\".to_string()),\n content_type: Some(\"application/json\".to_string()),\n data: std::fs::read(\"myfile.json\").unwrap(),\n }],\n &kittycad::types::TextToCadMultiFileIterationBody {\n kcl_version: Some(\"some-string\".to_string()),\n project_name: Some(\"some-string\".to_string()),\n source_ranges: vec![kittycad::types::SourceRangePrompt {\n file: Some(\"some-string\".to_string()),\n prompt: \"some-string\".to_string(),\n range: kittycad::types::SourceRange {\n end: kittycad::types::SourcePosition {\n column: 4 as u32,\n line: 4 as u32,\n },\n start: kittycad::types::SourcePosition {\n column: 4 as u32,\n line: 4 as u32,\n },\n },\n }],\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n",
270+
"example": "/// Iterate on a multi-file CAD model with a prompt.\n/// \n/// This endpoint can iterate on multi-file models.\n/// \n/// Even if you give specific ranges to edit, the model might change more than just those in order to make the changes you requested without breaking the code.\n/// \n/// You always get the whole code back, even if you only changed a small part of it. This endpoint will always return all the code back, including files that were not changed. If your original source code imported a stl/gltf/step/etc file, the output will not include that file since the model will never change non-kcl files. The endpoint will only return the kcl files that were changed.\n/// \n/// This operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.\nasync fn example_ml_create_text_to_cad_multi_file_iteration() -> anyhow::Result<()> {\n let client = kittycad::Client::new_from_env();\n let result: kittycad::types::TextToCadMultiFileIteration = client\n .ml()\n .create_text_to_cad_multi_file_iteration(\n vec![kittycad::types::multipart::Attachment {\n name: \"thing\".to_string(),\n filename: Some(\"myfile.json\".to_string()),\n content_type: Some(\"application/json\".to_string()),\n data: std::fs::read(\"myfile.json\").unwrap(),\n }],\n &kittycad::types::TextToCadMultiFileIterationBody {\n kcl_version: Some(\"some-string\".to_string()),\n project_name: Some(\"some-string\".to_string()),\n source_ranges: vec![kittycad::types::SourceRangePrompt {\n file: Some(\"some-string\".to_string()),\n prompt: \"some-string\".to_string(),\n range: kittycad::types::SourceRange {\n end: kittycad::types::SourcePosition {\n column: 4 as u32,\n line: 4 as u32,\n },\n start: kittycad::types::SourcePosition {\n column: 4 as u32,\n line: 4 as u32,\n },\n },\n }],\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n",
271271
"libDocsLink": "https://docs.rs/kittycad/latest/kittycad/ml/struct.Ml.html#method.create_text_to_cad_multi_file_iteration"
272272
}
273273
},

kittycad/src/ml.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ impl Ml {
276276
}
277277
}
278278

279-
#[doc = "Iterate on a CAD model with a prompt.\n\nThis endpoint can iterate on multi-file models.\n\nEven if you give specific ranges to edit, the model might change more than just those in order to make the changes you requested without breaking the code.\n\nYou always get the whole code back, even if you only changed a small part of it. This endpoint will always return all the code back, including files that were not changed. If your original source code imported a stl/gltf/step/etc file, the output will not include that file since the model will never change non-kcl files. The endpoint will only return the kcl files that were changed.\n\nThis operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.\n\n```rust,no_run\nasync fn example_ml_create_text_to_cad_multi_file_iteration() -> anyhow::Result<()> {\n let client = kittycad::Client::new_from_env();\n let result: kittycad::types::TextToCadMultiFileIteration = client\n .ml()\n .create_text_to_cad_multi_file_iteration(\n vec![kittycad::types::multipart::Attachment {\n name: \"thing\".to_string(),\n filename: Some(\"myfile.json\".to_string()),\n content_type: Some(\"application/json\".to_string()),\n data: std::fs::read(\"myfile.json\").unwrap(),\n }],\n &kittycad::types::TextToCadMultiFileIterationBody {\n kcl_version: Some(\"some-string\".to_string()),\n project_name: Some(\"some-string\".to_string()),\n source_ranges: vec![kittycad::types::SourceRangePrompt {\n file: Some(\"some-string\".to_string()),\n prompt: \"some-string\".to_string(),\n range: kittycad::types::SourceRange {\n end: kittycad::types::SourcePosition {\n column: 4 as u32,\n line: 4 as u32,\n },\n start: kittycad::types::SourcePosition {\n column: 4 as u32,\n line: 4 as u32,\n },\n },\n }],\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"]
279+
#[doc = "Iterate on a multi-file CAD model with a prompt.\n\nThis endpoint can iterate on multi-file models.\n\nEven if you give specific ranges to edit, the model might change more than just those in order to make the changes you requested without breaking the code.\n\nYou always get the whole code back, even if you only changed a small part of it. This endpoint will always return all the code back, including files that were not changed. If your original source code imported a stl/gltf/step/etc file, the output will not include that file since the model will never change non-kcl files. The endpoint will only return the kcl files that were changed.\n\nThis operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.\n\n```rust,no_run\nasync fn example_ml_create_text_to_cad_multi_file_iteration() -> anyhow::Result<()> {\n let client = kittycad::Client::new_from_env();\n let result: kittycad::types::TextToCadMultiFileIteration = client\n .ml()\n .create_text_to_cad_multi_file_iteration(\n vec![kittycad::types::multipart::Attachment {\n name: \"thing\".to_string(),\n filename: Some(\"myfile.json\".to_string()),\n content_type: Some(\"application/json\".to_string()),\n data: std::fs::read(\"myfile.json\").unwrap(),\n }],\n &kittycad::types::TextToCadMultiFileIterationBody {\n kcl_version: Some(\"some-string\".to_string()),\n project_name: Some(\"some-string\".to_string()),\n source_ranges: vec![kittycad::types::SourceRangePrompt {\n file: Some(\"some-string\".to_string()),\n prompt: \"some-string\".to_string(),\n range: kittycad::types::SourceRange {\n end: kittycad::types::SourcePosition {\n column: 4 as u32,\n line: 4 as u32,\n },\n start: kittycad::types::SourcePosition {\n column: 4 as u32,\n line: 4 as u32,\n },\n },\n }],\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"]
280280
#[tracing::instrument]
281281
pub async fn create_text_to_cad_multi_file_iteration<'a>(
282282
&'a self,

spec.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3849,7 +3849,7 @@
38493849
"ml",
38503850
"beta"
38513851
],
3852-
"summary": "Iterate on a CAD model with a prompt.",
3852+
"summary": "Iterate on a multi-file CAD model with a prompt.",
38533853
"description": "This endpoint can iterate on multi-file models.\n\nEven if you give specific ranges to edit, the model might change more than just those in order to make the changes you requested without breaking the code.\n\nYou always get the whole code back, even if you only changed a small part of it. This endpoint will always return all the code back, including files that were not changed. If your original source code imported a stl/gltf/step/etc file, the output will not include that file since the model will never change non-kcl files. The endpoint will only return the kcl files that were changed.\n\nThis operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.",
38543854
"operationId": "create_text_to_cad_multi_file_iteration",
38553855
"requestBody": {

0 commit comments

Comments
 (0)