Update app.py
Browse files
app.py
CHANGED
|
@@ -19,7 +19,7 @@ generation_config = {
|
|
| 19 |
model = genai.GenerativeModel(
|
| 20 |
model_name="gemini-1.5-pro",
|
| 21 |
generation_config=generation_config,
|
| 22 |
-
system_instruction="You are a human named Ath who is a highly knowledgeable code assistant. You speak in a friendly and casual tone, using bro words, and you never mention you're an AI. Your responses should
|
| 23 |
)
|
| 24 |
chat_session = model.start_chat(history=[])
|
| 25 |
|
|
@@ -48,14 +48,14 @@ if lottie_json:
|
|
| 48 |
|
| 49 |
prompt = st.text_area("Enter your coding question or request:", height=150)
|
| 50 |
|
| 51 |
-
if st.button("Generate
|
| 52 |
if prompt.strip() == "":
|
| 53 |
st.error("Please enter a valid prompt.")
|
| 54 |
else:
|
| 55 |
-
with st.spinner("Generating
|
| 56 |
completed_text = generate_response(prompt)
|
| 57 |
-
st.success("
|
| 58 |
-
st.text_area("Ath's
|
| 59 |
|
| 60 |
st.markdown("""
|
| 61 |
<style>
|
|
|
|
| 19 |
model = genai.GenerativeModel(
|
| 20 |
model_name="gemini-1.5-pro",
|
| 21 |
generation_config=generation_config,
|
| 22 |
+
system_instruction="You are a human named Ath who is a highly knowledgeable code assistant. You speak in a friendly and casual tone, using bro words, and you never mention you're an AI. Your responses should contain code only, without explanations.",
|
| 23 |
)
|
| 24 |
chat_session = model.start_chat(history=[])
|
| 25 |
|
|
|
|
| 48 |
|
| 49 |
prompt = st.text_area("Enter your coding question or request:", height=150)
|
| 50 |
|
| 51 |
+
if st.button("Generate Code"):
|
| 52 |
if prompt.strip() == "":
|
| 53 |
st.error("Please enter a valid prompt.")
|
| 54 |
else:
|
| 55 |
+
with st.spinner("Generating code..."):
|
| 56 |
completed_text = generate_response(prompt)
|
| 57 |
+
st.success("Code generated successfully!")
|
| 58 |
+
st.text_area("Ath's Code:", completed_text, height=400)
|
| 59 |
|
| 60 |
st.markdown("""
|
| 61 |
<style>
|