feat: add generate cook & intro
This commit is contained in:
0
utils/api/ai.ts
Normal file
0
utils/api/ai.ts
Normal file
@@ -8,6 +8,16 @@ export async function generateRecipeImage(foods: string[]) {
|
||||
})
|
||||
}
|
||||
|
||||
export async function generateRecipeInfo(foods: string[]) {
|
||||
console.log(foods)
|
||||
return $fetch('/api/recipes/text/generate', {
|
||||
method: 'POST',
|
||||
body: {
|
||||
foods,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
export async function getRecipeImage(foods: string[]) {
|
||||
const data = await generateRecipeImage(foods)
|
||||
return `data:image/png;base64,${data.images[0]}`
|
||||
|
||||
Reference in New Issue
Block a user