소스 검색

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)
+}