Spaces:
Running
Running
feat: Reimplement ReachyMiniMinder as a ReachyMiniApp with a dedicated run method for the conversation app.
Browse files- reachy_mini_minder/main.py +28 -5
reachy_mini_minder/main.py
CHANGED
|
@@ -1,12 +1,35 @@
|
|
| 1 |
"""Entry point shim for Reachy Mini app store.
|
| 2 |
|
| 3 |
-
Re-exports the real app
|
| 4 |
"""
|
| 5 |
|
| 6 |
-
from
|
|
|
|
|
|
|
| 7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
-
class ReachyMiniMinder(ReachyMiniConversationApp):
|
| 10 |
-
"""Alias expected by reachy-mini-app-assistant."""
|
| 11 |
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
"""Entry point shim for Reachy Mini app store.
|
| 2 |
|
| 3 |
+
Re-exports the real app under the name the app-assistant expects.
|
| 4 |
"""
|
| 5 |
|
| 6 |
+
from reachy_mini import ReachyMini, ReachyMiniApp
|
| 7 |
+
from reachy_mini_conversation_app.main import run
|
| 8 |
+
from reachy_mini_conversation_app.utils import parse_args
|
| 9 |
|
| 10 |
+
import asyncio
|
| 11 |
+
import threading
|
| 12 |
+
from typing import Optional
|
| 13 |
+
from fastapi import FastAPI
|
| 14 |
|
|
|
|
|
|
|
| 15 |
|
| 16 |
+
class ReachyMiniMinder(ReachyMiniApp):
|
| 17 |
+
"""Reachy Mini Apps entry point for the Minder app."""
|
| 18 |
+
|
| 19 |
+
custom_app_url = "http://0.0.0.0:7860/"
|
| 20 |
+
dont_start_webserver = False
|
| 21 |
+
|
| 22 |
+
def run(self, reachy_mini: ReachyMini, stop_event: threading.Event) -> None:
|
| 23 |
+
"""Run the Reachy Mini Minder app."""
|
| 24 |
+
loop = asyncio.new_event_loop()
|
| 25 |
+
asyncio.set_event_loop(loop)
|
| 26 |
+
|
| 27 |
+
args, _ = parse_args()
|
| 28 |
+
instance_path = self._get_instance_path().parent
|
| 29 |
+
run(
|
| 30 |
+
args,
|
| 31 |
+
robot=reachy_mini,
|
| 32 |
+
app_stop_event=stop_event,
|
| 33 |
+
settings_app=self.settings_app,
|
| 34 |
+
instance_path=instance_path,
|
| 35 |
+
)
|