-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add dependabot Signed-off-by: Jess Frazelle <[email protected]> * add stuffs Signed-off-by: Jess Frazelle <[email protected]> * updates Signed-off-by: Jess Frazelle <[email protected]> * add sentry Signed-off-by: Jess Frazelle <[email protected]> * Revert "add sentry" This reverts commit 7ccb5dc. * updates Signed-off-by: Jess Frazelle <[email protected]> * updates Signed-off-by: Jess Frazelle <[email protected]> --------- Signed-off-by: Jess Frazelle <[email protected]>
- Loading branch information
Showing
9 changed files
with
255 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: 'npm' # See documentation for possible values | ||
directory: '/' # Location of package manifests | ||
schedule: | ||
interval: 'daily' | ||
- package-ecosystem: 'github-actions' # See documentation for possible values | ||
directory: '/' # Location of package manifests | ||
schedule: | ||
interval: 'daily' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
types-lint-build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/[email protected] | ||
with: | ||
node-version: '18' | ||
cache: 'yarn' | ||
|
||
- run: yarn install | ||
|
||
- run: yarn check | ||
|
||
- run: yarn lint | ||
|
||
- run: yarn build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,23 @@ | ||
export type CADFormat = 'fbx' | 'glb' | 'gltf' | 'obj' | 'ply' | 'step' | 'stl' | ||
import { Models } from '@kittycad/lib' | ||
|
||
export type CADFormat = Models['FileExportFormat_type'] | ||
|
||
interface ListParams { | ||
limit?: number, | ||
page_token?: string, | ||
sort_by?: 'created_at_ascending' | 'created_at_descending', | ||
limit?: number | ||
page_token?: string | ||
sort_by?: Models['CreatedAtSortMode_type'] | ||
} | ||
|
||
export const endpoints = { | ||
prompt: (output_format: CADFormat = 'step') => `${import.meta.env.VITE_API_BASE_URL}/ai/text-to-cad/${output_format}`, | ||
list: ({ limit, page_token, sort_by = 'created_at_descending' }: ListParams) => | ||
`${import.meta.env.VITE_API_BASE_URL}/user/text-to-cad?limit=${limit}${page_token ? `&page_token=${page_token}` : ''}&sort_by=${sort_by}`, | ||
prompt: (output_format: CADFormat = 'step') => | ||
`${import.meta.env.VITE_API_BASE_URL}/ai/text-to-cad/${output_format}`, | ||
list: ({ limit, page_token, sort_by = 'created_at_descending' }: ListParams) => | ||
`${import.meta.env.VITE_API_BASE_URL}/user/text-to-cad?limit=${limit}${ | ||
page_token ? `&page_token=${page_token}` : '' | ||
}&sort_by=${sort_by}`, | ||
feedback: (id: string) => `${import.meta.env.VITE_API_BASE_URL}/user/text-to-cad/${id}` | ||
} | ||
|
||
export type PromptResponse = { | ||
completed_at: string, | ||
created_at?: string, | ||
error?: string, | ||
feedback?: "thumbs_up" | 'thumbs_down', | ||
id?: string, | ||
model_version?: string, | ||
output_format?: CADFormat, | ||
outputs?: Record<CADFormat, string>, | ||
prompt?: string, | ||
started_at?: string, | ||
status?: 'queued' | 'uploaded' | 'in_progress' | 'completed' | 'failed', | ||
updated_at?: string, | ||
user_id?: string | ||
} | ||
export type PromptResponse = Models['TextToCad_type'] | ||
|
||
export type ListResponse = { | ||
items: PromptResponse[], | ||
next_page?: string, | ||
} | ||
export type ListResponse = Models['TextToCadResultsPage_type'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,55 @@ | ||
<script lang="ts"> | ||
import type { PageData } from './$types.js' | ||
export let data: PageData | ||
export let form | ||
export let data: PageData | ||
export let form | ||
</script> | ||
|
||
<section class="mx-auto max-w-3xl"> | ||
<h1 class="text-4xl mb-2"> | ||
Text to <span class="text-stroke text-stroke-chalkboard-100 dark:text-stroke-chalkboard-20">CAD</span> | ||
</h1> | ||
<form method="POST" class="flex w-full"> | ||
<label class="flex-1"> | ||
<span class="sr-only">Enter a text-to-CAD prompt:</span> | ||
<input | ||
autocapitalize="false" | ||
name="prompt" | ||
placeholder="Enter a text-to-CAD prompt:" | ||
required | ||
spellcheck="false" | ||
type="text" | ||
class="w-full px-4 py-1 border" | ||
/> | ||
</label> | ||
<button type="submit" class="submit">Submit</button> | ||
</form> | ||
<h1 class="text-4xl mb-2"> | ||
Text to <span class="text-stroke text-stroke-chalkboard-100 dark:text-stroke-chalkboard-20" | ||
>CAD</span | ||
> | ||
</h1> | ||
<form method="POST" class="flex w-full"> | ||
<label class="flex-1"> | ||
<span class="sr-only">Enter a text-to-CAD prompt:</span> | ||
<input | ||
autocapitalize="false" | ||
name="prompt" | ||
placeholder="Enter a text-to-CAD prompt:" | ||
required | ||
spellcheck="false" | ||
type="text" | ||
class="w-full px-4 py-1 border" | ||
/> | ||
</label> | ||
<button type="submit" class="submit">Submit</button> | ||
</form> | ||
</section> | ||
|
||
{#if form} | ||
<p>Submission response:</p> | ||
<p>Submission response:</p> | ||
{/if} | ||
|
||
{#if data.body?.items?.length} | ||
<section class="my-24"> | ||
<h2>Your generations</h2> | ||
{#each data.body.items as item} | ||
<pre class="border p-4 my-12 first-of-type:mt-0 overflow-auto">{JSON.stringify(item, null, 2)}</pre> | ||
{/each} | ||
</section> | ||
<section class="my-24"> | ||
<h2>Your generations</h2> | ||
{#each data.body.items as item} | ||
<pre class="border p-4 my-12 first-of-type:mt-0 overflow-auto">{JSON.stringify( | ||
item, | ||
null, | ||
2 | ||
)}</pre> | ||
{/each} | ||
</section> | ||
{/if} | ||
|
||
<style lang="postcss"> | ||
.submit { | ||
@apply px-4 py-1 border border-l-0; | ||
@apply border-chalkboard-100 dark:border-chalkboard-20; | ||
@apply bg-energy-10 text-energy-100; | ||
@apply dark:bg-energy-90 dark:text-energy-10 | ||
} | ||
</style> | ||
.submit { | ||
@apply px-4 py-1 border border-l-0; | ||
@apply border-chalkboard-100 dark:border-chalkboard-20; | ||
@apply bg-energy-10 text-energy-100; | ||
@apply dark:bg-energy-90 dark:text-energy-10; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<h1>The prompt should load here!</h1> | ||
<h1>The prompt should load here!</h1> |
Oops, something went wrong.