tsrivallabh commited on
Commit
89c5de0
·
verified ·
1 Parent(s): 23786c6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -14
app.py CHANGED
@@ -17,6 +17,7 @@ from profile_preprocessing import (
17
  initialize_state,
18
  normalize_url
19
  )
 
20
  from openai import OpenAI
21
  import streamlit as st
22
  import hashlib
@@ -33,11 +34,8 @@ from langgraph.graph import add_messages # if your framework exposes this
33
  from langgraph.prebuilt import ToolNode,tools_condition,InjectedState
34
  import dirtyjson
35
  import sqlite3
36
- try:
37
- from langgraph.checkpoint.sqlite import SqliteSaver
38
- SQLITE_AVAILABLE = True
39
- except ImportError:
40
- SQLITE_AVAILABLE = False
41
 
42
 
43
 
@@ -406,15 +404,12 @@ st.title("🧑‍💼 LinkedIn AI Career Assistant")
406
 
407
  # --- Checkpointer and graph initialization ---
408
  if "checkpointer" not in st.session_state:
409
- if SQLITE_AVAILABLE:
410
- import os
411
- print("Current working directory:", os.getcwd())
412
- print("Files in working directory:", os.listdir("."))
413
 
414
- conn = sqlite3.connect("checkpoints1.db", check_same_thread=False)
415
- st.session_state["checkpointer"] = SqliteSaver(conn)
416
- else:
417
- st.session_state["checkpointer"] = MemorySaver()
418
  checkpointer = st.session_state["checkpointer"]
419
 
420
  if "app_graph" not in st.session_state:
@@ -667,7 +662,7 @@ with chat_container:
667
  st.markdown("---")
668
 
669
  user_input = st.chat_input(
670
- placeholder="Ask about your LinkedIn profile, e.g., 'Analyze my profile, How do I fit for AI role?, How is my about section?, Enhance my headline, etc'"
671
  )
672
 
673
  if user_input and user_input.strip():
 
17
  initialize_state,
18
  normalize_url
19
  )
20
+ import os
21
  from openai import OpenAI
22
  import streamlit as st
23
  import hashlib
 
34
  from langgraph.prebuilt import ToolNode,tools_condition,InjectedState
35
  import dirtyjson
36
  import sqlite3
37
+ from langgraph.checkpoint.sqlite import SqliteSaver
38
+
 
 
 
39
 
40
 
41
 
 
404
 
405
  # --- Checkpointer and graph initialization ---
406
  if "checkpointer" not in st.session_state:
407
+
408
+ print("Current working directory:", os.getcwd())
409
+ print("Files in working directory:", os.listdir("."))
 
410
 
411
+ conn = sqlite3.connect("checkpoints1.db", check_same_thread=False)
412
+ st.session_state["checkpointer"] = SqliteSaver(conn)
 
 
413
  checkpointer = st.session_state["checkpointer"]
414
 
415
  if "app_graph" not in st.session_state:
 
662
  st.markdown("---")
663
 
664
  user_input = st.chat_input(
665
+ placeholder="Ask about your LinkedIn profile, e.g., 'Analyze my profile, How do I fit for AI role?, How is my about section?, Enhance my headline,etc...'"
666
  )
667
 
668
  if user_input and user_input.strip():