Skip to content

Commit 65b04c0

Browse files
committed
make camera demo not need langchain
1 parent ed9f86b commit 65b04c0

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

dimos/agents/__init__.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
1-
from langchain_core.messages import (
2-
AIMessage,
3-
HumanMessage,
4-
MessageLikeRepresentation,
5-
SystemMessage,
6-
ToolCall,
7-
ToolMessage,
8-
)
9-
101
from dimos.agents.agent import Agent, deploy
112
from dimos.agents.spec import AgentSpec
123
from dimos.agents.vlm_agent import VLMAgent

dimos/hardware/sensors/camera/module.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,17 @@
2020
import reactivex as rx
2121
from reactivex import operators as ops
2222

23-
from dimos.agents import Output, Reducer, Stream, skill
23+
try:
24+
from dimos.agents import Output, Reducer, Stream, skill
25+
except ImportError:
26+
def skill(*args):
27+
def decorator(func):
28+
def actual_function():
29+
raise Exception(f'''dimos.agents is not installed. Please install dimos[agents] to use skills.''')
30+
return func
31+
return decorator
32+
33+
from dimos.core.blueprints import autoconnect
2434
from dimos.core import Module, ModuleConfig, Out, rpc
2535
from dimos.hardware.sensors.camera.spec import CameraHardware
2636
from dimos.hardware.sensors.camera.webcam import Webcam
@@ -114,4 +124,9 @@ def stop(self) -> None:
114124

115125
camera_module = CameraModule.blueprint
116126

127+
demo_camera = autoconnect(
128+
camera_module(),
129+
)
130+
131+
117132
__all__ = ["CameraModule", "camera_module"]

0 commit comments

Comments
 (0)