Skip to content

Commit bf6c28a

Browse files
committed
Integrate changes to the text-to-cad API
1 parent c91a51b commit bf6c28a

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

src/cmd_kcl.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ impl crate::cmd::Command for CmdKclExport {
125125
let session_data = ectx
126126
.run(&program, &mut state)
127127
.await
128-
.map_err(|err| kcl_error_fmt::KclError::new(code.to_string(), err))?;
128+
.map_err(|err| kcl_error_fmt::KclError::new(code.to_string(), err))?
129+
.1;
129130

130131
// Zoom on the object.
131132
ectx.engine

src/cmd_ml/cmd_kcl.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ impl crate::cmd::Command for CmdKclEdit {
6464
vec![kittycad::types::SourceRangePrompt {
6565
range: convert_to_source_range(source_range)?,
6666
prompt: prompt.clone(),
67+
file: None,
6768
}]
6869
} else {
6970
Default::default()
@@ -73,6 +74,8 @@ impl crate::cmd::Command for CmdKclEdit {
7374
original_source_code: input.to_string(),
7475
prompt: if source_ranges.is_empty() { Some(prompt) } else { None },
7576
source_ranges,
77+
project_name: None,
78+
kcl_version: Some(kcl_lib::version().to_owned()),
7679
};
7780

7881
let model = ctx.get_edit_for_prompt("", &body).await?;

src/context.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ impl Context<'_> {
201201
format.into(),
202202
&TextToCadCreateBody {
203203
prompt: prompt.to_string(),
204+
kcl_version: Some(kcl_lib::version().to_owned()),
205+
project_name: None,
204206
},
205207
)
206208
.await?;
@@ -234,6 +236,7 @@ impl Context<'_> {
234236
user_id,
235237
code,
236238
model,
239+
kcl_version,
237240
} = result
238241
{
239242
gen_model = TextToCad {
@@ -252,6 +255,7 @@ impl Context<'_> {
252255
user_id,
253256
code,
254257
model,
258+
kcl_version,
255259
};
256260
} else {
257261
anyhow::bail!("Unexpected response type: {:?}", result);

0 commit comments

Comments
 (0)