-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
27 lines (18 loc) · 895 Bytes
/
index.js
File metadata and controls
27 lines (18 loc) · 895 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { generateCompletion, chatWithJSON, listModels, showModelInfo } from "./core.js";
import { streamChat } from "./streaming.js";
const MODEL_NAME = "llama3.1:8b-instruct-q4_K_M";
async function main() {
console.log("🚀 Running Ollama Wrapper Test");
const models = await listModels();
console.log("✅ Available Models:", models);
const modelInfo = await showModelInfo(MODEL_NAME);
console.log("✅ Model Info:", modelInfo);
const completion = await generateCompletion("Tell me a fun fact.");
console.log("💡 Fun Fact:", completion);
const chatResponse = await chatWithJSON([{ role: "user", content: "What day is it?" }]);
console.log("🗨️ Chat Response:", chatResponse);
console.log("📡 Streaming Chat:");
await streamChat([{ role: "user", content: "Tell me a joke." }]);
console.log("✅ All Tests Complete!");
}
main();