Skip to content

Commit

Permalink
make closest_object an array as it's returned from db (#550)
Browse files Browse the repository at this point in the history
  • Loading branch information
northdpole authored Aug 20, 2024
1 parent 95ace6b commit 77ae860
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion application/prompt_client/prompt_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,8 @@ def generate_text(self, prompt: str) -> Dict[str, str]:
closest_object = None
if closest_id:
closest_object = self.database.get_nodes(db_id=closest_id)

if len(closest_object) > 0:
closest_object = closest_object[0]
logger.info(
f"The prompt {prompt}, was most similar to object \n{closest_object}\n, with similarity:{similarity}"
)
Expand Down

0 comments on commit 77ae860

Please sign in to comment.