Spaces:
Runtime error
Runtime error
space travel app
Browse files- app.py +20 -15
- requirements.txt +3 -1
app.py
CHANGED
|
@@ -1,22 +1,27 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
-
from
|
| 3 |
-
import
|
| 4 |
-
import io
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
|
| 20 |
-
|
| 21 |
-
url_1 = st.text_input(label="Enter research paper url",key="url_1")
|
| 22 |
-
st.write(x, 'squared is', x * x)
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
from pydantic_ai import Agent
|
| 3 |
+
from pydantic_ai.models.groq import GroqModel
|
|
|
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
+
model = GroqModel('llama-3.1-70b-versatile', api_key='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')
|
| 8 |
+
agent = Agent(model,system_prompt=(
|
| 9 |
+
"Image the year is 3045 and space travel is normal",
|
| 10 |
+
"Mankind has discovered aliens some are more advance then us some are not",
|
| 11 |
+
"You are a travel agent and depending on the budget low, medium and high you will list down some destinations",
|
| 12 |
|
| 13 |
+
))
|
| 14 |
+
|
| 15 |
+
result_1 = agent.run_sync("for space travel which planet is the best")
|
| 16 |
+
##The Zorvath
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
#print(result_1.data)
|
| 21 |
+
|
| 22 |
+
#result_2 = agent.run_sync("What are the major tourust attraction in planet The Zorvath",message_history=result_1.new_messages())
|
| 23 |
+
|
| 24 |
+
#print(result_2.data)
|
| 25 |
|
| 26 |
|
| 27 |
+
st.markdown(result_1.data)
|
|
|
|
|
|
requirements.txt
CHANGED
|
@@ -1,4 +1,6 @@
|
|
| 1 |
streamlit
|
| 2 |
streamlit_pdf_reader
|
| 3 |
pdfplumber
|
| 4 |
-
streamlit_pdf_viewer
|
|
|
|
|
|
|
|
|
| 1 |
streamlit
|
| 2 |
streamlit_pdf_reader
|
| 3 |
pdfplumber
|
| 4 |
+
streamlit_pdf_viewer
|
| 5 |
+
pydantic_ai
|
| 6 |
+
pydantic_ai.models.groq
|