Update agents/tools/ai_tools.py
Browse files- agents/tools/ai_tools.py +8 -11
agents/tools/ai_tools.py
CHANGED
|
@@ -425,22 +425,19 @@ class AITools():
|
|
| 425 |
"""
|
| 426 |
try:
|
| 427 |
client = genai.Client(api_key=os.environ["GEMINI_API_KEY"])
|
| 428 |
-
|
| 429 |
-
|
| 430 |
-
|
| 431 |
response = client.models.generate_content(
|
| 432 |
-
model=
|
| 433 |
-
contents=[
|
| 434 |
config=types.GenerateContentConfig(
|
| 435 |
-
tools=[types.Tool(code_execution=types.ToolCodeExecution)],
|
| 436 |
thinking_config=types.ThinkingConfig(
|
| 437 |
-
thinking_level=
|
| 438 |
)
|
| 439 |
-
)
|
| 440 |
)
|
| 441 |
|
| 442 |
-
|
| 443 |
-
if part.code_execution_result is not None:
|
| 444 |
-
return part.code_execution_result.output
|
| 445 |
except Exception as e:
|
| 446 |
raise RuntimeError(f"Processing failed: {str(e)}")
|
|
|
|
| 425 |
"""
|
| 426 |
try:
|
| 427 |
client = genai.Client(api_key=os.environ["GEMINI_API_KEY"])
|
| 428 |
+
|
| 429 |
+
prompt = PROMPT_FINAL_ANSWER.format(question=question, answer=answer)
|
| 430 |
+
|
| 431 |
response = client.models.generate_content(
|
| 432 |
+
model=LLM_FINAL_ANSWER,
|
| 433 |
+
contents=[prompt],
|
| 434 |
config=types.GenerateContentConfig(
|
|
|
|
| 435 |
thinking_config=types.ThinkingConfig(
|
| 436 |
+
thinking_level=THINKING_LEVEL_FINAL_ANSWER
|
| 437 |
)
|
| 438 |
+
)
|
| 439 |
)
|
| 440 |
|
| 441 |
+
return response.text
|
|
|
|
|
|
|
| 442 |
except Exception as e:
|
| 443 |
raise RuntimeError(f"Processing failed: {str(e)}")
|