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
Copy file name to clipboardExpand all lines: docs/docs/dash/bi/genie_api.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ sidebar_position: 2
4
4
5
5
# Chat with a Genie Space
6
6
7
-
This app uses the [AI/BI Genie](https://www.databricks.com/product/ai-bi)[Conversations API](https://docs.databricks.com/api/workspace/genie) to let users ask questions about your data for instant insights.
7
+
This app uses the [AI/BI Genie](https://www.databricks.com/product/ai-bi)[Conversations API](https://docs.databricks.com/api/workspace/genie) to let users ask questions about your data for instant insights (answers and table-like output). Visualizations aren't yet supported in the API.
Copy file name to clipboardExpand all lines: docs/docs/streamlit/bi/genie_api.mdx
+12-1Lines changed: 12 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ sidebar_position: 1
4
4
5
5
# Chat with a Genie Space
6
6
7
-
This app uses the [AI/BI Genie](https://www.databricks.com/product/ai-bi)[Conversations API](https://docs.databricks.com/api/workspace/genie) to let users ask questions about your data for instant insights.
7
+
This app uses the [AI/BI Genie](https://www.databricks.com/product/ai-bi)[Conversations API](https://docs.databricks.com/api/workspace/genie) to let users ask questions about your data for instant insights (answers and table-like output). You are also able to collect their feedback on the responses. Visualizations aren't yet supported in the API.
8
8
9
9
## Code snippet
10
10
@@ -13,6 +13,7 @@ Refer to the Streamlit Cookbook Genie source code for the full implementation.
13
13
```python title="app.py"
14
14
import streamlit as st
15
15
from databricks.sdk import WorkspaceClient
16
+
from databricks.sdk.service.dashboards import GenieFeedbackRating
This sample uses Streamlit's [st.cache_resource](https://docs.streamlit.io/develop/concepts/architecture/caching#stcache_resource) with a 1-hour TTL (time-to-live) to cache the database connection across users, sessions, and reruns. The cached connection will automatically expire after 1 hour, ensuring connections don't become stale. Use Streamlit's caching decorators and TTL parameter to implement a caching strategy that works for your use case.
89
+
This sample uses Streamlit's [st.cache_resource](https://docs.streamlit.io/develop/concepts/architecture/caching#stcache_resource) with a 300-second TTL (time-to-live) to cache the database connection across users, sessions, and reruns. The cached connection will automatically expire after 1 hour, ensuring connections don't become stale. Use Streamlit's caching decorators and TTL parameter to implement a caching strategy that works for your use case.
Copy file name to clipboardExpand all lines: docs/docs/streamlit/tables/tables_read.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ from databricks.sdk.core import Config
17
17
cfg = Config() # Set the DATABRICKS_HOST environment variable when running locally
18
18
19
19
20
-
@st.cache_resource(ttl="1h") # connection is cached
20
+
@st.cache_resource(ttl=300, show_spinner=True) # connection is cached
21
21
defget_connection(http_path):
22
22
return sql.connect(
23
23
server_hostname=cfg.host,
@@ -47,7 +47,7 @@ if http_path_input and table_name:
47
47
48
48
:::info
49
49
50
-
This sample uses Streamlit's [st.cache_resource](https://docs.streamlit.io/develop/concepts/architecture/caching#stcache_resource) with a 1-hour TTL (time-to-live) to cache the database connection across users, sessions, and reruns. The cached connection will automatically expire after 1 hour, ensuring connections don't become stale. Use Streamlit's caching decorators and TTL parameter to implement a caching strategy that works for your use case.
50
+
This sample uses Streamlit's [st.cache_resource](https://docs.streamlit.io/develop/concepts/architecture/caching#stcache_resource) with a 300-second TTL (time-to-live) to cache the database connection across users, sessions, and reruns. The cached connection will automatically expire after 1 hour, ensuring connections don't become stale. Use Streamlit's caching decorators and TTL parameter to implement a caching strategy that works for your use case.
0 commit comments