mirror of
https://github.com/sudoxreboot/groqd
synced 2026-04-14 03:26:35 +00:00
Coerce context message limit to int
This commit is contained in:
parent
c0018e2241
commit
6a5e2a067a
1 changed files with 4 additions and 0 deletions
|
|
@ -350,6 +350,10 @@ class GroqdConversationEntity(
|
|||
|
||||
history = messages[1:]
|
||||
limit = options.get(CONF_CONTEXT_MESSAGES, DEFAULT_CONTEXT_MESSAGES)
|
||||
try:
|
||||
limit = int(limit)
|
||||
except (TypeError, ValueError):
|
||||
limit = DEFAULT_CONTEXT_MESSAGES
|
||||
if limit == 0:
|
||||
history = []
|
||||
elif limit > 0:
|
||||
|
|
|
|||
Loading…
Reference in a new issue