-
Notifications
You must be signed in to change notification settings - Fork 9
gemcraft prototype #120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gemcraft prototype #120
Conversation
bfollington
commented
Jul 24, 2024
- Configure CORS in planning server
- Create gemcraft leptos project
- Deserialize response to struct
| app.use( | ||
| oakCors({ | ||
| origin: "http://localhost:8080", | ||
| optionsSuccessStatus: 200, | ||
| methods: "POST, OPTIONS", | ||
| }) | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re-implemented using oak so that we can configure CORS.
rust/gemcraft-leptos/src/llm.rs
Outdated
| let body = serde_json::to_string(&body).unwrap(); | ||
| opts.body(Some(&JsValue::from_str(&body))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugly
rust/gemcraft-leptos/src/llm.rs
Outdated
| let resp_value = JsFuture::from(win.fetch_with_request(&request)) | ||
| .await | ||
| .expect("failed to fetch"); | ||
| let resp: Response = resp_value.dyn_into().unwrap(); | ||
|
|
||
| let json = JsFuture::from(resp.json().unwrap()) | ||
| .await | ||
| .expect("failed to get response text"); | ||
|
|
||
| let llm_response: LlmResponse = | ||
| serde_wasm_bindgen::from_value(json).map_err(|_| "Failed to deserialize JSON")?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Repeated
6640820 to
605cdb4
Compare
…, explode, and make variations of a gem, plus a "Run" button.
…but within the same table cell
…wn the provided JSON data into subcomponents.
…o generate variations of the provided data gem.
…uest with a reasonable starting point prompt.
…alls a callback `on_delete` passed as a prop.
…uctive buttons, updating delete button in gem editor.
…Gem` from the database.
…tem prompt and data gems
…ing in the full imagined app spec. The result should be stored similarly to imagined_apps as implemented_apps.
…andom gems and kicks off generating an app
|
Closing out stale PRs, please reopen if this is relevant |