split
This commit is contained in:
parent
6204f01912
commit
84ae1cecf5
|
|
@ -71,7 +71,7 @@ app.get("/analyze", async (c) => {
|
|||
app.get("/analyze.html", async (c) => {
|
||||
try {
|
||||
const result = await analyze()
|
||||
return c.html(`<h2>corkboard</h2><ul>${result.split("\n").filter(line => line.trim()).map(line => `<li>${line}</li>`).join("")}</ul>`)
|
||||
return c.html(`<h2>corkboard</h2><ul>${result.map(line => `<li>${line}</li>`).join("")}</ul>`)
|
||||
} catch (err: any) {
|
||||
return c.json({ error: err.message }, 500)
|
||||
}
|
||||
|
|
@ -133,7 +133,7 @@ app.post("/transcribe", async (c) => {
|
|||
}
|
||||
})
|
||||
|
||||
async function analyze(): Promise<string> {
|
||||
async function analyze(): Promise<string[]> {
|
||||
await runImagesnap()
|
||||
|
||||
const fileId = await createFile(IMAGE_PATH)
|
||||
|
|
@ -151,7 +151,7 @@ async function analyze(): Promise<string> {
|
|||
]
|
||||
})
|
||||
|
||||
return result.output_text
|
||||
return result.output_text.split("\n").map(line => line.trim()).filter(line => line)
|
||||
}
|
||||
|
||||
// Capture image using Bun.spawn
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user