Bruce MacDonald 1 vuosi sitten
vanhempi
commit
3ee93bd701
1 muutettua tiedostoa jossa 13 lisäystä ja 0 poistoa
  1. 13 0
      examples/chat/chat.ts

+ 13 - 0
examples/chat/chat.ts

@@ -0,0 +1,13 @@
+import { Ollama } from '../../src/index';
+import { Message } from '../../src/interfaces';
+
+async function main(): Promise<void> {
+    const client: Ollama = new Ollama();
+    const messages: Message[] = [
+        { role: "user", content: "Why is the sky blue?" },
+    ];
+    const response = await client.chat({model: "mistral", messages});
+    console.log(response.message.content);
+}
+
+await main();