feat : better verbose message

This commit is contained in:
martin legrand
2025-03-30 11:51:41 +02:00
parent 8c431c690e
commit 7331cb7cb2
4 changed files with 43 additions and 25 deletions
+4 -3
View File
@@ -22,13 +22,14 @@ class OllamaLLM(GeneratorLLM):
stream = ollama.chat(
model=self.model,
messages=history,
stream=True,
stream=False,
)
for chunk in stream:
content = chunk['message']['content']
if '\n' in content:
self.logger.info(content)
if '.' in content:
self.logger.info(self.state.current_buffer)
self.state.last_complete_sentence = self.state.current_buffer
with self.state.lock:
self.state.current_buffer += content