Merge pull request #154 from ollama/done-reason

add done reason to generate type responses
This commit is contained in:
Michael Yang
2024-05-10 14:22:03 -07:00
committed by GitHub
+3
View File
@@ -19,6 +19,9 @@ class BaseGenerateResponse(TypedDict):
done: bool done: bool
'True if response is complete, otherwise False. Useful for streaming to detect the final response.' 'True if response is complete, otherwise False. Useful for streaming to detect the final response.'
done_reason: str
'Reason for completion. Only present when done is True.'
total_duration: int total_duration: int
'Total duration in nanoseconds.' 'Total duration in nanoseconds.'