Spaces:
Running
Running
Commit
·
58bf191
1
Parent(s):
816fb5a
commit
Browse files
app.py
CHANGED
@@ -45,7 +45,7 @@ def parse_google_books_response(json_content):
|
|
45 |
def format_book_recommendations(books):
|
46 |
formatted_books = []
|
47 |
for index, book in enumerate(books, start=1):
|
48 |
-
formatted_books.append(f"{index}.
|
49 |
return "\n".join(formatted_books)
|
50 |
|
51 |
# Create the AI agent
|
@@ -56,16 +56,16 @@ def generate_recommendations(query: str) -> str:
|
|
56 |
return agent.run(query)
|
57 |
|
58 |
description_md = """
|
59 |
-
Get top 5 book recommendations based on your query. Simply enter
|
60 |
"""
|
61 |
# Create Gradio UI
|
62 |
iface = gr.Interface(
|
63 |
fn=generate_recommendations,
|
64 |
inputs=[
|
65 |
-
gr.Textbox(lines=1, placeholder="Enter a
|
66 |
],
|
67 |
outputs="text",
|
68 |
-
title="Book
|
69 |
description=description_md
|
70 |
)
|
71 |
|
|
|
45 |
def format_book_recommendations(books):
|
46 |
formatted_books = []
|
47 |
for index, book in enumerate(books, start=1):
|
48 |
+
formatted_books.append(f"{index}. {book['title']} by {book['author']}")
|
49 |
return "\n".join(formatted_books)
|
50 |
|
51 |
# Create the AI agent
|
|
|
56 |
return agent.run(query)
|
57 |
|
58 |
description_md = """
|
59 |
+
Get top 5 book recommendations based on your query. Simply enter your query, and receive a list of books with their names, authors.
|
60 |
"""
|
61 |
# Create Gradio UI
|
62 |
iface = gr.Interface(
|
63 |
fn=generate_recommendations,
|
64 |
inputs=[
|
65 |
+
gr.Textbox(lines=1, placeholder="Enter a query", label="Book Topic")
|
66 |
],
|
67 |
outputs="text",
|
68 |
+
title="Book Beacon",
|
69 |
description=description_md
|
70 |
)
|
71 |
|