bstraehle commited on
Commit
2db2535
·
verified ·
1 Parent(s): 1d64dcf

Update agents/tools/ai_tools.py

Browse files
Files changed (1) hide show
  1. 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
- file = client.files.upload(file=file_path)
430
-
431
  response = client.models.generate_content(
432
- model=LLM_CODE_EXECUTION,
433
- contents=[file, question],
434
  config=types.GenerateContentConfig(
435
- tools=[types.Tool(code_execution=types.ToolCodeExecution)],
436
  thinking_config=types.ThinkingConfig(
437
- thinking_level=THINKING_LEVEL_TOOLS
438
  )
439
- ),
440
  )
441
 
442
- for part in response.candidates[0].content.parts:
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)}")