Afeefa123's picture
Update app.py
50ae4ae verified
import os
import streamlit as st
from groq import Groq
GROQ_API_KEY = "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"
client = Groq(api_key=GROQ_API_KEY)
def get_mission_details(mission_name):
"""Fetch educational content about a space mission using Groq API."""
response = client.chat.completions.create(
messages=[
{
"role": "user",
"content": f"Explain the significance of the {mission_name} mission in space exploration."
}
],
model="llama-3.3-70b-versatile",
)
return response.choices[0].message.content
# Streamlit app interface
# Add a banner image at the top of the app
st.image("abc.jpg", use_container_width=True, caption="Explore the Wonders of Space!")
st.title("๐Ÿš€ Space Exploration Missions Simulator")
st.sidebar.header("Missions")
missions = ["Voyager", "Hubble", "Perseverance", "Artemis"]
mission_name = st.sidebar.selectbox("Select a Mission", missions)
if mission_name:
st.subheader(f"Mission: {mission_name}")
st.text("Fetching details...")
# Fetch and display mission details
try:
mission_details = get_mission_details(mission_name)
st.write(mission_details)
except Exception as e:
st.error(f"Error fetching details: {e}")
st.subheader("Mission Visualization")
st.text("3D models and simulations will be displayed here.")
st.text("For now, this is a placeholder.")
st.sidebar.info("Select a mission from the dropdown to explore!")