Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,7 +2,7 @@ import streamlit as st
|
|
| 2 |
import requests
|
| 3 |
|
| 4 |
# Replace with your DeepSeek API key and endpoint
|
| 5 |
-
DEEPSEEK_API_KEY = "
|
| 6 |
DEEPSEEK_ENDPOINT = "https://api.deepseek.com/v1/chat"
|
| 7 |
|
| 8 |
# Define the bot's persona
|
|
@@ -49,12 +49,12 @@ def main():
|
|
| 49 |
st.session_state.history = []
|
| 50 |
|
| 51 |
# Display conversation history
|
| 52 |
-
for user_input, bot_response in st.session_state.history:
|
| 53 |
-
st.text_area("You", value=user_input, height=68, disabled=True)
|
| 54 |
-
st.text_area("Nietzsche", value=bot_response, height=150, disabled=True)
|
| 55 |
|
| 56 |
# User input
|
| 57 |
-
user_input = st.text_input("Your Question", placeholder="Ask Nietzsche...")
|
| 58 |
|
| 59 |
# Submit button
|
| 60 |
if st.button("Submit"):
|
|
|
|
| 2 |
import requests
|
| 3 |
|
| 4 |
# Replace with your DeepSeek API key and endpoint
|
| 5 |
+
DEEPSEEK_API_KEY = "your_deepseek_api_key"
|
| 6 |
DEEPSEEK_ENDPOINT = "https://api.deepseek.com/v1/chat"
|
| 7 |
|
| 8 |
# Define the bot's persona
|
|
|
|
| 49 |
st.session_state.history = []
|
| 50 |
|
| 51 |
# Display conversation history
|
| 52 |
+
for i, (user_input, bot_response) in enumerate(st.session_state.history):
|
| 53 |
+
st.text_area("You", value=user_input, height=68, disabled=True, key=f"user_input_{i}")
|
| 54 |
+
st.text_area("Nietzsche", value=bot_response, height=150, disabled=True, key=f"bot_response_{i}")
|
| 55 |
|
| 56 |
# User input
|
| 57 |
+
user_input = st.text_input("Your Question", placeholder="Ask Nietzsche...", key="user_input")
|
| 58 |
|
| 59 |
# Submit button
|
| 60 |
if st.button("Submit"):
|