Skip to content

Commit

Permalink
Fix stored value for summary into graph db (actual text instead of co…
Browse files Browse the repository at this point in the history
…routine obj) (opea-project#1193)

Added missing await statement to llm.achat call.

Signed-off-by: rbrygaro <[email protected]>
  • Loading branch information
rbrugaro authored Jan 21, 2025
1 parent bd0b5b0 commit 533b3b5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions comps/dataprep/src/integrations/neo4j_llamaindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ async def generate_community_summary(self, text):
if OPENAI_API_KEY:
response = OpenAI().achat(messages)
else:
response = self.llm.achat(trimmed_messages)
response = await self.llm.achat(trimmed_messages)

clean_response = re.sub(r"^assistant:\s*", "", str(response)).strip()
return clean_response
Expand Down Expand Up @@ -262,7 +262,6 @@ async def _summarize_communities(self, community_info, num_workers=5):
async def _process_community(self, community_id, details_text):
"""Process a single community and store the summary."""
summary = await self.generate_community_summary(details_text)
self.community_summary[community_id] = summary
self.store_community_summary_in_neo4j(community_id, summary)

def store_community_summary_in_neo4j(self, community_id, summary):
Expand Down

0 comments on commit 533b3b5

Please sign in to comment.