File size: 1,531 Bytes
7c2281e
 
 
 
c8b0ba0
7c2281e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c8b0ba0
50ae4ae
c8b0ba0
7c2281e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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!")