added post guards to deck.llm
This commit is contained in:
+1
-3
@@ -131,9 +131,7 @@ class LLMChat:
|
||||
url = f"{self.provider.get('base_url').rstrip('/')}/chat/completions"
|
||||
|
||||
try:
|
||||
response = self.guarded_post(url, self.headers, payload)
|
||||
data = response.json()
|
||||
response.close() # Important for CircuitPython memory
|
||||
data = self.guarded_post(url, self.headers, payload)
|
||||
bot_content = data['choices'][0]['message']['content']
|
||||
self.messages.append({"role": "assistant", "content": bot_content})
|
||||
return (True, bot_content)
|
||||
|
||||
Reference in New Issue
Block a user