Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,20 @@
|
|
| 1 |
import streamlit as st
|
|
|
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
from langchain_groq import ChatGroq
|
| 3 |
|
| 4 |
+
st.title("🦜🔗 Quickstart App")
|
| 5 |
+
|
| 6 |
+
# Form to collect user input
|
| 7 |
+
with st.form("my_form"):
|
| 8 |
+
text = st.text_area(
|
| 9 |
+
"Enter text:",
|
| 10 |
+
"What are the three key pieces of advice for learning how to code?",
|
| 11 |
+
)
|
| 12 |
+
submitted = st.form_submit_button("Submit")
|
| 13 |
+
|
| 14 |
+
if submitted:
|
| 15 |
+
# Instantiate and use the ChatGroq model
|
| 16 |
+
model = ChatGroq(model="llama-3.1-70b-versatile")
|
| 17 |
+
response = model.invoke(text)
|
| 18 |
+
|
| 19 |
+
# Display the response in the Streamlit app
|
| 20 |
+
st.info(response)
|