community[patch]: fix ollama astream (#16070)

Update ollama.py
pull/16062/head
Fei Wang 5 months ago committed by GitHub
parent bc0cb1148a
commit d0e101e4e0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -468,7 +468,7 @@ class Ollama(BaseLLM, _OllamaCommon):
run_manager: Optional[AsyncCallbackManagerForLLMRun] = None,
**kwargs: Any,
) -> AsyncIterator[GenerationChunk]:
async for stream_resp in self._acreate_stream(prompt, stop, **kwargs):
async for stream_resp in self._acreate_generate_stream(prompt, stop, **kwargs):
if stream_resp:
chunk = _stream_response_to_generation_chunk(stream_resp)
yield chunk

Loading…
Cancel
Save