瀏覽代碼

examples: update create example for new api

Bruce MacDonald 6 月之前
父節點
當前提交
0800da5331
共有 1 個文件被更改,包括 11 次插入0 次删除
  1. 11 0
      examples/create/create.ts

+ 11 - 0
examples/create/create.ts

@@ -0,0 +1,11 @@
+import ollama from 'ollama'
+
+const stream = await ollama.create({
+    model: 'my-model',
+    from: 'smollm2',
+    system: 'You are a helpful assistant.',
+    stream: true,
+  })
+for await (const part of stream) {
+  console.log(part)
+}