mirror of
https://github.com/smkrv/ha-text-ai.git
synced 2026-07-22 07:03:58 +08:00
YAML configuration explained
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
  [](https://opensource.org/licenses/MIT) [](https://github.com/hacs/integration)   
|
  [](https://opensource.org/licenses/MIT) [](https://github.com/hacs/integration)   
|
||||||
|
|
||||||
<img src="https://github.com/smkrv/ha-text-ai/blob/524849f6a945ec62c2cf6a6b7ecd9a28b37bf0fa/misc/icons/logo.jpg" alt="HA Text AI" width="98%"/>
|
<img src="https://github.com/smkrv/ha-text-ai/blob/524849f6a945ec62c2cf6a6b7ecd9a28b37bf0fa/misc/icons/logo.jpg" alt="HA Text AI" height="160"/>
|
||||||
|
|
||||||
### Advanced AI Integration for Home Assistant with LLM multi-provider support
|
### Advanced AI Integration for Home Assistant with LLM multi-provider support
|
||||||
</div>
|
</div>
|
||||||
@@ -143,20 +143,61 @@ To be compatible, a provider should support:
|
|||||||
4. Follow the configuration steps
|
4. Follow the configuration steps
|
||||||
|
|
||||||
### Via YAML
|
### Via YAML
|
||||||
|
|
||||||
|
### Platform Configuration (Global Settings)
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
ha_text_ai:
|
ha_text_ai:
|
||||||
api_provider: openai # or anthropic
|
api_provider: openai # Required
|
||||||
api_key: !secret ai_api_key
|
api_key: !secret ai_api_key # Required
|
||||||
model: gpt-4o-mini
|
model: gpt-4o-mini # Optional
|
||||||
temperature: 0.7
|
temperature: 0.7 # Optional
|
||||||
max_tokens: 1000
|
max_tokens: 1000 # Optional
|
||||||
request_interval: 1.0
|
request_interval: 1.0 # Optional
|
||||||
api_endpoint: https://api.openai.com/v1 # optional, for custom endpoints
|
api_endpoint: https://api.openai.com/v1 # Optional
|
||||||
system_prompt: |
|
system_prompt: | # Optional
|
||||||
You are a home automation expert assistant.
|
You are a home automation expert assistant.
|
||||||
Focus on practical and efficient solutions.
|
Focus on practical and efficient solutions.
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Sensor Configuration
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
sensor:
|
||||||
|
- platform: ha_text_ai
|
||||||
|
name: "My AI Assistant" # Required, unique identifier
|
||||||
|
api_provider: openai # Optional (inherits from platform)
|
||||||
|
model: "gpt-4o-mini" # Optional
|
||||||
|
temperature: 0.7 # Optional
|
||||||
|
max_tokens: 1000 # Optional
|
||||||
|
```
|
||||||
|
|
||||||
|
### 📋 Configuration Parameters
|
||||||
|
|
||||||
|
#### Platform Configuration
|
||||||
|
|
||||||
|
| Parameter | Type | Required | Default | Description |
|
||||||
|
|-----------|------|----------|---------|-------------|
|
||||||
|
| `api_provider` | String | ✅ | - | AI service provider (openai, anthropic) |
|
||||||
|
| `api_key` | String | ✅ | - | Authentication key for AI service |
|
||||||
|
| `model` | String | ❌ | Provider default | Specific AI model to use |
|
||||||
|
| `temperature` | Float | ❌ | 0.7 | Response creativity level (0.0-2.0) |
|
||||||
|
| `max_tokens` | Integer | ❌ | 1000 | Maximum response length |
|
||||||
|
| `request_interval` | Float | ❌ | 1.0 | Delay between API requests |
|
||||||
|
| `api_endpoint` | URL | ❌ | Provider default | Custom API endpoint |
|
||||||
|
| `system_prompt` | String | ❌ | - | Default context for AI interactions |
|
||||||
|
|
||||||
|
#### Sensor Configuration
|
||||||
|
|
||||||
|
| Parameter | Type | Required | Default | Description |
|
||||||
|
|-----------|------|----------|---------|-------------|
|
||||||
|
| `platform` | String | ✅ | - | Must be `ha_text_ai` |
|
||||||
|
| `name` | String | ✅ | - | Unique sensor identifier |
|
||||||
|
| `api_provider` | String | ❌ | Platform setting | Override global provider |
|
||||||
|
| `model` | String | ❌ | Platform setting | Override global model |
|
||||||
|
| `temperature` | Float | ❌ | Platform setting | Override global temperature |
|
||||||
|
| `max_tokens` | Integer | ❌ | Platform setting | Override global max tokens |
|
||||||
|
|
||||||
## 🛠️ Available Services
|
## 🛠️ Available Services
|
||||||
|
|
||||||
### ask_question
|
### ask_question
|
||||||
|
|||||||
Reference in New Issue
Block a user