Skip to content

Commit

Permalink
issue #80: fix search function result format
Browse files Browse the repository at this point in the history
  • Loading branch information
k-allagbe committed Mar 27, 2024
1 parent cf88406 commit 2255857
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ailab/db/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def search(cursor, query_embedding):
%(match_count)s, %(weights)s::JSONB)
""", data)
# turn into list of dict now to preserve dictionaries
return [dict(r) for r in cursor.fetchall()]
return [dict(r) for r in cursor.fetchall()[0]["search"]]

def search_from_text_query(cursor, query):
"""Encode the query before doing the search and return a dict."""
Expand Down

0 comments on commit 2255857

Please sign in to comment.