mirror of
https://github.com/ollama/ollama-js.git
synced 2025-12-11 23:30:41 -06:00
17 lines
366 B
TypeScript
17 lines
366 B
TypeScript
import ollama from 'ollama'
|
|
|
|
async function main() {
|
|
const imagePath = './examples/multimodal/cat.jpg'
|
|
const response = await ollama.generate({
|
|
model: 'llava',
|
|
prompt: 'describe this image:',
|
|
images: [imagePath],
|
|
stream: true,
|
|
})
|
|
for await (const part of response) {
|
|
process.stdout.write(part.response)
|
|
}
|
|
}
|
|
|
|
main().catch(console.error)
|