Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -19,7 +19,14 @@ from smolagents.agent_types import AgentText
|
|
| 19 |
|
| 20 |
@tool
|
| 21 |
def lookup_definition(query: str) -> AgentText:
|
| 22 |
-
"""Fetches the definition of a word from the Dictionary API and returns it as AgentText.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
url = f"https://api.dictionaryapi.dev/api/v2/entries/en/{query}"
|
| 24 |
try:
|
| 25 |
response = requests.get(url)
|
|
|
|
| 19 |
|
| 20 |
@tool
|
| 21 |
def lookup_definition(query: str) -> AgentText:
|
| 22 |
+
"""Fetches the definition of a word from the Dictionary API and returns it as AgentText.
|
| 23 |
+
|
| 24 |
+
Args:
|
| 25 |
+
query: The word to look up.
|
| 26 |
+
|
| 27 |
+
Returns:
|
| 28 |
+
A text response.
|
| 29 |
+
"""
|
| 30 |
url = f"https://api.dictionaryapi.dev/api/v2/entries/en/{query}"
|
| 31 |
try:
|
| 32 |
response = requests.get(url)
|