ollama / ollama-js

Ollama JavaScript library
https://ollama.com
MIT License
2.07k stars 154 forks source link

AbortableAsyncIterator have proprieties undefined when doing stream.abort() #148

Open ZaMeR12 opened 1 day ago

ZaMeR12 commented 1 day ago

In brief, i want to stop the request the user just made while ollama is responding to them. The problem is that i followed the example given by this lib but my console tell that the property abort is undefined. And my code editor them something similar. So i guess i have to create a new variable from the constructor of AbortableAsyncIterator when i declare the stream variable, but i don't know how to do that. Can someone help me? I use typescript and React.

There is a screenshot that the web console show me when i try to stream.abort() like the example show:

image

hopperelec commented 20 hours ago

Could you show your code?