- "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",
0 commit comments