Skip to content

Commit 45c38c0

Browse files
Michael IrvineMichael Irvine
authored andcommitted
adds some details
1 parent 22f1943 commit 45c38c0

File tree

2 files changed

+52
-3
lines changed

2 files changed

+52
-3
lines changed

docs/pages/product/apis-integrations/ai-api.mdx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,12 @@ One way of handling this is to pass the error message back into the AI API; it m
139139

140140
When using `"runQuery": true`, you might sometimes receive a query result containing `{ "error": "Continue wait" }`. If this happens, you should use `/load` ([described above](#2-load)) instead of `runQuery` to run the query, and handle retries as described in the [REST API documentation](/product/apis-integrations/rest-api#continue-wait).
141141

142-
## Advanced Features
142+
## Advanced Usage
143+
144+
<InfoBox>
145+
The advanced features discussed here are available on Cube version 1.1.7 and above.
146+
</InfoBox>
147+
143148
### Custom prompts
144149

145150
You can prompt the AI API with custom instructions. For example, you may want it to always
@@ -176,10 +181,10 @@ to give the AI context on possible values in a categorical dimension:
176181
177182
### Other LLM providers
178183
179-
<WarningBox>
184+
<InfoBox>
180185
These environment variables also apply to the [AI Assistant](/product/workspace/ai-assistant),
181186
if it is enabled on your deployment.
182-
</WarningBox>
187+
</InfoBox>
183188
184189
If desired, you may "bring your own" LLM model by providing a model and API credentials
185190
for a supported model provider. Do this by setting environment variables in your Cube

docs/pages/product/workspace/ai-assistant.mdx

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,49 @@ The query will automatically run in the sidebar and can be opened in the [Playgr
5858

5959
<Screenshot src="https://ucarecdn.com/4249ff1e-fae1-42c8-ad3a-b9e406ea2022/Screenshot20240624at34327PM.png" />
6060

61+
## Advanced Usage
62+
63+
<InfoBox>
64+
The advanced features discussed here are available on Cube version 1.1.7 and above.
65+
</InfoBox>
66+
67+
### Custom prompts
68+
69+
You can prompt the AI Assistant with custom instructions. For example, you may want it to always
70+
respond in a particular language, or to refer to itself by a name matching your brand.
71+
Custom prompts also allow you to give the model more context on your company and data model,
72+
for example if it should usually prefer a particular view.
73+
74+
To use a custom prompt, set the `CUBE_CLOUD_AI_ASSISTANT_PROMPT` environment variable in your deployment.
75+
76+
<InfoBox>
77+
Custom prompts add to, rather than overwrite, the AI Assistant's existing prompting.
78+
</InfoBox>
79+
80+
### Meta tags
81+
82+
The AI Assistant can read [meta tags](/reference/data-model/view#meta) on your dimensions, measures,
83+
segments, and views.
84+
85+
Use the `ai` meta tag to give context that is specific to AI and goes beyond what is
86+
included in the description. This can have any keys that you want. For example, you can use it
87+
to give the AI context on possible values in a categorical dimension:
88+
```yaml
89+
- name: status
90+
sql: status
91+
type: string
92+
meta:
93+
ai:
94+
values:
95+
- shipped
96+
- processing
97+
- completed
98+
```
99+
100+
### Other LLM providers
101+
102+
See the [AI API's documentation][ref-ai-api-providers] for information on how to "bring your own" LLM.
103+
61104
## FAQ and limitations
62105
63106
### 1. What language model(s) does the AI Assistant use?
@@ -83,3 +126,4 @@ The query will automatically run in the sidebar and can be opened in the [Playgr
83126
[ref-catalog]: /product/workspace/semantic-catalog
84127
[ref-playground]: /product/workspace/playground
85128
[ref-catalog-downstream]: /product/workspace/semantic-catalog#connecting-downstream-tools
129+
[ref-ai-api-providers]: /product/apis-integrations/ai-api#other-llm-providers

0 commit comments

Comments
 (0)