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

Update ollama.py
This commit is contained in:
Fei Wang 2024-01-18 01:42:41 +08:00 committed by GitHub
parent bc0cb1148a
commit d0e101e4e0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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