fix that the options could still be generated when theres no quetion
This commit is contained in:
parent
c3cfa144d3
commit
55128257cb
1 changed files with 5 additions and 0 deletions
|
@ -3,6 +3,11 @@ import { AiPrompts } from "$lib/config.js";
|
||||||
import toast from "svelte-5-french-toast";
|
import toast from "svelte-5-french-toast";
|
||||||
|
|
||||||
export function GenerateOptionsUsingAI(index) {
|
export function GenerateOptionsUsingAI(index) {
|
||||||
|
if (!questions.v[index].name) {
|
||||||
|
toast.error("Please enter a question to generate options.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
fetch("https://ai.hackclub.com/chat/completions", {
|
fetch("https://ai.hackclub.com/chat/completions", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue