Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -22,7 +22,7 @@ books_service = build("books", "v1", developerKey=google_api_key)
|
|
| 22 |
|
| 23 |
# I want to try connect to a google API to get some recommendation of audiobooks!
|
| 24 |
@tool
|
| 25 |
-
def search_audiobooks(topic: str, limit: int = 3)->
|
| 26 |
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 27 |
"""The tool is designed to connect to the google API platform and retrieve some audiobooks recommendations
|
| 28 |
Args:
|
|
@@ -52,7 +52,7 @@ def search_audiobooks(topic: str, limit: int = 3)-> List[Dict[str, Any]]: #it's
|
|
| 52 |
|
| 53 |
@tool
|
| 54 |
# Function to estimate if audiobook fits time constraint
|
| 55 |
-
def filter_by_time(audiobooks:
|
| 56 |
"""The tool is designed to match the time in terms of duration of the audiobook which is called estimated_minutes and the free time that the person have
|
| 57 |
Args:
|
| 58 |
audiobooks: the list of the audiobooks
|
|
|
|
| 22 |
|
| 23 |
# I want to try connect to a google API to get some recommendation of audiobooks!
|
| 24 |
@tool
|
| 25 |
+
def search_audiobooks(topic: str, limit: int = 3)-> list[dict[str, any]]: #it's import to specify the return type
|
| 26 |
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 27 |
"""The tool is designed to connect to the google API platform and retrieve some audiobooks recommendations
|
| 28 |
Args:
|
|
|
|
| 52 |
|
| 53 |
@tool
|
| 54 |
# Function to estimate if audiobook fits time constraint
|
| 55 |
+
def filter_by_time(audiobooks: list[dict[str, any]], free_time: str) -> list[dict[str, any]]:
|
| 56 |
"""The tool is designed to match the time in terms of duration of the audiobook which is called estimated_minutes and the free time that the person have
|
| 57 |
Args:
|
| 58 |
audiobooks: the list of the audiobooks
|