Update agents/tools/ai_tools.py
Browse files- agents/tools/ai_tools.py +6 -6
agents/tools/ai_tools.py
CHANGED
|
@@ -432,21 +432,21 @@ class AITools():
|
|
| 432 |
raise RuntimeError(f"Processing failed: {str(e)}")
|
| 433 |
|
| 434 |
@tool("Algebraic Notation Tool")
|
| 435 |
-
def algebraic_notation_tool(question: str, file_path: str,
|
| 436 |
-
"""Given a chess question, image file, and
|
| 437 |
|
| 438 |
Args:
|
| 439 |
question (str): The chess question
|
| 440 |
file_path (str): The image file path
|
| 441 |
-
|
| 442 |
|
| 443 |
Returns:
|
| 444 |
-
str: Answer to the question in
|
| 445 |
|
| 446 |
Raises:
|
| 447 |
RuntimeError: If processing fails
|
| 448 |
"""
|
| 449 |
-
print(f"🤖 AITools: algebraic_notation_tool: question={question}, file_path={file_path},
|
| 450 |
|
| 451 |
try:
|
| 452 |
client = AITools._get_client()
|
|
@@ -455,7 +455,7 @@ class AITools():
|
|
| 455 |
img_bytes = f.read()
|
| 456 |
img_b64 = base64.b64encode(img_bytes).decode("ascii")
|
| 457 |
|
| 458 |
-
prompt = PROMPT_ALGEBRAIC_CHESS_NOTATION.format(question=question,
|
| 459 |
|
| 460 |
content = types.Content(
|
| 461 |
parts=[
|
|
|
|
| 432 |
raise RuntimeError(f"Processing failed: {str(e)}")
|
| 433 |
|
| 434 |
@tool("Algebraic Notation Tool")
|
| 435 |
+
def algebraic_notation_tool(question: str, file_path: str, position_evaluation: str) -> str:
|
| 436 |
+
"""Given a chess question, image file, and position evaluation in UCI, answer the question in algebraic notation.
|
| 437 |
|
| 438 |
Args:
|
| 439 |
question (str): The chess question
|
| 440 |
file_path (str): The image file path
|
| 441 |
+
position_evaluation (str): The position evaluation in UCI
|
| 442 |
|
| 443 |
Returns:
|
| 444 |
+
str: Answer to the question in algebraic notation
|
| 445 |
|
| 446 |
Raises:
|
| 447 |
RuntimeError: If processing fails
|
| 448 |
"""
|
| 449 |
+
print(f"🤖 AITools: algebraic_notation_tool: question={question}, file_path={file_path}, position_evaluation={position_evaluation}")
|
| 450 |
|
| 451 |
try:
|
| 452 |
client = AITools._get_client()
|
|
|
|
| 455 |
img_bytes = f.read()
|
| 456 |
img_b64 = base64.b64encode(img_bytes).decode("ascii")
|
| 457 |
|
| 458 |
+
prompt = PROMPT_ALGEBRAIC_CHESS_NOTATION.format(question=question, position_evaluation=position_evaluation)
|
| 459 |
|
| 460 |
content = types.Content(
|
| 461 |
parts=[
|