Spaces:
Sleeping
Sleeping
Prathamesh1420
commited on
Commit
•
c5dfe2a
1
Parent(s):
53dd5b5
Update app.py
Browse files
app.py
CHANGED
@@ -15,6 +15,9 @@ GROQ_API_KEY = "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"
|
|
15 |
# Initialize Neo4j graph
|
16 |
graph = Neo4jGraph(url=NEO4J_URI, username=NEO4J_USERNAME, password=NEO4J_PASSWORD)
|
17 |
|
|
|
|
|
|
|
18 |
# Load movie dataset into Neo4j
|
19 |
moview_query = """
|
20 |
LOAD CSV WITH HEADERS FROM
|
@@ -48,4 +51,7 @@ st.title("Movie Director Finder")
|
|
48 |
query = st.text_input("Enter your query:", "Who was the director of the movie Casino")
|
49 |
if st.button("Find Director"):
|
50 |
response = chain.invoke({"query": query})
|
51 |
-
|
|
|
|
|
|
|
|
15 |
# Initialize Neo4j graph
|
16 |
graph = Neo4jGraph(url=NEO4J_URI, username=NEO4J_USERNAME, password=NEO4J_PASSWORD)
|
17 |
|
18 |
+
# Initialize Neo4j graph
|
19 |
+
graph = Neo4jGraph(url=NEO4J_URI, username=NEO4J_USERNAME, password=NEO4J_PASSWORD)
|
20 |
+
|
21 |
# Load movie dataset into Neo4j
|
22 |
moview_query = """
|
23 |
LOAD CSV WITH HEADERS FROM
|
|
|
51 |
query = st.text_input("Enter your query:", "Who was the director of the movie Casino")
|
52 |
if st.button("Find Director"):
|
53 |
response = chain.invoke({"query": query})
|
54 |
+
if response and response.get("result"):
|
55 |
+
st.write(response["result"])
|
56 |
+
else:
|
57 |
+
st.write("I don't know the answer.")
|