Implement heuristic cutting on the accessibility tree to get the important nodes; Finish accessibility tree text agent
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import time
|
||||
from typing import Dict, List
|
||||
|
||||
import PIL.Image
|
||||
@@ -66,13 +67,20 @@ class GeminiProV_Agent:
|
||||
|
||||
print("Trajectory:", traj_to_show)
|
||||
|
||||
response = self.model.generate_content(
|
||||
message_for_gemini,
|
||||
generation_config={
|
||||
"max_output_tokens": self.max_tokens,
|
||||
"temperature": self.temperature
|
||||
}
|
||||
)
|
||||
while True:
|
||||
try:
|
||||
response = self.model.generate_content(
|
||||
message_for_gemini,
|
||||
generation_config={
|
||||
"max_output_tokens": self.max_tokens,
|
||||
"temperature": self.temperature
|
||||
}
|
||||
)
|
||||
break
|
||||
except:
|
||||
print("Failed to generate response, retrying...")
|
||||
time.sleep(5)
|
||||
pass
|
||||
|
||||
try:
|
||||
response_text = response.text
|
||||
|
||||
Reference in New Issue
Block a user