Skip to content

Instantly share code, notes, and snippets.

@idontcalculate
Created July 21, 2024 16:41
Show Gist options
  • Save idontcalculate/4e77124587d686065b00c226a8476bbb to your computer and use it in GitHub Desktop.
Save idontcalculate/4e77124587d686065b00c226a8476bbb to your computer and use it in GitHub Desktop.
from query import search_books
def main():
query_text = "carl sagan, cosmos"
results = search_books(query_text)
if not results:
print("No results found")
else:
for point in results:
title = point.payload.get('title', 'Unknown Title')
description = point.payload.get('description', 'No description available')
categories = point.payload.get('categories', 'Uncategorized')
print(f"Title: {title}\nDescription: {description}\nCategories: {categories}\n---")
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment