Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -139,6 +139,57 @@ pipeline.connect("prompt_builder", "llm")
|
|
| 139 |
|
| 140 |
# Initialize Streamlit app
|
| 141 |
st.title("Code Assistant Chat")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 142 |
|
| 143 |
tabs = ["Data Fetching","Assistant"]
|
| 144 |
selected_tab = st.sidebar.radio("Select a Tab", tabs)
|
|
|
|
| 139 |
|
| 140 |
# Initialize Streamlit app
|
| 141 |
st.title("Code Assistant Chat")
|
| 142 |
+
st.subheader("Frequently Asked Questions")
|
| 143 |
+
|
| 144 |
+
st.markdown("""
|
| 145 |
+
<style>
|
| 146 |
+
.streamlit-expanderHeader {
|
| 147 |
+
background-color: #f0f2f6;
|
| 148 |
+
border: 1px solid #ddd;
|
| 149 |
+
border-radius: 5px;
|
| 150 |
+
padding: 10px;
|
| 151 |
+
}
|
| 152 |
+
.streamlit-expanderContent {
|
| 153 |
+
background-color: #ffffff;
|
| 154 |
+
border: 1px solid #ddd;
|
| 155 |
+
border-radius: 5px;
|
| 156 |
+
padding: 10px;
|
| 157 |
+
}
|
| 158 |
+
</style>
|
| 159 |
+
""", unsafe_allow_html=True)
|
| 160 |
+
|
| 161 |
+
with st.expander("How can I use this space?"):
|
| 162 |
+
st.markdown("""
|
| 163 |
+
This space is created based on steps described in [this Medium article](https://medium.com/towards-data-science/using-llama-3-for-building-ai-agents-7e74f79d1ccc). To use this space:
|
| 164 |
+
|
| 165 |
+
1. Create a Redis Cloud account and set up a database
|
| 166 |
+
2. Add your Redis credentials to this space
|
| 167 |
+
3. Enter your preferred GitHub repository clone URL for data fetching and indexing
|
| 168 |
+
|
| 169 |
+
""")
|
| 170 |
+
|
| 171 |
+
with st.expander("Do I need a Gemini API key?"):
|
| 172 |
+
st.markdown("""
|
| 173 |
+
No, you don't need to provide a Gemini API key for testing this repository.
|
| 174 |
+
|
| 175 |
+
- This repo includes a Gemini free tier API key itself.
|
| 176 |
+
- However, if you encounter any resource exhaustion error:
|
| 177 |
+
- Consider cloning this space
|
| 178 |
+
- Add your own key as the `GEMINI_API_KEY` secret
|
| 179 |
+
|
| 180 |
+
""")
|
| 181 |
+
|
| 182 |
+
with st.expander("I don't want to create a Redis database. Can I still check the output?"):
|
| 183 |
+
st.markdown("""
|
| 184 |
+
Absolutely! Here's what you can do:
|
| 185 |
+
|
| 186 |
+
1. Send me a message on LinkedIn mentioning your requirement
|
| 187 |
+
2. I'll provide you with preconfigured database credentials
|
| 188 |
+
3. Enter these credentials in the appropriate fields
|
| 189 |
+
4. You'll then be able to use the assistant as you wish
|
| 190 |
+
|
| 191 |
+
> **Important**: Please use the provided credentials responsibly and for testing purposes only.
|
| 192 |
+
""")
|
| 193 |
|
| 194 |
tabs = ["Data Fetching","Assistant"]
|
| 195 |
selected_tab = st.sidebar.radio("Select a Tab", tabs)
|