mirror of
https://github.com/smkrv/ha-text-ai.git
synced 2026-07-22 07:03:58 +08:00
Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3d064f5b9d | ||
|
|
ae8f8bda03 | ||
|
|
2dbae19c41 |
@@ -3,7 +3,7 @@ name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: bug
|
||||
assignees: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: enhancement
|
||||
assignees: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -37,3 +37,4 @@ wheels/
|
||||
Thumbs.db
|
||||
*.psd
|
||||
*.zip
|
||||
*.txt
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ We welcome contributions to the HA Text AI project! This document will help you
|
||||
git remote add upstream https://github.com/smkrv/ha-text-ai.git
|
||||
```
|
||||
|
||||
### 2. Creating a Development Branch
|
||||
### 2. Creating a Development Branch
|
||||
|
||||
```bash
|
||||
# Update the main branch
|
||||
|
||||
@@ -106,6 +106,11 @@ class APIClient:
|
||||
return await self._create_openai_completion(
|
||||
model, messages, temperature, max_tokens
|
||||
)
|
||||
except (KeyError, IndexError) as e:
|
||||
if "'choices'" in str(e) or "'message'" in str(e):
|
||||
raise HomeAssistantError("Failed to get a response from the AI model. Please check your internet connection and try again later.")
|
||||
else:
|
||||
raise
|
||||
except Exception as e:
|
||||
_LOGGER.error("API request failed: %s", str(e))
|
||||
raise HomeAssistantError(f"API request failed: {str(e)}")
|
||||
|
||||
@@ -23,6 +23,6 @@
|
||||
"single_config_entry": false,
|
||||
"ssdp": [],
|
||||
"usb": [],
|
||||
"version": "2.0.2-alpha",
|
||||
"version": "2.0.3-beta",
|
||||
"zeroconf": []
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user