Add files via upload

This commit is contained in:
FatihMakes authored and GitHub committed 2026-09-16 18:48:54 +03:00
1 parent b3f7708e0e
commit 476a9c09d6
28 files changed
+8099 -2459

No files matched your search

+6 -7
View File
@@ -327,7 +327,6 @@ def _screen_find(description: str) -> tuple[int, int] | None:
img.save(buf, format="PNG")
image_bytes = buf.getvalue()
client = genai.Client(api_key=api_key)
prompt = (
f"This is a screenshot of a {w}×{h} pixel screen. "
f"Locate the UI element described as: '{description}'. "
@@ -335,13 +334,13 @@ def _screen_find(description: str) -> tuple[int, int] | None:
f"If the element is not visible, reply: NOT_FOUND"
)
response = client.models.generate_content(
model="gemini-flash-lite-latest",
contents=[
gtypes.Part.from_bytes(data=image_bytes, mime_type="image/png"),
prompt,
],
from core import gemini
response = gemini.call(
[gtypes.Part.from_bytes(data=image_bytes, mime_type="image/png"), prompt],
tier=gemini.FAST, timeout_ms=20_000,
)
if response is None:
return None
text = (response.text or "").strip()
if "NOT_FOUND" in text.upper():