bump kittycad.ts & pull thru project_name (#5359)

Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2025-02-12 14:44:47 -08:00
committed by GitHub
parent 592c5259c6
commit b9862baed0
6 changed files with 41 additions and 7 deletions

View File

@ -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)