Skip to content

Commit 77965e7

Browse files
authored
Merge pull request #222 from djwu563/develop/v0.2.4
add lite_client for webpage
2 parents 8455f78 + 057cd52 commit 77965e7

File tree

7 files changed

+428
-8
lines changed

7 files changed

+428
-8
lines changed

examples/step1_simpleVQA/run_webpage.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# Import required modules and components
2+
import os
3+
os.environ["OMAGENT_MODE"] = "lite"
24
from pathlib import Path
35

4-
from omagent_core.clients.devices.webpage.client import WebpageClient
6+
from omagent_core.clients.devices.webpage import WebpageClient
57
from omagent_core.engine.workflow.conductor_workflow import ConductorWorkflow
68
from omagent_core.engine.workflow.task.simple_task import simple_task
79
from omagent_core.utils.container import container

examples/step2_outfit_with_switch/run_webpage.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Import required modules from omagent_core
2-
from omagent_core.clients.devices.webpage.client import \
2+
import os
3+
os.environ["OMAGENT_MODE"] = "lite"
4+
5+
from omagent_core.clients.devices.webpage import \
36
WebpageClient # For webpage client interface
47
from omagent_core.engine.workflow.conductor_workflow import \
58
ConductorWorkflow # For workflow management
@@ -19,7 +22,6 @@
1922
# Import agent modules
2023
registry.import_module(project_path=CURRENT_PATH.joinpath("agent"))
2124

22-
import os
2325
# Add parent directory to Python path for imports
2426
import sys
2527

examples/step3_outfit_with_loop/run_webpage.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Import core OmAgent components for workflow management and app functionality
2-
from omagent_core.clients.devices.webpage.client import WebpageClient
2+
import os
3+
os.environ["OMAGENT_MODE"] = "lite"
4+
from omagent_core.clients.devices.webpage import WebpageClient
35
from omagent_core.engine.workflow.conductor_workflow import ConductorWorkflow
46
from omagent_core.engine.workflow.task.simple_task import simple_task
57
from omagent_core.utils.container import container
@@ -16,7 +18,6 @@
1618
# Import and register worker modules from agent directory
1719
registry.import_module(project_path=CURRENT_PATH.joinpath("agent"))
1820

19-
import os
2021
# Add parent directory to Python path for imports
2122
import sys
2223

examples/step4_outfit_with_ltm/image_storage/run_image_storage_webpage.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# Import required modules and components
2+
import os
3+
os.environ["OMAGENT_MODE"] = "lite"
24
from omagent_core.engine.workflow.conductor_workflow import ConductorWorkflow
35
from omagent_core.engine.workflow.task.simple_task import simple_task
46
from omagent_core.utils.container import container
@@ -17,7 +19,7 @@
1719

1820
from omagent_core.clients.devices.app.image_index import ImageIndexListener
1921
# Import app-specific components
20-
from omagent_core.clients.devices.webpage.client import WebpageClient
22+
from omagent_core.clients.devices.webpage import WebpageClient
2123

2224
# Configure container with storage systems
2325
container.register_stm(stm="RedisSTM")

examples/step4_outfit_with_ltm/outfit_from_storage/run_outfit_recommendation_webpage.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import os
2+
os.environ["OMAGENT_MODE"] = "lite"
13
from omagent_core.engine.workflow.conductor_workflow import ConductorWorkflow
24
from omagent_core.engine.workflow.task.simple_task import simple_task
35
from omagent_core.utils.container import container
@@ -7,15 +9,14 @@
79

810
from pathlib import Path
911

10-
from omagent_core.clients.devices.webpage.client import WebpageClient
12+
from omagent_core.clients.devices.webpage import WebpageClient
1113

1214
CURRENT_PATH = Path(__file__).parents[0]
1315

1416
from omagent_core.utils.registry import registry
1517

1618
registry.import_module(project_path=CURRENT_PATH.joinpath("agent"))
1719

18-
import os
1920
import sys
2021

2122
sys.path.append(os.path.abspath(CURRENT_PATH.joinpath("../../../")))
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import os
2+
3+
env = os.getenv("OMAGENT_MODE", "lite").lower()
4+
5+
if env == "lite":
6+
print ("importing lite client")
7+
from .lite_client import WebpageClient
8+
else:
9+
print ("importing pro client")
10+
from .client import WebpageClient

0 commit comments

Comments
 (0)