Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -27,7 +27,11 @@ def my_custom_tool(arg1:str)-> str: #it's import to specify the return type
|
|
| 27 |
# 검색 도구 초기화
|
| 28 |
search_tool = DuckDuckGoSearchTool()
|
| 29 |
result = search_tool(arg1)
|
| 30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
@tool
|
| 33 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
@@ -66,7 +70,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 66 |
|
| 67 |
agent = CodeAgent(
|
| 68 |
model=model,
|
| 69 |
-
tools=[final_answer], ## add your tools here (don't remove final answer)
|
| 70 |
max_steps=6,
|
| 71 |
verbosity_level=1,
|
| 72 |
grammar=None,
|
|
|
|
| 27 |
# 검색 도구 초기화
|
| 28 |
search_tool = DuckDuckGoSearchTool()
|
| 29 |
result = search_tool(arg1)
|
| 30 |
+
|
| 31 |
+
# 안전하게 문자열로 변환
|
| 32 |
+
if isinstance(result, (dict, list)):
|
| 33 |
+
return yaml.safe_dump(result, allow_unicode=True, sort_keys=False)
|
| 34 |
+
return str(result)
|
| 35 |
|
| 36 |
@tool
|
| 37 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
|
|
| 70 |
|
| 71 |
agent = CodeAgent(
|
| 72 |
model=model,
|
| 73 |
+
tools=[final_answer, my_custom_tool, get_current_time_in_timezone], ## add your tools here (don't remove final answer)
|
| 74 |
max_steps=6,
|
| 75 |
verbosity_level=1,
|
| 76 |
grammar=None,
|