backend preps

This commit is contained in:
Patrick_Pluto 2024-09-18 14:52:04 +02:00
parent 739e988e87
commit bdae0d5344
9 changed files with 147 additions and 67 deletions

View file

@ -1,12 +0,0 @@
import ollama from 'ollama'
async function name(model: string, prompt: string, system: string,) {
var message = [{ role: 'user', content: prompt }, { role: 'system', content: system }]
var response = await ollama.chat({ model: model, messages: message, stream: true })
for await (const part of response) {
process.stdout.write(part.message.content)
}
}