Updated stream

This commit is contained in:
Andrea Bianchi
2026-06-01 11:25:06 +09:00
parent fdc3c0efc0
commit eb90d6d787
2 changed files with 54 additions and 11 deletions

View File

@@ -1,3 +1,17 @@
import delay from 'delay';
fetch('http://...', {});
fetch('http://127.0.0.1:11434/api/generate', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
model: 'deepseek-r1:latest', // replace with your model name
system: 'You are a helpful assistant.',
prompt: 'Tell me a joke!',
stream: false,
think: false,
}),
})
.then((res) => res.json())
.then((data) => data.response)
.then(console.log)
.catch(console.error);