You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -146,7 +146,8 @@ When using `"runQuery": true`, you might sometimes receive a query result contai
146
146
## Advanced Usage
147
147
148
148
<InfoBox>
149
-
The advanced features discussed here are available on Cube version 1.1.7 and above.
149
+
The advanced features discussed here are available on Cube version 1.1.7 and
150
+
above.
150
151
</InfoBox>
151
152
152
153
### Custom prompts
@@ -159,28 +160,30 @@ for example if it should usually prefer a particular view.
159
160
To use a custom prompt, set the `CUBE_CLOUD_AI_API_PROMPT` environment variable in your deployment.
160
161
161
162
<InfoBox>
162
-
Custom prompts add to, rather than overwrite, the AI API's existing prompting, so you
163
-
do not need to re-write instructions around how to generate the query itself.
163
+
Custom prompts add to, rather than overwrite, the AI API's existing prompting,
164
+
so you do not need to re-write instructions around how to generate the query
165
+
itself.
164
166
</InfoBox>
165
167
166
168
### Meta tags
167
169
168
-
The AI API can read [meta tags](/reference/data-model/view#meta) on your dimensions, measures,
170
+
The AI API can read [meta tags](/reference/data-model/view#meta) on your dimensions, measures,
169
171
segments, and views.
170
172
171
-
Use the `ai` meta tag to give context that is specific to AI and goes beyond what is
173
+
Use the `ai` meta tag to give context that is specific to AI and goes beyond what is
172
174
included in the description. This can have any keys that you want. For example, you can use it
173
175
to give the AI context on possible values in a categorical dimension:
176
+
174
177
```yaml
175
-
- name: status
176
-
sql: status
177
-
type: string
178
-
meta:
179
-
ai:
180
-
values:
181
-
- shipped
182
-
- processing
183
-
- completed
178
+
- name: status
179
+
sql: status
180
+
type: string
181
+
meta:
182
+
ai:
183
+
values:
184
+
- shipped
185
+
- processing
186
+
- completed
184
187
```
185
188
186
189
### Value search
@@ -201,20 +204,21 @@ The LLM will select dimensions from among those you have based on the question a
201
204
generate possible values dynamically.
202
205
203
206
<InfoBox>
204
-
When running value search queries, the AI API passes through the security context used
205
-
for the AI API request, so security is maintained and only dimensions the end user has
206
-
access to are able to be searched.
207
+
When running value search queries, the AI API passes through the security
208
+
context used for the AI API request, so security is maintained and only
209
+
dimensions the end user has access to are able to be searched.
207
210
</InfoBox>
208
211
209
212
To enable value search on a dimension, set the `searchable` field to true under the `ai`
210
213
meta tag, as shown below:
214
+
211
215
```yaml
212
-
- name: order_status
213
-
sql: order_status
214
-
type: string
215
-
meta:
216
-
ai:
217
-
searchable: true
216
+
- name: order_status
217
+
sql: order_status
218
+
type: string
219
+
meta:
220
+
ai:
221
+
searchable: true
218
222
```
219
223
220
224
Note that enabling Value Search may lead to slightly longer AI API response times when it
@@ -224,42 +228,132 @@ Search can only be used on string dimensions.
224
228
### Other LLM providers
225
229
226
230
<InfoBox>
227
-
These environment variables also apply to the [AI Assistant](/product/workspace/ai-assistant),
228
-
if it is enabled on your deployment.
231
+
These environment variables also apply to the [AI
232
+
Assistant](/product/workspace/ai-assistant), if it is enabled on your
233
+
deployment.
229
234
</InfoBox>
230
235
231
236
If desired, you may "bring your own" LLM model by providing a model and API credentials
232
237
for a supported model provider. Do this by setting environment variables in your Cube
233
-
deployment. See below for required variables by provider (required unless noted):
238
+
deployment.
239
+
240
+
- `CUBE_CLOUD_AI_COMPLETION_MODEL`- The AI model name to use (varies based on provider). For example `gpt-4o`.
241
+
- `CUBE_CLOUD_AI_COMPLETION_PROVIDER` - The provider. Must be one of the following:
242
+
- `amazon-bedrock`
243
+
- `anthropic`
244
+
- `azure`
245
+
- `cohere`
246
+
- `deepseek`
247
+
- `fireworks`
248
+
- `google-generative-ai`
249
+
- `google-vertex-ai`
250
+
- `google-vertex-ai-anthropic`
251
+
- `groq`
252
+
- `mistral`
253
+
- `openai`
254
+
- `openai-compatible`(any provider with an OpenAI-compatible API; support may vary)
255
+
- `together-ai`
256
+
- `x-ai`
257
+
258
+
See below for required variables by provider (required unless noted):
234
259
235
260
#### AWS Bedrock
236
261
237
262
<WarningBox>
238
-
The AI API currently supports only Anthropic Claude models on AWS Bedrock. Other
239
-
models may work but are not fully supported.
263
+
The AI API currently supports only Anthropic Claude models on AWS Bedrock.
264
+
Other models may work but are not fully supported.
240
265
</WarningBox>
241
266
242
-
- `CUBE_BEDROCK_MODEL_ID`- A supported [AWS Bedrock chat model](https://docs.aws.amazon.com/bedrock/latest/userguide/models-supported.html), for example `anthropic.claude-3-5-sonnet-20241022-v2:0`
243
-
- `CUBE_BEDROCK_ACCESS_KEY`- An access key for an IAM user with `InvokeModelWithResponseStream` permissions on the desired region/model.
244
-
- `CUBE_BEDROCK_ACCESS_SECRET`- The corresponding access secret
245
-
- `CUBE_BEDROCK_REGION_ID`- A supported AWS Bedrock region, for example `us-west-2`
267
+
- `CUBE_CLOUD_AI_AWS_ACCESS_KEY_ID`- An access key for an IAM user with `InvokeModelWithResponseStream` permissions on the desired region/model.
268
+
- `CUBE_CLOUD_AI_AWS_SECRET_ACCESS_KEY`- The corresponding access secret
269
+
- `CUBE_CLOUD_AI_AWS_REGION`- A supported AWS Bedrock region, for example `us-west-2`
270
+
- `CUBE_CLOUD_AI_AWS_SESSION_TOKEN`- The session token (optional)
271
+
272
+
#### Anthropic
273
+
274
+
- `CUBE_CLOUD_AI_ANTHROPIC_API_KEY`
275
+
- `CUBE_CLOUD_AI_ANTHROPIC_BASE_URL`- uses a different URL prefix for API calls, such as if you are using behind a proxy (optional)
276
+
277
+
#### Microsoft Azure OpenAI
278
+
279
+
- `CUBE_CLOUD_AI_AZURE_RESOURCE_NAME`
280
+
- `CUBE_CLOUD_AI_AZURE_API_KEY`
281
+
- `CUBE_CLOUD_AI_AZURE_API_VERSION`(optional)
282
+
- `CUBE_CLOUD_AI_AZURE_BASE_URL`(optional)
283
+
284
+
#### Cohere
285
+
286
+
- `CUBE_CLOUD_AI_COHERE_API_KEY`
287
+
- `CUBE_CLOUD_AI_COHERE_BASE_URL`- uses a different URL prefix for API calls, such as if you are using behind a proxy (optional)
288
+
289
+
#### DeepSeek
290
+
291
+
- `CUBE_CLOUD_AI_DEEPSEEK_API_KEY`
292
+
- `CUBE_CLOUD_AI_DEEPSEEK_BASE_URL`- uses a different URL prefix for API calls, such as if you are using behind a proxy (optional)
293
+
294
+
#### Fireworks
295
+
296
+
- `CUBE_CLOUD_AI_FIREWORKS_API_KEY`
297
+
- `CUBE_CLOUD_AI_FIREWORKS_BASE_URL`- uses a different URL prefix for API calls, such as if you are using behind a proxy (optional)
298
+
299
+
#### Google Generative AI
300
+
301
+
- `CUBE_CLOUD_AI_GOOGLE_GENERATIVE_AI_API_KEY`
302
+
- `CUBE_CLOUD_AI_GOOGLE_GENERATIVE_AI_BASE_URL`- uses a different URL prefix for API calls, such as if you are using behind a proxy (optional)
246
303
247
-
#### GCP Vertex
304
+
#### GCP Vertex AI
248
305
249
306
<WarningBox>
250
-
The AI API currently supports only Anthropic Claude models on GCP Vertex. Other
251
-
models may work but are not fully supported.
307
+
See <Btn>Google Vertex AI (Anthropic)</Btn> below if using Anthropic models
252
308
</WarningBox>
253
309
254
-
- `CUBE_VERTEX_MODEL_ID`- A supported GCP Vertex chat model, for example `claude-3-5-sonnet@20240620`
255
-
- `CUBE_VERTEX_PROJECT_ID`- The GCP project the model is deployed in
256
-
- `CUBE_VERTEX_REGION`- The GCP region the model is deployed in, for example `us-east5`
257
-
- `CUBE_VERTEX_CREDENTIALS`- The private key for a service account with permissions to run the chosen model
310
+
- `CUBE_CLOUD_AI_GOOGLE_VERTEX_PROJECT`
311
+
- `CUBE_CLOUD_AI_GOOGLE_VERTEX_LOCATION`
312
+
- `CUBE_CLOUD_AI_GOOGLE_VERTEX_CREDENTIALS`
313
+
- `CUBE_CLOUD_AI_GOOGLE_VERTEX_PUBLISHER`- defaults to `google`; change if using another publisher (optional)
0 commit comments