From 09d20845a79898db1439701d16e3ba04871c1ca0 Mon Sep 17 00:00:00 2001 From: alckasoc Date: Wed, 8 Jan 2025 13:12:33 -0800 Subject: [PATCH] refmt --- gui_agents/aci/MacOSACI.py | 8 +++++--- gui_agents/core/Knowledge.py | 8 +++++--- gui_agents/core/Manager.py | 9 +++++++-- gui_agents/mllm/MultimodalAgent.py | 9 ++++++--- gui_agents/mllm/MultimodalAsyncAgent.py | 6 ++++-- gui_agents/mllm/MultimodalAsyncEngine.py | 9 +++++++-- gui_agents/mllm/MultimodalEngine.py | 3 +-- 7 files changed, 35 insertions(+), 17 deletions(-) diff --git a/gui_agents/aci/MacOSACI.py b/gui_agents/aci/MacOSACI.py index 8156af7..78060d7 100644 --- a/gui_agents/aci/MacOSACI.py +++ b/gui_agents/aci/MacOSACI.py @@ -5,9 +5,11 @@ import numpy as np import requests from AppKit import * -from ApplicationServices import (AXUIElementCopyAttributeNames, - AXUIElementCopyAttributeValue, - AXUIElementCreateSystemWide) +from ApplicationServices import ( + AXUIElementCopyAttributeNames, + AXUIElementCopyAttributeValue, + AXUIElementCreateSystemWide, +) from .ACI import ACI, agent_action diff --git a/gui_agents/core/Knowledge.py b/gui_agents/core/Knowledge.py index 9b996e7..d39ea9c 100644 --- a/gui_agents/core/Knowledge.py +++ b/gui_agents/core/Knowledge.py @@ -9,9 +9,11 @@ from gui_agents.core.BaseModule import BaseModule from gui_agents.core.ProceduralMemory import PROCEDURAL_MEMORY from gui_agents.mllm.MultimodalEngine import OpenAIEmbeddingEngine -from gui_agents.utils.common_utils import (load_embeddings, - load_knowledge_base, - save_embeddings) +from gui_agents.utils.common_utils import ( + load_embeddings, + load_knowledge_base, + save_embeddings, +) from gui_agents.utils.query_perplexica import query_to_perplexica working_dir = os.path.dirname(os.path.abspath(__file__)) diff --git a/gui_agents/core/Manager.py b/gui_agents/core/Manager.py index 2381dab..bb33ddb 100644 --- a/gui_agents/core/Manager.py +++ b/gui_agents/core/Manager.py @@ -7,8 +7,13 @@ from gui_agents.core.BaseModule import BaseModule from gui_agents.core.Knowledge import KnowledgeBase from gui_agents.core.ProceduralMemory import PROCEDURAL_MEMORY -from gui_agents.utils.common_utils import (Dag, Node, calculate_tokens, - call_llm_safe, parse_dag) +from gui_agents.utils.common_utils import ( + Dag, + Node, + calculate_tokens, + call_llm_safe, + parse_dag, +) logger = logging.getLogger("desktopenv.agent") diff --git a/gui_agents/mllm/MultimodalAgent.py b/gui_agents/mllm/MultimodalAgent.py index df72382..646335d 100644 --- a/gui_agents/mllm/MultimodalAgent.py +++ b/gui_agents/mllm/MultimodalAgent.py @@ -5,9 +5,12 @@ import base64 import re -from gui_agents.mllm.MultimodalEngine import (LMMEngineAnthropic, - LMMEngineAzureOpenAI, - LMMEngineOpenAI, LMMEnginevLLM) +from gui_agents.mllm.MultimodalEngine import ( + LMMEngineAnthropic, + LMMEngineAzureOpenAI, + LMMEngineOpenAI, + LMMEnginevLLM, +) data_type_map = { "openai": {"image_url": "image_url"}, diff --git a/gui_agents/mllm/MultimodalAsyncAgent.py b/gui_agents/mllm/MultimodalAsyncAgent.py index fc6c1f6..a39144c 100644 --- a/gui_agents/mllm/MultimodalAsyncAgent.py +++ b/gui_agents/mllm/MultimodalAsyncAgent.py @@ -1,8 +1,10 @@ import base64 import re -from gui_agents.mllm.MultimodalAsyncEngine import (LMMEngineAsyncAzureOpenAI, - LMMEngineAsyncOpenAI) +from gui_agents.mllm.MultimodalAsyncEngine import ( + LMMEngineAsyncAzureOpenAI, + LMMEngineAsyncOpenAI, +) from gui_agents.mllm.MultimodalEngine import LMMEngineCogVLM, LMMEngineLlava diff --git a/gui_agents/mllm/MultimodalAsyncEngine.py b/gui_agents/mllm/MultimodalAsyncEngine.py index 1a315f7..9177bb6 100644 --- a/gui_agents/mllm/MultimodalAsyncEngine.py +++ b/gui_agents/mllm/MultimodalAsyncEngine.py @@ -4,8 +4,13 @@ import backoff import openai import requests -from openai import (APIConnectionError, APIError, AsyncAzureOpenAI, - AsyncOpenAI, RateLimitError) +from openai import ( + APIConnectionError, + APIError, + AsyncAzureOpenAI, + AsyncOpenAI, + RateLimitError, +) from PIL import Image diff --git a/gui_agents/mllm/MultimodalEngine.py b/gui_agents/mllm/MultimodalEngine.py index f732c50..528af74 100644 --- a/gui_agents/mllm/MultimodalEngine.py +++ b/gui_agents/mllm/MultimodalEngine.py @@ -12,8 +12,7 @@ import requests import torch from anthropic import Anthropic -from openai import (APIConnectionError, APIError, AzureOpenAI, OpenAI, - RateLimitError) +from openai import APIConnectionError, APIError, AzureOpenAI, OpenAI, RateLimitError from PIL import Image # TODO: Import only if module exists, else ignore