bump kittycad.ts & pull thru project_name (#5359)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
@ -19,9 +19,14 @@ import { toSync } from './utils'
|
||||
|
||||
async function submitTextToCadPrompt(
|
||||
prompt: string,
|
||||
projectName: string,
|
||||
token?: string
|
||||
): Promise<Models['TextToCad_type'] | Error> {
|
||||
const body: Models['TextToCadCreateBody_type'] = { prompt }
|
||||
const body: Models['TextToCadCreateBody_type'] = {
|
||||
prompt,
|
||||
project_name:
|
||||
projectName !== '' && projectName !== 'browser' ? projectName : undefined,
|
||||
}
|
||||
// Glb has a smaller footprint than gltf, should we want to render it.
|
||||
const url = VITE_KC_API_BASE_URL + '/ai/text-to-cad/glb?kcl=true'
|
||||
const data: Models['TextToCad_type'] | Error = await crossPlatformFetch(
|
||||
@ -100,7 +105,11 @@ export async function submitAndAwaitTextToKcl({
|
||||
)
|
||||
}
|
||||
|
||||
const textToCadQueued = await submitTextToCadPrompt(trimmedPrompt, token)
|
||||
const textToCadQueued = await submitTextToCadPrompt(
|
||||
trimmedPrompt,
|
||||
context.project.name,
|
||||
token
|
||||
)
|
||||
.then((value) => {
|
||||
if (value instanceof Error) {
|
||||
return Promise.reject(value)
|
||||
|
Reference in New Issue
Block a user