Skip to content

Commit

Permalink
Fix query
Browse files Browse the repository at this point in the history
  • Loading branch information
YoanSallami committed Oct 9, 2023
1 parent 5a0eed2 commit d1f8c02
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
5 changes: 2 additions & 3 deletions hybridagi/hybridstores/program_memory/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ def add_programs(
graph_program = self.create_graph(program_name)
if self.exists(program_name):
graph_program.delete()

graph_program.query(program)
if not self.exists(program_name) or not use_cache:
chain = LLMChain(llm=self.llm, prompt=PROGRAM_DESCRIPTION_PROMPT)
Expand All @@ -112,8 +111,8 @@ def add_programs(
result = graph_program.query('MATCH (n:Program) RETURN n.name AS name')
dependencies[program_name] = []
if len(result.result_set) > 0:
for name in result.result_set[0]:
dependencies[program_name].append(name)
for res in result.result_set:
dependencies[program_name].append(res[0])
indexes.append(program_name)
if self.verbose:
pbar.update(1)
Expand Down
5 changes: 3 additions & 2 deletions hybridagi/hybridstores/program_memory/program_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ def get_program_names(self):
program_names = []
result = self.query(
"MATCH (n:Program) RETURN n.name AS name")
print(result)
if len(result.result_set) > 0:
for name in result.result_set[0]:
program_names.append(name)
for res in result.result_set:
program_names.append(res[0])
return program_names
Empty file.

0 comments on commit d1f8c02

Please sign in to comment.