ash001 commited on
Commit
f29aa37
·
1 Parent(s): 6cee2e2

add neo4j database value from sidebar

Browse files
app.py CHANGED
@@ -122,6 +122,11 @@ st.sidebar.subheader("Neo4j (Graph DB)")
122
  neo4j_uri = st.sidebar.text_input("NEO4J_URI", value=os.getenv("NEO4J_URI", ""))
123
  neo4j_username = st.sidebar.text_input("NEO4J_USERNAME", value=os.getenv("NEO4J_USERNAME", ""))
124
  neo4j_password = st.sidebar.text_input("NEO4J_PASSWORD", value=os.getenv("NEO4J_PASSWORD", ""), type="password")
 
 
 
 
 
125
 
126
  st.sidebar.subheader("UI")
127
  show_routing = st.sidebar.checkbox("Show routed agent", value=True)
@@ -134,6 +139,7 @@ settings = Settings(
134
  neo4j_uri=neo4j_uri,
135
  neo4j_username=neo4j_username,
136
  neo4j_password=neo4j_password,
 
137
  wiki_doc_content_chars_max=int(os.getenv("WIKI_DOC_CHARS", "2000")),
138
  debug=os.getenv("DEBUG", "0") in ("1", "true", "True"),
139
  )
@@ -148,6 +154,7 @@ def _router_graph_cached(model: str):
148
  neo4j_uri=settings.neo4j_uri,
149
  neo4j_username=settings.neo4j_username,
150
  neo4j_password=settings.neo4j_password,
 
151
  wiki_doc_content_chars_max=settings.wiki_doc_content_chars_max,
152
  debug=settings.debug,
153
  )
@@ -163,6 +170,7 @@ def _tools_graph_cached(model: str):
163
  neo4j_uri=settings.neo4j_uri,
164
  neo4j_username=settings.neo4j_username,
165
  neo4j_password=settings.neo4j_password,
 
166
  wiki_doc_content_chars_max=settings.wiki_doc_content_chars_max,
167
  debug=settings.debug,
168
  )
 
122
  neo4j_uri = st.sidebar.text_input("NEO4J_URI", value=os.getenv("NEO4J_URI", ""))
123
  neo4j_username = st.sidebar.text_input("NEO4J_USERNAME", value=os.getenv("NEO4J_USERNAME", ""))
124
  neo4j_password = st.sidebar.text_input("NEO4J_PASSWORD", value=os.getenv("NEO4J_PASSWORD", ""), type="password")
125
+ neo4j_database = st.sidebar.text_input(
126
+ "NEO4J_DATABASE",
127
+ value=os.getenv("NEO4J_DATABASE", ""),
128
+ help="Aura names this after the instance id (e.g. 4b4dbb91), not 'neo4j'.",
129
+ )
130
 
131
  st.sidebar.subheader("UI")
132
  show_routing = st.sidebar.checkbox("Show routed agent", value=True)
 
139
  neo4j_uri=neo4j_uri,
140
  neo4j_username=neo4j_username,
141
  neo4j_password=neo4j_password,
142
+ neo4j_database=neo4j_database,
143
  wiki_doc_content_chars_max=int(os.getenv("WIKI_DOC_CHARS", "2000")),
144
  debug=os.getenv("DEBUG", "0") in ("1", "true", "True"),
145
  )
 
154
  neo4j_uri=settings.neo4j_uri,
155
  neo4j_username=settings.neo4j_username,
156
  neo4j_password=settings.neo4j_password,
157
+ neo4j_database=settings.neo4j_database,
158
  wiki_doc_content_chars_max=settings.wiki_doc_content_chars_max,
159
  debug=settings.debug,
160
  )
 
170
  neo4j_uri=settings.neo4j_uri,
171
  neo4j_username=settings.neo4j_username,
172
  neo4j_password=settings.neo4j_password,
173
+ neo4j_database=settings.neo4j_database,
174
  wiki_doc_content_chars_max=settings.wiki_doc_content_chars_max,
175
  debug=settings.debug,
176
  )
orchestrator/graph_agent.py CHANGED
@@ -27,6 +27,7 @@ def _get_graph(settings: Settings):
27
  url=settings.neo4j_uri,
28
  username=settings.neo4j_username,
29
  password=settings.neo4j_password,
 
30
  )
31
 
32
  def graph_answer(settings: Settings, question: str) -> Dict[str, Any]:
 
27
  url=settings.neo4j_uri,
28
  username=settings.neo4j_username,
29
  password=settings.neo4j_password,
30
+ database=settings.neo4j_database or None,
31
  )
32
 
33
  def graph_answer(settings: Settings, question: str) -> Dict[str, Any]:
orchestrator/settings.py CHANGED
@@ -15,6 +15,8 @@ class Settings:
15
  neo4j_uri: str = os.getenv("NEO4J_URI", "")
16
  neo4j_username: str = os.getenv("NEO4J_USERNAME", "")
17
  neo4j_password: str = os.getenv("NEO4J_PASSWORD", "")
 
 
18
 
19
  # Tool settings
20
  # wiki_top_k_results: int = int(os.getenv("WIKI_TOP_K", "3"))
 
15
  neo4j_uri: str = os.getenv("NEO4J_URI", "")
16
  neo4j_username: str = os.getenv("NEO4J_USERNAME", "")
17
  neo4j_password: str = os.getenv("NEO4J_PASSWORD", "")
18
+ # Aura names this after the instance id (e.g. 4b4dbb91), not "neo4j".
19
+ neo4j_database: str = os.getenv("NEO4J_DATABASE", "")
20
 
21
  # Tool settings
22
  # wiki_top_k_results: int = int(os.getenv("WIKI_TOP_K", "3"))