Spaces:
Running
Running
import streamlit as st | |
# Page configuration | |
st.set_page_config( | |
page_title="Wren AI Cloud API Demo", | |
page_icon="π", | |
layout="wide", | |
) | |
st.title("π Wren AI Cloud API Demo") | |
if "api_key" not in st.session_state: | |
st.session_state.api_key = "" | |
if "project_id" not in st.session_state: | |
st.session_state.project_id = "" | |
with st.sidebar: | |
st.header("π§ Configuration", help="We won't store your API key and project ID, so you can safely enter them here.") | |
st.session_state.api_key = st.text_input( | |
"API Key", | |
type="password", | |
placeholder="sk-your-api-key-here", | |
help="Enter your Wren AI Cloud API key" | |
) | |
st.session_state.project_id = st.text_input( | |
"Project ID", | |
placeholder="1234", | |
help="Enter your Wren AI Cloud project ID" | |
) | |
st.markdown( | |
""" | |
**Prerequisites:** | |
In order to successfully run the demo, you need to: | |
1. Create a Wren AI Cloud account: https://cloud.getwren.ai/ | |
2. Create a project: https://docs.getwren.ai/cloud/getting_started/create_project | |
3. Connect to [your data source](https://docs.getwren.ai/cloud/guide/connect/overview) or [use our sample dataset](https://docs.getwren.ai/cloud/getting_started/sample_data/ecommerce) | |
4. Get your API key: https://docs.getwren.ai/cloud/guide/api-access/keys | |
5. Make sure you have enough API credits: https://docs.getwren.ai/cloud/guide/api-access/billing | |
6. Enter your API key and project ID in the sidebar. | |
**Resources:** | |
- Wren AI official website: https://getwren.ai/ | |
- API Documentation: https://wrenai.readme.io/reference/cloud-getting-started | |
- Demo Source Code: https://huggingface.co/spaces/getWrenAI/wrenai-cloud-api-demo/tree/main | |
""" | |
) | |