update workflow

This commit is contained in:
Sanju Sivalingam
2026-02-16 21:14:16 +05:30
parent 4848587f0c
commit 2312f8bece
2 changed files with 35 additions and 2 deletions

33
test-ollama.ts Normal file
View File

@@ -0,0 +1,33 @@
import OpenAI from "openai";
import { readFileSync } from "fs";
const client = new OpenAI({
baseURL: "http://localhost:11434/v1",
apiKey: "ollama",
});
const imagePath = "/Users/sanju/Downloads/komoot iOS 33.png";
const base64 = readFileSync(imagePath).toString("base64");
console.log("sending image to ollama (gemma3:4b)...\n");
const response = await client.chat.completions.create({
model: "gemma3:4b",
messages: [
{
role: "user",
content: [
{ type: "text", text: "Describe what you see in this screenshot. What app is this? What are the key UI elements?" },
{
type: "image_url",
image_url: { url: `data:image/png;base64,${base64}` },
},
],
},
],
});
console.log("model:", response.model);
console.log("tokens:", response.usage);
console.log("\n--- response ---\n");
console.log(response.choices[0].message.content);