Update agents/tools/ai_tools.py
Browse files- agents/tools/ai_tools.py +33 -0
agents/tools/ai_tools.py
CHANGED
|
@@ -74,8 +74,11 @@ class AITools():
|
|
| 74 |
)
|
| 75 |
|
| 76 |
result = response.text
|
|
|
|
|
|
|
| 77 |
print(f"๐ ๏ธ AITools: {tool_name}: thinking_level={THINKING_LEVEL_MEDIA_ANALYSIS}")
|
| 78 |
print(f"๐ ๏ธ AITools: {tool_name}: result={result}")
|
|
|
|
| 79 |
return result
|
| 80 |
except Exception as e:
|
| 81 |
print(f"โ ๏ธ AITools: {tool_name}: exception={str(e)}")
|
|
@@ -118,7 +121,11 @@ class AITools():
|
|
| 118 |
)
|
| 119 |
|
| 120 |
result = response.text
|
|
|
|
|
|
|
|
|
|
| 121 |
print(f"๐ ๏ธ AITools: web_search_tool: result={result}")
|
|
|
|
| 122 |
return result
|
| 123 |
except Exception as e:
|
| 124 |
print(f"โ ๏ธ AITools: web_search_tool: exception={str(e)}")
|
|
@@ -163,7 +170,10 @@ class AITools():
|
|
| 163 |
command_type="act" # TODO: act, extract, observe
|
| 164 |
)
|
| 165 |
|
|
|
|
|
|
|
| 166 |
print(f"๐ ๏ธ AITools: web_browser_tool: result={result}")
|
|
|
|
| 167 |
return result
|
| 168 |
except Exception as e:
|
| 169 |
print(f"โ ๏ธ AITools: web_browser_tool: exception={str(e)}")
|
|
@@ -249,7 +259,10 @@ class AITools():
|
|
| 249 |
)
|
| 250 |
)
|
| 251 |
|
|
|
|
|
|
|
| 252 |
print(f"๐ ๏ธ AITools: youtube_analysis_tool: result={result}")
|
|
|
|
| 253 |
return result
|
| 254 |
except Exception as e:
|
| 255 |
print(f"โ ๏ธ AITools: youtube_analysis_tool: exception={str(e)}")
|
|
@@ -299,7 +312,11 @@ class AITools():
|
|
| 299 |
)
|
| 300 |
|
| 301 |
result = response.text
|
|
|
|
|
|
|
|
|
|
| 302 |
print(f"๐ ๏ธ AITools: document_analysis_tool: result={result}")
|
|
|
|
| 303 |
return result
|
| 304 |
except Exception as e:
|
| 305 |
print(f"โ ๏ธ AITools: document_analysis_tool: exception={str(e)}")
|
|
@@ -336,7 +353,10 @@ class AITools():
|
|
| 336 |
|
| 337 |
result = AITools._extract_execution_result(response)
|
| 338 |
|
|
|
|
|
|
|
| 339 |
print(f"๐ ๏ธ AITools: code_generation_and_execution_tool: result={result}")
|
|
|
|
| 340 |
return result
|
| 341 |
except Exception as e:
|
| 342 |
print(f"โ ๏ธ AITools: code_generation_and_execution_tool: exception={str(e)}")
|
|
@@ -376,7 +396,10 @@ class AITools():
|
|
| 376 |
|
| 377 |
result = AITools._extract_execution_result(response)
|
| 378 |
|
|
|
|
|
|
|
| 379 |
print(f"๐ ๏ธ AITools: code_execution_tool: result={result}")
|
|
|
|
| 380 |
return result
|
| 381 |
except Exception as e:
|
| 382 |
print(f"โ ๏ธ AITools: code_execution_tool: exception={str(e)}")
|
|
@@ -439,7 +462,10 @@ class AITools():
|
|
| 439 |
|
| 440 |
board = chess.Board(result) # FEN validation
|
| 441 |
|
|
|
|
|
|
|
| 442 |
print(f"๐ ๏ธ AITools: img_to_fen_tool: result={result}")
|
|
|
|
| 443 |
return result
|
| 444 |
except Exception as e:
|
| 445 |
print(f"โ ๏ธ AITools: img_to_fen_tool: exception={str(e)}")
|
|
@@ -500,7 +526,10 @@ class AITools():
|
|
| 500 |
result = part.text
|
| 501 |
break
|
| 502 |
|
|
|
|
|
|
|
| 503 |
print(f"๐ ๏ธ AITools: algebraic_notation_tool: result={result}")
|
|
|
|
| 504 |
return result
|
| 505 |
except Exception as e:
|
| 506 |
print(f"โ ๏ธ AITools: algebraic_notation_tool: exception={str(e)}")
|
|
@@ -537,7 +566,11 @@ class AITools():
|
|
| 537 |
)
|
| 538 |
|
| 539 |
result = response.text.strip()
|
|
|
|
|
|
|
|
|
|
| 540 |
print(f"๐ ๏ธ AITools: final_answer_tool: result={result}")
|
|
|
|
| 541 |
return result
|
| 542 |
except Exception as e:
|
| 543 |
print(f"โ ๏ธ AITools: final_answer_tool: exception={str(e)}")
|
|
|
|
| 74 |
)
|
| 75 |
|
| 76 |
result = response.text
|
| 77 |
+
|
| 78 |
+
print(f"๐ ๏ธ AITools: {tool_name}: model={model}")
|
| 79 |
print(f"๐ ๏ธ AITools: {tool_name}: thinking_level={THINKING_LEVEL_MEDIA_ANALYSIS}")
|
| 80 |
print(f"๐ ๏ธ AITools: {tool_name}: result={result}")
|
| 81 |
+
|
| 82 |
return result
|
| 83 |
except Exception as e:
|
| 84 |
print(f"โ ๏ธ AITools: {tool_name}: exception={str(e)}")
|
|
|
|
| 121 |
)
|
| 122 |
|
| 123 |
result = response.text
|
| 124 |
+
|
| 125 |
+
print(f"๐ ๏ธ AITools: web_search_tool: model={LLM_WEB_SEARCH}")
|
| 126 |
+
print(f"๐ ๏ธ AITools: web_search_tool: thinking_level={THINKING_LEVEL_WEB_SEARCH}")
|
| 127 |
print(f"๐ ๏ธ AITools: web_search_tool: result={result}")
|
| 128 |
+
|
| 129 |
return result
|
| 130 |
except Exception as e:
|
| 131 |
print(f"โ ๏ธ AITools: web_search_tool: exception={str(e)}")
|
|
|
|
| 170 |
command_type="act" # TODO: act, extract, observe
|
| 171 |
)
|
| 172 |
|
| 173 |
+
print(f"๐ ๏ธ AITools: web_browser_tool: model={LLM_WEB_BROWSER}")
|
| 174 |
+
print(f"๐ ๏ธ AITools: web_browser_tool: command_type=act")
|
| 175 |
print(f"๐ ๏ธ AITools: web_browser_tool: result={result}")
|
| 176 |
+
|
| 177 |
return result
|
| 178 |
except Exception as e:
|
| 179 |
print(f"โ ๏ธ AITools: web_browser_tool: exception={str(e)}")
|
|
|
|
| 259 |
)
|
| 260 |
)
|
| 261 |
|
| 262 |
+
print(f"๐ ๏ธ AITools: youtube_analysis_tool: model={LLM_YOUTUBE_ANALYSIS}")
|
| 263 |
+
print(f"๐ ๏ธ AITools: youtube_analysis_tool: thinking_level={THINKING_LEVEL_YOUTUBE_ANALYSIS}")
|
| 264 |
print(f"๐ ๏ธ AITools: youtube_analysis_tool: result={result}")
|
| 265 |
+
|
| 266 |
return result
|
| 267 |
except Exception as e:
|
| 268 |
print(f"โ ๏ธ AITools: youtube_analysis_tool: exception={str(e)}")
|
|
|
|
| 312 |
)
|
| 313 |
|
| 314 |
result = response.text
|
| 315 |
+
|
| 316 |
+
print(f"๐ ๏ธ AITools: document_analysis_tool: model={LLM_DOCUMENT_ANALYSIS}")
|
| 317 |
+
print(f"๐ ๏ธ AITools: document_analysis_tool: thinking_level={THINKING_LEVEL_DOCUMENT_ANALYSIS}")
|
| 318 |
print(f"๐ ๏ธ AITools: document_analysis_tool: result={result}")
|
| 319 |
+
|
| 320 |
return result
|
| 321 |
except Exception as e:
|
| 322 |
print(f"โ ๏ธ AITools: document_analysis_tool: exception={str(e)}")
|
|
|
|
| 353 |
|
| 354 |
result = AITools._extract_execution_result(response)
|
| 355 |
|
| 356 |
+
print(f"๐ ๏ธ AITools: code_generation_and_execution_tool: model={LLM_CODE_GENERATION}")
|
| 357 |
+
print(f"๐ ๏ธ AITools: code_generation_and_execution_tool: thinking_level={THINKING_LEVEL_CODE_GENERATION}")
|
| 358 |
print(f"๐ ๏ธ AITools: code_generation_and_execution_tool: result={result}")
|
| 359 |
+
|
| 360 |
return result
|
| 361 |
except Exception as e:
|
| 362 |
print(f"โ ๏ธ AITools: code_generation_and_execution_tool: exception={str(e)}")
|
|
|
|
| 396 |
|
| 397 |
result = AITools._extract_execution_result(response)
|
| 398 |
|
| 399 |
+
print(f"๐ ๏ธ AITools: code_execution_tool: model={LLM_CODE_EXECUTION}")
|
| 400 |
+
print(f"๐ ๏ธ AITools: code_execution_tool: thinking_level={THINKING_LEVEL_CODE_EXECUTION}")
|
| 401 |
print(f"๐ ๏ธ AITools: code_execution_tool: result={result}")
|
| 402 |
+
|
| 403 |
return result
|
| 404 |
except Exception as e:
|
| 405 |
print(f"โ ๏ธ AITools: code_execution_tool: exception={str(e)}")
|
|
|
|
| 462 |
|
| 463 |
board = chess.Board(result) # FEN validation
|
| 464 |
|
| 465 |
+
print(f"๐ ๏ธ AITools: img_to_fen_tool: model={LLM_IMAGE_TO_FEN}")
|
| 466 |
+
print(f"๐ ๏ธ AITools: img_to_fen_tool: thinking_level={THINKING_LEVEL_IMAGE_TO_FEN}")
|
| 467 |
print(f"๐ ๏ธ AITools: img_to_fen_tool: result={result}")
|
| 468 |
+
|
| 469 |
return result
|
| 470 |
except Exception as e:
|
| 471 |
print(f"โ ๏ธ AITools: img_to_fen_tool: exception={str(e)}")
|
|
|
|
| 526 |
result = part.text
|
| 527 |
break
|
| 528 |
|
| 529 |
+
print(f"๐ ๏ธ AITools: algebraic_notation_tool: model={LLM_ALGEBRAIC_NOTATION}")
|
| 530 |
+
print(f"๐ ๏ธ AITools: algebraic_notation_tool: thinking_level={THINKING_LEVEL_ALGEBRAIC_NOTATION}")
|
| 531 |
print(f"๐ ๏ธ AITools: algebraic_notation_tool: result={result}")
|
| 532 |
+
|
| 533 |
return result
|
| 534 |
except Exception as e:
|
| 535 |
print(f"โ ๏ธ AITools: algebraic_notation_tool: exception={str(e)}")
|
|
|
|
| 566 |
)
|
| 567 |
|
| 568 |
result = response.text.strip()
|
| 569 |
+
|
| 570 |
+
print(f"๐ ๏ธ AITools: final_answer_tool: model={LLM_FINAL_ANSWER}")
|
| 571 |
+
print(f"๐ ๏ธ AITools: final_answer_tool: thinking_level={THINKING_LEVEL_FINAL_ANSWER}")
|
| 572 |
print(f"๐ ๏ธ AITools: final_answer_tool: result={result}")
|
| 573 |
+
|
| 574 |
return result
|
| 575 |
except Exception as e:
|
| 576 |
print(f"โ ๏ธ AITools: final_answer_tool: exception={str(e)}")
|