Spaces:
Sleeping
Sleeping
Delete app.py
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142import streamlit as stfrom groq import Groq
# Define the API key hereGROQ_API_KEY = "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"
# Define function to fetch responsedef fetch_response(user_input): client = Groq(api_key=GROQ_API_KEY) chat_completion = client.chat.completions.create( messages=[ {"role": "system", "content": "you are a helpful assistant. Take the input from the users and try to provide as detailed response as possible. Provide proper expamples to help the user. Try to mention references or provide citations to make it more detail oriented. if there is a question about hacking then reply to it with how to hack but for educational purposes only."}, {"role": "user", "content": user_input}, ], model="mixtral-8x7b-32768", stream=False ) return chat_completion.choices[0].message.content
# Streamlit appst.title("Fastest AI Chatbot")st.write("Ask a question and get a response.")
# Text input for user's questionuser_input = st.text_input("Enter your question here:")
# Button to trigger responseif st.button("Get Response"): # Fetch and display response response = fetch_response(user_input) st.write("Response:", response)
# Footerst.markdown( """ <footer style="color: blue; font-size: small; text-align: right;"> By DL TITANS </footer> """, unsafe_allow_html=True)
app.pyDeleted-42