|
1 | 1 | --- |
2 | 2 | title: Configuration |
| 3 | +description: Configure Ava to your liking |
3 | 4 | --- |
4 | 5 |
|
5 | | -TODO |
| 6 | +You can configure skills and models in Ava Server by setting their respective environment variables. The following is a list of all available environment variables and their default values. |
| 7 | + |
| 8 | +The configuration consists of three environment variables: `LLM`, `EMBEDDINGS`, and `SKILLS`. |
| 9 | + |
| 10 | +## Schema |
| 11 | + |
| 12 | +::field{name="LLM" type="JSON String" required} |
| 13 | + ::collapsible |
| 14 | + The `LLM` environment variable is used to set the language model that Ava will use. Examples for different providers: |
| 15 | + |
| 16 | + ::tabs |
| 17 | + ::div |
| 18 | + --- |
| 19 | + label: Anthropic |
| 20 | + icon: i-simple-icons-anthropic |
| 21 | + --- |
| 22 | + |
| 23 | + ```json |
| 24 | + { |
| 25 | + "namespace": "anthropic", |
| 26 | + "name": "claude-3-opus-20240229", |
| 27 | + "token": "YOUR_API_TOKEN" |
| 28 | + } |
| 29 | + ``` |
| 30 | + :: |
| 31 | + |
| 32 | + ::div |
| 33 | + --- |
| 34 | + label: OpenAI |
| 35 | + icon: i-simple-icons-openai |
| 36 | + --- |
| 37 | + |
| 38 | + ```json |
| 39 | + { |
| 40 | + "namespace": "openai", |
| 41 | + "name": "gpt-3.5-turbo", |
| 42 | + "token": "YOUR_API_TOKEN" |
| 43 | + } |
| 44 | + ``` |
| 45 | + :: |
| 46 | + |
| 47 | + ::div |
| 48 | + --- |
| 49 | + label: Ollama |
| 50 | + icon: i-ava-ollama-logo |
| 51 | + --- |
| 52 | + |
| 53 | + ```json |
| 54 | + { |
| 55 | + "namespace": "anthropic", |
| 56 | + "name": "claude-3-opus-20240229" |
| 57 | + } |
| 58 | + ``` |
| 59 | + :: |
| 60 | + :: |
| 61 | +:: |
| 62 | + |
| 63 | +::field{name="EMBEDDINGS" type="JSON String" required} |
| 64 | + ::collapsible |
| 65 | + The `EMBEDDINGS` environment variable is used to set the text embeddings model that Ava will use. Examples for different providers: |
| 66 | + |
| 67 | + ::tabs |
| 68 | + ::div |
| 69 | + --- |
| 70 | + label: OpenAI |
| 71 | + icon: i-simple-icons-openai |
| 72 | + --- |
| 73 | + |
| 74 | + ```json |
| 75 | + { |
| 76 | + "namespace": "openai", |
| 77 | + "name": "text-embedding-3-small", |
| 78 | + "token": "YOUR_API_TOKEN" |
| 79 | + } |
| 80 | + ``` |
| 81 | + :: |
| 82 | + |
| 83 | + ::div |
| 84 | + --- |
| 85 | + label: Ollama |
| 86 | + icon: i-ava-ollama-logo |
| 87 | + --- |
| 88 | + |
| 89 | + ```json |
| 90 | + { |
| 91 | + "namespace": "anthropic", |
| 92 | + "name": "arctic-snowflake-embed:22m", |
| 93 | + // You can also specify base url if not localhost |
| 94 | + "baseURL": "http://04c4e5a1-ollama:11434" |
| 95 | + } |
| 96 | + ``` |
| 97 | + :: |
| 98 | + :: |
| 99 | +:: |
| 100 | + |
| 101 | +::field{name="SKILLS" type="JSON String"} |
| 102 | + ::collapsible |
| 103 | + The `SKILLS` environment variable is used to set the HTTP skills that Ava will use. Here are both configuration example and simple skill implementation: |
| 104 | + |
| 105 | + ::tabs |
| 106 | + ::div |
| 107 | + --- |
| 108 | + label: Configuration |
| 109 | + --- |
| 110 | + |
| 111 | + ```json |
| 112 | + [ |
| 113 | + { |
| 114 | + "name": "Calculator", |
| 115 | + // You can describe the skill here, |
| 116 | + // maybe add some examples or instructions for the model to consider |
| 117 | + "description": "Performs mathematical calculations, input example: 2 + 2", |
| 118 | + "url": "http://localhost:3000/skills/calculator", |
| 119 | + "returnDirect": true |
| 120 | + }, |
| 121 | + { |
| 122 | + "name": "Wikipedia", |
| 123 | + "description": "Searches Wikipedia for information", |
| 124 | + "url": "http://localhost:3000/skills/wikipedia", |
| 125 | + "returnDirect": false |
| 126 | + } |
| 127 | + ] |
| 128 | + ``` |
| 129 | + :: |
| 130 | + |
| 131 | + ::div |
| 132 | + --- |
| 133 | + label: Node.js Example |
| 134 | + icon: i-simple-icons-javascript |
| 135 | + --- |
| 136 | + |
| 137 | + ```javascript |
| 138 | + const { createServer } = require('http'); |
| 139 | + |
| 140 | + createServer((req, res) => { |
| 141 | + if (req.url === '/skills/calculator') { |
| 142 | + // read body and perform calculation |
| 143 | + // result will be returned directly to the user |
| 144 | + res.end('2 + 2 = 4'); |
| 145 | + } else if (req.url === '/skills/wikipedia') { |
| 146 | + // read body and perform search |
| 147 | + res.end('result here will be returned to Ava to be processed further'); |
| 148 | + } else { |
| 149 | + res.end('Skill not found'); |
| 150 | + } |
| 151 | + }).listen(3000); |
| 152 | + ``` |
| 153 | + :: |
| 154 | + :: |
| 155 | +:: |
| 156 | + |
| 157 | +::field{name="HOMEASSISTANT" type="JSON String"} |
| 158 | + ::collapsible |
| 159 | + The `HOMEASSISTANT` environment variable is used to set the Home Assistant instance that Ava will use. Examples for different providers: |
| 160 | + |
| 161 | + ::tabs |
| 162 | + ::div |
| 163 | + --- |
| 164 | + label: Configuration |
| 165 | + --- |
| 166 | + |
| 167 | + ```json |
| 168 | + { |
| 169 | + "url": "http://homeassistant.local:8123", |
| 170 | + "token": "Your long lived access token", |
| 171 | + "disabledEntitiesPrefixes": ["update", "device_tracker"], |
| 172 | + // supervisor option used only inside the addon |
| 173 | + // by default addon will configure HOMEASSISTANT env |
| 174 | + "supervisor": false |
| 175 | + } |
| 176 | + ``` |
| 177 | + :: |
| 178 | + |
| 179 | + ::div |
| 180 | + --- |
| 181 | + label: Node.js Example |
| 182 | + icon: i-simple-icons-javascript |
| 183 | + --- |
| 184 | + |
| 185 | + ```javascript |
| 186 | + const { createServer } = require('http'); |
| 187 | + |
| 188 | + createServer((req, res) => { |
| 189 | + if (req.url === '/skills/calculator') { |
| 190 | + // read body and perform calculation |
| 191 | + // result will be returned directly to the user |
| 192 | + res.end('2 + 2 = 4'); |
| 193 | + } else if (req.url === '/skills/wikipedia') { |
| 194 | + // read body and perform search |
| 195 | + res.end('result here will be returned to Ava to be processed further'); |
| 196 | + } else { |
| 197 | + res.end('Skill not found'); |
| 198 | + } |
| 199 | + }).listen(3000); |
| 200 | + ``` |
| 201 | + :: |
| 202 | + :: |
| 203 | +:: |
| 204 | + |
0 commit comments