Matt Vaughn Claude Opus 4.5 commited on
Commit ·
88cd3b7
1
Parent(s): 48a7900
Rename: reachy_mini_conversation_app → reachy_mini_language_tutor
Browse filesUpdated package name to better reflect the language learning focus:
- Renamed src/ package directory
- Updated all Python imports
- Updated CLI from reachy-mini-conversation-app to reachy-mini-language-tutor
- Updated pyproject.toml, README.md, CLAUDE.md, .gitignore
- Regenerated uv.lock
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This view is limited to 50 files because it contains too many changes. See raw diff
- .gitignore +1 -1
- CLAUDE.md +10 -10
- README.md +5 -5
- pyproject.toml +5 -5
- src/reachy_mini_conversation_app/profiles/spanish_tutor/recall.py +0 -50
- src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/__init__.py +0 -0
- src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/audio/__init__.py +0 -0
- src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/audio/head_wobbler.py +1 -1
- src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/audio/speech_tapper.py +0 -0
- src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/camera_worker.py +0 -0
- src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/config.py +0 -0
- src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/console.py +7 -7
- src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/dance_emotion_moves.py +0 -0
- src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/gradio_personality.py +0 -0
- src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/gradio_tutor_selector.py +2 -4
- src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/headless_personality.py +0 -0
- src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/headless_personality_ui.py +0 -0
- src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/main.py +10 -12
- src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/memory/__init__.py +0 -0
- src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/memory/tutor_memory.py +0 -0
- src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/moves.py +0 -0
- src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/openai_realtime.py +6 -6
- src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/profile_metadata.json +0 -0
- src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/profiles/__init__.py +0 -0
- src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/profiles/default/instructions.txt +0 -0
- src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/profiles/default/proactive.txt +0 -0
- src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/profiles/default/tools.txt +0 -0
- src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/profiles/french_tutor/instructions.txt +0 -0
- src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/profiles/french_tutor/proactive.txt +0 -0
- src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/profiles/french_tutor/recall.py +1 -1
- src/{reachy_mini_conversation_app/profiles/italian_tutor → reachy_mini_language_tutor/profiles/french_tutor}/remember.py +1 -1
- src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/profiles/french_tutor/tools.txt +0 -0
- src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/profiles/french_tutor/voice.txt +0 -0
- src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/profiles/german_tutor/instructions.txt +0 -0
- src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/profiles/german_tutor/language.txt +0 -0
- src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/profiles/german_tutor/proactive.txt +0 -0
- src/{reachy_mini_conversation_app/profiles/italian_tutor → reachy_mini_language_tutor/profiles/german_tutor}/recall.py +1 -1
- src/{reachy_mini_conversation_app/profiles/french_tutor → reachy_mini_language_tutor/profiles/german_tutor}/remember.py +1 -1
- src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/profiles/german_tutor/tools.txt +0 -0
- src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/profiles/german_tutor/voice.txt +0 -0
- src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/profiles/italian_tutor/instructions.txt +0 -0
- src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/profiles/italian_tutor/language.txt +0 -0
- src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/profiles/italian_tutor/proactive.txt +0 -0
- src/{reachy_mini_conversation_app/profiles/german_tutor → reachy_mini_language_tutor/profiles/italian_tutor}/recall.py +1 -1
- src/{reachy_mini_conversation_app/profiles/portuguese_tutor → reachy_mini_language_tutor/profiles/italian_tutor}/remember.py +1 -1
- src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/profiles/italian_tutor/tools.txt +0 -0
- src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/profiles/italian_tutor/voice.txt +0 -0
- src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/profiles/portuguese_tutor/instructions.txt +0 -0
- src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/profiles/portuguese_tutor/language.txt +0 -0
- src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/profiles/portuguese_tutor/proactive.txt +0 -0
.gitignore
CHANGED
|
@@ -58,4 +58,4 @@ cache/
|
|
| 58 |
.nfs*
|
| 59 |
|
| 60 |
# User-created personalities (managed by UI)
|
| 61 |
-
src/
|
|
|
|
| 58 |
.nfs*
|
| 59 |
|
| 60 |
# User-created personalities (managed by UI)
|
| 61 |
+
src/reachy_mini_language_tutor/profiles/user_personalities/
|
CLAUDE.md
CHANGED
|
@@ -48,13 +48,13 @@ pip install -e .[all_vision,dev]
|
|
| 48 |
|
| 49 |
### Running the App
|
| 50 |
```bash
|
| 51 |
-
reachy-mini-
|
| 52 |
-
reachy-mini-
|
| 53 |
-
reachy-mini-
|
| 54 |
-
reachy-mini-
|
| 55 |
-
reachy-mini-
|
| 56 |
-
reachy-mini-
|
| 57 |
-
reachy-mini-
|
| 58 |
```
|
| 59 |
|
| 60 |
### Development Workflow
|
|
@@ -136,7 +136,7 @@ Six language tutor profiles available in `profiles/`:
|
|
| 136 |
- **`italian_tutor`**: Chiara, an Italian tutor from Florence with cultural insights
|
| 137 |
- **`portuguese_tutor`**: Rafael, a Brazilian Portuguese tutor from São Paulo
|
| 138 |
|
| 139 |
-
Each profile in `src/
|
| 140 |
- **`instructions.txt`**: System prompt with teaching methodology (supports `[placeholder]` syntax)
|
| 141 |
- **`tools.txt`**: Enabled tools list (comment with `#`, one per line)
|
| 142 |
- **`proactive.txt`**: Set to `true` for proactive greeting mode
|
|
@@ -230,7 +230,7 @@ LOCAL_VISION_MODEL=HuggingFaceTB/SmolVLM2-2.2B-Instruct # Local vision model pa
|
|
| 230 |
- **Type checking**: Strict mypy enabled (`mypy src/`)
|
| 231 |
- **Formatting**: Ruff with 119-char line length
|
| 232 |
- **Docstrings**: Required for all public functions/classes (ruff `D` rules enabled)
|
| 233 |
-
- **Import sorting**: `isort` via ruff (local-folder: `
|
| 234 |
- **Quote style**: Double quotes
|
| 235 |
- **Async patterns**: Use `asyncio` for OpenAI realtime API, threading for robot control
|
| 236 |
|
|
@@ -238,7 +238,7 @@ LOCAL_VISION_MODEL=HuggingFaceTB/SmolVLM2-2.2B-Instruct # Local vision model pa
|
|
| 238 |
|
| 239 |
### Adding Custom Tools
|
| 240 |
1. Create Python file in `profiles/<profile_name>/` (e.g., `my_tool.py`)
|
| 241 |
-
2. Subclass `
|
| 242 |
3. Implement `name`, `description`, `parameters`, and `__call__()` method
|
| 243 |
4. Add tool name to `profiles/<profile_name>/tools.txt`
|
| 244 |
5. See `profiles/french_tutor/recall.py` and `profiles/french_tutor/remember.py` for examples
|
|
|
|
| 48 |
|
| 49 |
### Running the App
|
| 50 |
```bash
|
| 51 |
+
reachy-mini-language-tutor # Console mode (default)
|
| 52 |
+
reachy-mini-language-tutor --gradio # Web UI at http://127.0.0.1:7860/
|
| 53 |
+
reachy-mini-language-tutor --head-tracker mediapipe # With face tracking
|
| 54 |
+
reachy-mini-language-tutor --local-vision # Local SmolVLM2 vision
|
| 55 |
+
reachy-mini-language-tutor --wireless-version # For wireless robot
|
| 56 |
+
reachy-mini-language-tutor --no-camera # Audio-only mode
|
| 57 |
+
reachy-mini-language-tutor --profile <name> # Load custom profile
|
| 58 |
```
|
| 59 |
|
| 60 |
### Development Workflow
|
|
|
|
| 136 |
- **`italian_tutor`**: Chiara, an Italian tutor from Florence with cultural insights
|
| 137 |
- **`portuguese_tutor`**: Rafael, a Brazilian Portuguese tutor from São Paulo
|
| 138 |
|
| 139 |
+
Each profile in `src/reachy_mini_language_tutor/profiles/<name>/` contains:
|
| 140 |
- **`instructions.txt`**: System prompt with teaching methodology (supports `[placeholder]` syntax)
|
| 141 |
- **`tools.txt`**: Enabled tools list (comment with `#`, one per line)
|
| 142 |
- **`proactive.txt`**: Set to `true` for proactive greeting mode
|
|
|
|
| 230 |
- **Type checking**: Strict mypy enabled (`mypy src/`)
|
| 231 |
- **Formatting**: Ruff with 119-char line length
|
| 232 |
- **Docstrings**: Required for all public functions/classes (ruff `D` rules enabled)
|
| 233 |
+
- **Import sorting**: `isort` via ruff (local-folder: `reachy_mini_language_tutor`)
|
| 234 |
- **Quote style**: Double quotes
|
| 235 |
- **Async patterns**: Use `asyncio` for OpenAI realtime API, threading for robot control
|
| 236 |
|
|
|
|
| 238 |
|
| 239 |
### Adding Custom Tools
|
| 240 |
1. Create Python file in `profiles/<profile_name>/` (e.g., `my_tool.py`)
|
| 241 |
+
2. Subclass `reachy_mini_language_tutor.tools.core_tools.Tool`
|
| 242 |
3. Implement `name`, `description`, `parameters`, and `__call__()` method
|
| 243 |
4. Add tool name to `profiles/<profile_name>/tools.txt`
|
| 244 |
5. See `profiles/french_tutor/recall.py` and `profiles/french_tutor/remember.py` for examples
|
README.md
CHANGED
|
@@ -52,8 +52,8 @@ Practice conversational skills in French, Spanish, German, Italian, Portuguese,
|
|
| 52 |
### Installation
|
| 53 |
|
| 54 |
```bash
|
| 55 |
-
git clone https://github.com/pollen-robotics/
|
| 56 |
-
cd
|
| 57 |
|
| 58 |
# Using uv (recommended)
|
| 59 |
uv venv --python 3.12.1
|
|
@@ -80,13 +80,13 @@ SUPERMEMORY_API_KEY=... # Optional, for persistent memory
|
|
| 80 |
|
| 81 |
```bash
|
| 82 |
# Practice French
|
| 83 |
-
reachy-mini-
|
| 84 |
|
| 85 |
# Practice Spanish
|
| 86 |
-
reachy-mini-
|
| 87 |
|
| 88 |
# Practice any language (robot will ask what you want to learn)
|
| 89 |
-
reachy-mini-
|
| 90 |
```
|
| 91 |
|
| 92 |
Add `--gradio` for a web interface with live transcripts at http://127.0.0.1:7860/
|
|
|
|
| 52 |
### Installation
|
| 53 |
|
| 54 |
```bash
|
| 55 |
+
git clone https://github.com/pollen-robotics/reachy_mini_language_tutor.git
|
| 56 |
+
cd reachy_mini_language_tutor
|
| 57 |
|
| 58 |
# Using uv (recommended)
|
| 59 |
uv venv --python 3.12.1
|
|
|
|
| 80 |
|
| 81 |
```bash
|
| 82 |
# Practice French
|
| 83 |
+
reachy-mini-language-tutor --profile french_tutor
|
| 84 |
|
| 85 |
# Practice Spanish
|
| 86 |
+
reachy-mini-language-tutor --profile spanish_tutor
|
| 87 |
|
| 88 |
# Practice any language (robot will ask what you want to learn)
|
| 89 |
+
reachy-mini-language-tutor
|
| 90 |
```
|
| 91 |
|
| 92 |
Add `--gradio` for a web interface with live transcripts at http://127.0.0.1:7860/
|
pyproject.toml
CHANGED
|
@@ -3,7 +3,7 @@ requires = ["setuptools"]
|
|
| 3 |
build-backend = "setuptools.build_meta"
|
| 4 |
|
| 5 |
[project]
|
| 6 |
-
name = "
|
| 7 |
version = "0.1.0"
|
| 8 |
authors = [{ name = "Pollen Robotics", email = "contact@pollen-robotics.com" }]
|
| 9 |
description = "Language learning companion for Reachy Mini robot with real-time conversation and persistent memory"
|
|
@@ -59,10 +59,10 @@ dev = [
|
|
| 59 |
]
|
| 60 |
|
| 61 |
[project.scripts]
|
| 62 |
-
reachy-mini-
|
| 63 |
|
| 64 |
[project.entry-points."reachy_mini_apps"]
|
| 65 |
-
|
| 66 |
|
| 67 |
[tool.setuptools]
|
| 68 |
package-dir = { "" = "src" }
|
|
@@ -72,7 +72,7 @@ include-package-data = true
|
|
| 72 |
where = ["src"]
|
| 73 |
|
| 74 |
[tool.setuptools.package-data]
|
| 75 |
-
|
| 76 |
"images/*",
|
| 77 |
"static/*",
|
| 78 |
".env.example",
|
|
@@ -106,7 +106,7 @@ ignore = [
|
|
| 106 |
length-sort = true
|
| 107 |
lines-after-imports = 2
|
| 108 |
no-lines-before = ["standard-library", "local-folder"]
|
| 109 |
-
known-local-folder = ["
|
| 110 |
known-first-party = ["reachy_mini", "reachy_mini_dances_library", "reachy_mini_toolbox"]
|
| 111 |
split-on-trailing-comma = true
|
| 112 |
|
|
|
|
| 3 |
build-backend = "setuptools.build_meta"
|
| 4 |
|
| 5 |
[project]
|
| 6 |
+
name = "reachy_mini_language_tutor"
|
| 7 |
version = "0.1.0"
|
| 8 |
authors = [{ name = "Pollen Robotics", email = "contact@pollen-robotics.com" }]
|
| 9 |
description = "Language learning companion for Reachy Mini robot with real-time conversation and persistent memory"
|
|
|
|
| 59 |
]
|
| 60 |
|
| 61 |
[project.scripts]
|
| 62 |
+
reachy-mini-language-tutor = "reachy_mini_language_tutor.main:main"
|
| 63 |
|
| 64 |
[project.entry-points."reachy_mini_apps"]
|
| 65 |
+
reachy_mini_language_tutor = "reachy_mini_language_tutor.main:ReachyMiniConversationApp"
|
| 66 |
|
| 67 |
[tool.setuptools]
|
| 68 |
package-dir = { "" = "src" }
|
|
|
|
| 72 |
where = ["src"]
|
| 73 |
|
| 74 |
[tool.setuptools.package-data]
|
| 75 |
+
reachy_mini_language_tutor = [
|
| 76 |
"images/*",
|
| 77 |
"static/*",
|
| 78 |
".env.example",
|
|
|
|
| 106 |
length-sort = true
|
| 107 |
lines-after-imports = 2
|
| 108 |
no-lines-before = ["standard-library", "local-folder"]
|
| 109 |
+
known-local-folder = ["reachy_mini_language_tutor"]
|
| 110 |
known-first-party = ["reachy_mini", "reachy_mini_dances_library", "reachy_mini_toolbox"]
|
| 111 |
split-on-trailing-comma = true
|
| 112 |
|
src/reachy_mini_conversation_app/profiles/spanish_tutor/recall.py
DELETED
|
@@ -1,50 +0,0 @@
|
|
| 1 |
-
"""Recall tool for searching learner memories."""
|
| 2 |
-
|
| 3 |
-
from __future__ import annotations
|
| 4 |
-
from typing import Any
|
| 5 |
-
|
| 6 |
-
from reachy_mini_conversation_app.tools.core_tools import Tool, ToolDependencies
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
class RecallTool(Tool):
|
| 10 |
-
"""Search persistent memory for information about the learner."""
|
| 11 |
-
|
| 12 |
-
name = "recall"
|
| 13 |
-
description = (
|
| 14 |
-
"Search your memory for information about this learner from previous sessions. "
|
| 15 |
-
"Use this to check their progress, preferences, or past struggles before giving advice."
|
| 16 |
-
)
|
| 17 |
-
parameters_schema: dict[str, Any] = {
|
| 18 |
-
"type": "object",
|
| 19 |
-
"properties": {
|
| 20 |
-
"query": {
|
| 21 |
-
"type": "string",
|
| 22 |
-
"description": (
|
| 23 |
-
"What to search for, e.g., 'vocabulary struggles', 'preferred topics', "
|
| 24 |
-
"'last session progress', 'grammar they find difficult'"
|
| 25 |
-
),
|
| 26 |
-
},
|
| 27 |
-
},
|
| 28 |
-
"required": ["query"],
|
| 29 |
-
}
|
| 30 |
-
|
| 31 |
-
async def __call__(self, deps: ToolDependencies, **kwargs: Any) -> dict[str, Any]:
|
| 32 |
-
"""Search memories for the given query.
|
| 33 |
-
|
| 34 |
-
Args:
|
| 35 |
-
deps: Tool dependencies including memory_manager.
|
| 36 |
-
**kwargs: Tool arguments including 'query'.
|
| 37 |
-
|
| 38 |
-
Returns:
|
| 39 |
-
Dictionary with search results or error.
|
| 40 |
-
|
| 41 |
-
"""
|
| 42 |
-
if not deps.memory_manager:
|
| 43 |
-
return {"error": "Memory not available", "memories": []}
|
| 44 |
-
|
| 45 |
-
query = kwargs.get("query", "")
|
| 46 |
-
if not query:
|
| 47 |
-
return {"error": "No query provided", "memories": []}
|
| 48 |
-
|
| 49 |
-
results = await deps.memory_manager.search(query)
|
| 50 |
-
return {"memories": results, "count": len(results)}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/__init__.py
RENAMED
|
File without changes
|
src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/audio/__init__.py
RENAMED
|
File without changes
|
src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/audio/head_wobbler.py
RENAMED
|
@@ -11,7 +11,7 @@ from collections.abc import Callable
|
|
| 11 |
import numpy as np
|
| 12 |
from numpy.typing import NDArray
|
| 13 |
|
| 14 |
-
from
|
| 15 |
|
| 16 |
|
| 17 |
SAMPLE_RATE = 24000
|
|
|
|
| 11 |
import numpy as np
|
| 12 |
from numpy.typing import NDArray
|
| 13 |
|
| 14 |
+
from reachy_mini_language_tutor.audio.speech_tapper import HOP_MS, SwayRollRT
|
| 15 |
|
| 16 |
|
| 17 |
SAMPLE_RATE = 24000
|
src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/audio/speech_tapper.py
RENAMED
|
File without changes
|
src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/camera_worker.py
RENAMED
|
File without changes
|
src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/config.py
RENAMED
|
File without changes
|
src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/console.py
RENAMED
|
@@ -22,9 +22,9 @@ from scipy.signal import resample
|
|
| 22 |
|
| 23 |
from reachy_mini import ReachyMini
|
| 24 |
from reachy_mini.media.media_manager import MediaBackend
|
| 25 |
-
from
|
| 26 |
-
from
|
| 27 |
-
from
|
| 28 |
|
| 29 |
|
| 30 |
try:
|
|
@@ -115,7 +115,7 @@ class LocalStream:
|
|
| 115 |
* If ``.env`` exists, replaces/append OPENAI_API_KEY line.
|
| 116 |
* Else, copies template from ``<instance_path>/.env.example`` when present,
|
| 117 |
otherwise falls back to the packaged template
|
| 118 |
-
``
|
| 119 |
* Ensures the resulting file contains the full template plus the key.
|
| 120 |
- Loads the written ``.env`` into the current process environment.
|
| 121 |
"""
|
|
@@ -164,7 +164,7 @@ class LocalStream:
|
|
| 164 |
"""Persist the startup personality to the instance .env and config."""
|
| 165 |
selection = (profile or "").strip() or None
|
| 166 |
try:
|
| 167 |
-
from
|
| 168 |
|
| 169 |
set_custom_profile(selection)
|
| 170 |
except Exception:
|
|
@@ -260,7 +260,7 @@ class LocalStream:
|
|
| 260 |
@self._settings_app.get("/ready")
|
| 261 |
def _ready() -> JSONResponse:
|
| 262 |
try:
|
| 263 |
-
mod = sys.modules.get("
|
| 264 |
ready = bool(getattr(mod, "_TOOLS_INITIALIZED", False)) if mod else False
|
| 265 |
except Exception:
|
| 266 |
ready = False
|
|
@@ -316,7 +316,7 @@ class LocalStream:
|
|
| 316 |
try:
|
| 317 |
from dotenv import load_dotenv
|
| 318 |
|
| 319 |
-
from
|
| 320 |
|
| 321 |
env_path = Path(self._instance_path) / ".env"
|
| 322 |
if env_path.exists():
|
|
|
|
| 22 |
|
| 23 |
from reachy_mini import ReachyMini
|
| 24 |
from reachy_mini.media.media_manager import MediaBackend
|
| 25 |
+
from reachy_mini_language_tutor.config import config
|
| 26 |
+
from reachy_mini_language_tutor.openai_realtime import OpenaiRealtimeHandler
|
| 27 |
+
from reachy_mini_language_tutor.headless_personality_ui import mount_personality_routes
|
| 28 |
|
| 29 |
|
| 30 |
try:
|
|
|
|
| 115 |
* If ``.env`` exists, replaces/append OPENAI_API_KEY line.
|
| 116 |
* Else, copies template from ``<instance_path>/.env.example`` when present,
|
| 117 |
otherwise falls back to the packaged template
|
| 118 |
+
``reachy_mini_language_tutor/.env.example``.
|
| 119 |
* Ensures the resulting file contains the full template plus the key.
|
| 120 |
- Loads the written ``.env`` into the current process environment.
|
| 121 |
"""
|
|
|
|
| 164 |
"""Persist the startup personality to the instance .env and config."""
|
| 165 |
selection = (profile or "").strip() or None
|
| 166 |
try:
|
| 167 |
+
from reachy_mini_language_tutor.config import set_custom_profile
|
| 168 |
|
| 169 |
set_custom_profile(selection)
|
| 170 |
except Exception:
|
|
|
|
| 260 |
@self._settings_app.get("/ready")
|
| 261 |
def _ready() -> JSONResponse:
|
| 262 |
try:
|
| 263 |
+
mod = sys.modules.get("reachy_mini_language_tutor.tools.core_tools")
|
| 264 |
ready = bool(getattr(mod, "_TOOLS_INITIALIZED", False)) if mod else False
|
| 265 |
except Exception:
|
| 266 |
ready = False
|
|
|
|
| 316 |
try:
|
| 317 |
from dotenv import load_dotenv
|
| 318 |
|
| 319 |
+
from reachy_mini_language_tutor.config import set_custom_profile
|
| 320 |
|
| 321 |
env_path = Path(self._instance_path) / ".env"
|
| 322 |
if env_path.exists():
|
src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/dance_emotion_moves.py
RENAMED
|
File without changes
|
src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/gradio_personality.py
RENAMED
|
File without changes
|
src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/gradio_tutor_selector.py
RENAMED
|
@@ -5,16 +5,14 @@ tutor cards instead of the developer-oriented personality management interface.
|
|
| 5 |
"""
|
| 6 |
|
| 7 |
from __future__ import annotations
|
| 8 |
-
|
| 9 |
import json
|
| 10 |
import logging
|
| 11 |
-
import os
|
| 12 |
-
from pathlib import Path
|
| 13 |
from typing import Any
|
|
|
|
| 14 |
|
| 15 |
import gradio as gr
|
| 16 |
|
| 17 |
-
from .config import config
|
| 18 |
|
| 19 |
logger = logging.getLogger(__name__)
|
| 20 |
|
|
|
|
| 5 |
"""
|
| 6 |
|
| 7 |
from __future__ import annotations
|
| 8 |
+
import os
|
| 9 |
import json
|
| 10 |
import logging
|
|
|
|
|
|
|
| 11 |
from typing import Any
|
| 12 |
+
from pathlib import Path
|
| 13 |
|
| 14 |
import gradio as gr
|
| 15 |
|
|
|
|
| 16 |
|
| 17 |
logger = logging.getLogger(__name__)
|
| 18 |
|
src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/headless_personality.py
RENAMED
|
File without changes
|
src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/headless_personality_ui.py
RENAMED
|
File without changes
|
src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/main.py
RENAMED
|
@@ -1,6 +1,5 @@
|
|
| 1 |
"""Entrypoint for Reachy Language Partner."""
|
| 2 |
|
| 3 |
-
import os
|
| 4 |
import sys
|
| 5 |
import time
|
| 6 |
import asyncio
|
|
@@ -11,15 +10,14 @@ from typing import Any, Dict, List, Optional
|
|
| 11 |
import gradio as gr
|
| 12 |
from fastapi import FastAPI
|
| 13 |
from fastrtc import Stream
|
| 14 |
-
from gradio.utils import get_space
|
| 15 |
|
| 16 |
from reachy_mini import ReachyMini, ReachyMiniApp
|
| 17 |
-
from
|
| 18 |
parse_args,
|
| 19 |
setup_logger,
|
| 20 |
handle_vision_stuff,
|
| 21 |
)
|
| 22 |
-
from
|
| 23 |
|
| 24 |
|
| 25 |
def update_chatbot(chatbot: List[Dict[str, Any]], response: Dict[str, Any]) -> List[Dict[str, Any]]:
|
|
@@ -48,12 +46,12 @@ def run(
|
|
| 48 |
) -> None:
|
| 49 |
"""Run Reachy Language Partner."""
|
| 50 |
# Putting these dependencies here makes the dashboard faster to load when the conversation app is installed
|
| 51 |
-
from
|
| 52 |
-
from
|
| 53 |
-
from
|
| 54 |
-
from
|
| 55 |
-
from
|
| 56 |
-
from
|
| 57 |
|
| 58 |
logger = setup_logger(args.debug)
|
| 59 |
logger.info("Starting Reachy Language Partner")
|
|
@@ -100,7 +98,7 @@ def run(
|
|
| 100 |
# Initialize memory manager if API key is available
|
| 101 |
memory_manager = None
|
| 102 |
if config.SUPERMEMORY_API_KEY:
|
| 103 |
-
from
|
| 104 |
|
| 105 |
profile_name = config.REACHY_MINI_CUSTOM_PROFILE or "default"
|
| 106 |
memory_manager = TutorMemory(config.SUPERMEMORY_API_KEY, profile_name=profile_name)
|
|
@@ -124,7 +122,7 @@ def run(
|
|
| 124 |
stream_manager: gr.Blocks | LocalStream | None = None
|
| 125 |
|
| 126 |
if args.gradio:
|
| 127 |
-
from
|
| 128 |
|
| 129 |
tutor_ui = TutorSelectorUI()
|
| 130 |
tutor_ui.create_components()
|
|
|
|
| 1 |
"""Entrypoint for Reachy Language Partner."""
|
| 2 |
|
|
|
|
| 3 |
import sys
|
| 4 |
import time
|
| 5 |
import asyncio
|
|
|
|
| 10 |
import gradio as gr
|
| 11 |
from fastapi import FastAPI
|
| 12 |
from fastrtc import Stream
|
|
|
|
| 13 |
|
| 14 |
from reachy_mini import ReachyMini, ReachyMiniApp
|
| 15 |
+
from reachy_mini_language_tutor.utils import (
|
| 16 |
parse_args,
|
| 17 |
setup_logger,
|
| 18 |
handle_vision_stuff,
|
| 19 |
)
|
| 20 |
+
from reachy_mini_language_tutor.config import set_custom_profile
|
| 21 |
|
| 22 |
|
| 23 |
def update_chatbot(chatbot: List[Dict[str, Any]], response: Dict[str, Any]) -> List[Dict[str, Any]]:
|
|
|
|
| 46 |
) -> None:
|
| 47 |
"""Run Reachy Language Partner."""
|
| 48 |
# Putting these dependencies here makes the dashboard faster to load when the conversation app is installed
|
| 49 |
+
from reachy_mini_language_tutor.moves import MovementManager
|
| 50 |
+
from reachy_mini_language_tutor.config import config
|
| 51 |
+
from reachy_mini_language_tutor.console import LocalStream
|
| 52 |
+
from reachy_mini_language_tutor.openai_realtime import OpenaiRealtimeHandler
|
| 53 |
+
from reachy_mini_language_tutor.tools.core_tools import ToolDependencies
|
| 54 |
+
from reachy_mini_language_tutor.audio.head_wobbler import HeadWobbler
|
| 55 |
|
| 56 |
logger = setup_logger(args.debug)
|
| 57 |
logger.info("Starting Reachy Language Partner")
|
|
|
|
| 98 |
# Initialize memory manager if API key is available
|
| 99 |
memory_manager = None
|
| 100 |
if config.SUPERMEMORY_API_KEY:
|
| 101 |
+
from reachy_mini_language_tutor.memory import TutorMemory
|
| 102 |
|
| 103 |
profile_name = config.REACHY_MINI_CUSTOM_PROFILE or "default"
|
| 104 |
memory_manager = TutorMemory(config.SUPERMEMORY_API_KEY, profile_name=profile_name)
|
|
|
|
| 122 |
stream_manager: gr.Blocks | LocalStream | None = None
|
| 123 |
|
| 124 |
if args.gradio:
|
| 125 |
+
from reachy_mini_language_tutor.gradio_tutor_selector import TutorSelectorUI
|
| 126 |
|
| 127 |
tutor_ui = TutorSelectorUI()
|
| 128 |
tutor_ui.create_components()
|
src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/memory/__init__.py
RENAMED
|
File without changes
|
src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/memory/tutor_memory.py
RENAMED
|
File without changes
|
src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/moves.py
RENAMED
|
File without changes
|
src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/openai_realtime.py
RENAMED
|
@@ -16,9 +16,9 @@ from numpy.typing import NDArray
|
|
| 16 |
from scipy.signal import resample
|
| 17 |
from websockets.exceptions import ConnectionClosedError
|
| 18 |
|
| 19 |
-
from
|
| 20 |
-
from
|
| 21 |
-
from
|
| 22 |
ToolDependencies,
|
| 23 |
get_tool_specs,
|
| 24 |
dispatch_tool_call,
|
|
@@ -94,8 +94,8 @@ class OpenaiRealtimeHandler(AsyncStreamHandler):
|
|
| 94 |
"""
|
| 95 |
try:
|
| 96 |
# Update the in-process config value and env
|
| 97 |
-
from
|
| 98 |
-
from
|
| 99 |
|
| 100 |
set_custom_profile(profile)
|
| 101 |
logger.info(
|
|
@@ -328,7 +328,7 @@ The following is what you remember about this learner from previous sessions:
|
|
| 328 |
|
| 329 |
# Send proactive greeting when session is created
|
| 330 |
if event.type == "session.created" and not self._proactive_greeting_sent:
|
| 331 |
-
from
|
| 332 |
|
| 333 |
if get_profile_proactive_mode():
|
| 334 |
logger.info("Session created - sending proactive greeting")
|
|
|
|
| 16 |
from scipy.signal import resample
|
| 17 |
from websockets.exceptions import ConnectionClosedError
|
| 18 |
|
| 19 |
+
from reachy_mini_language_tutor.config import config
|
| 20 |
+
from reachy_mini_language_tutor.prompts import get_session_voice, get_session_language, get_session_instructions
|
| 21 |
+
from reachy_mini_language_tutor.tools.core_tools import (
|
| 22 |
ToolDependencies,
|
| 23 |
get_tool_specs,
|
| 24 |
dispatch_tool_call,
|
|
|
|
| 94 |
"""
|
| 95 |
try:
|
| 96 |
# Update the in-process config value and env
|
| 97 |
+
from reachy_mini_language_tutor.config import config as _config
|
| 98 |
+
from reachy_mini_language_tutor.config import set_custom_profile
|
| 99 |
|
| 100 |
set_custom_profile(profile)
|
| 101 |
logger.info(
|
|
|
|
| 328 |
|
| 329 |
# Send proactive greeting when session is created
|
| 330 |
if event.type == "session.created" and not self._proactive_greeting_sent:
|
| 331 |
+
from reachy_mini_language_tutor.prompts import get_profile_proactive_mode
|
| 332 |
|
| 333 |
if get_profile_proactive_mode():
|
| 334 |
logger.info("Session created - sending proactive greeting")
|
src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/profile_metadata.json
RENAMED
|
File without changes
|
src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/profiles/__init__.py
RENAMED
|
File without changes
|
src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/profiles/default/instructions.txt
RENAMED
|
File without changes
|
src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/profiles/default/proactive.txt
RENAMED
|
File without changes
|
src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/profiles/default/tools.txt
RENAMED
|
File without changes
|
src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/profiles/french_tutor/instructions.txt
RENAMED
|
File without changes
|
src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/profiles/french_tutor/proactive.txt
RENAMED
|
File without changes
|
src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/profiles/french_tutor/recall.py
RENAMED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
from __future__ import annotations
|
| 4 |
from typing import Any
|
| 5 |
|
| 6 |
-
from
|
| 7 |
|
| 8 |
|
| 9 |
class RecallTool(Tool):
|
|
|
|
| 3 |
from __future__ import annotations
|
| 4 |
from typing import Any
|
| 5 |
|
| 6 |
+
from reachy_mini_language_tutor.tools.core_tools import Tool, ToolDependencies
|
| 7 |
|
| 8 |
|
| 9 |
class RecallTool(Tool):
|
src/{reachy_mini_conversation_app/profiles/italian_tutor → reachy_mini_language_tutor/profiles/french_tutor}/remember.py
RENAMED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
from __future__ import annotations
|
| 4 |
from typing import Any
|
| 5 |
|
| 6 |
-
from
|
| 7 |
|
| 8 |
|
| 9 |
class RememberTool(Tool):
|
|
|
|
| 3 |
from __future__ import annotations
|
| 4 |
from typing import Any
|
| 5 |
|
| 6 |
+
from reachy_mini_language_tutor.tools.core_tools import Tool, ToolDependencies
|
| 7 |
|
| 8 |
|
| 9 |
class RememberTool(Tool):
|
src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/profiles/french_tutor/tools.txt
RENAMED
|
File without changes
|
src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/profiles/french_tutor/voice.txt
RENAMED
|
File without changes
|
src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/profiles/german_tutor/instructions.txt
RENAMED
|
File without changes
|
src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/profiles/german_tutor/language.txt
RENAMED
|
File without changes
|
src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/profiles/german_tutor/proactive.txt
RENAMED
|
File without changes
|
src/{reachy_mini_conversation_app/profiles/italian_tutor → reachy_mini_language_tutor/profiles/german_tutor}/recall.py
RENAMED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
from __future__ import annotations
|
| 4 |
from typing import Any
|
| 5 |
|
| 6 |
-
from
|
| 7 |
|
| 8 |
|
| 9 |
class RecallTool(Tool):
|
|
|
|
| 3 |
from __future__ import annotations
|
| 4 |
from typing import Any
|
| 5 |
|
| 6 |
+
from reachy_mini_language_tutor.tools.core_tools import Tool, ToolDependencies
|
| 7 |
|
| 8 |
|
| 9 |
class RecallTool(Tool):
|
src/{reachy_mini_conversation_app/profiles/french_tutor → reachy_mini_language_tutor/profiles/german_tutor}/remember.py
RENAMED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
from __future__ import annotations
|
| 4 |
from typing import Any
|
| 5 |
|
| 6 |
-
from
|
| 7 |
|
| 8 |
|
| 9 |
class RememberTool(Tool):
|
|
|
|
| 3 |
from __future__ import annotations
|
| 4 |
from typing import Any
|
| 5 |
|
| 6 |
+
from reachy_mini_language_tutor.tools.core_tools import Tool, ToolDependencies
|
| 7 |
|
| 8 |
|
| 9 |
class RememberTool(Tool):
|
src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/profiles/german_tutor/tools.txt
RENAMED
|
File without changes
|
src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/profiles/german_tutor/voice.txt
RENAMED
|
File without changes
|
src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/profiles/italian_tutor/instructions.txt
RENAMED
|
File without changes
|
src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/profiles/italian_tutor/language.txt
RENAMED
|
File without changes
|
src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/profiles/italian_tutor/proactive.txt
RENAMED
|
File without changes
|
src/{reachy_mini_conversation_app/profiles/german_tutor → reachy_mini_language_tutor/profiles/italian_tutor}/recall.py
RENAMED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
from __future__ import annotations
|
| 4 |
from typing import Any
|
| 5 |
|
| 6 |
-
from
|
| 7 |
|
| 8 |
|
| 9 |
class RecallTool(Tool):
|
|
|
|
| 3 |
from __future__ import annotations
|
| 4 |
from typing import Any
|
| 5 |
|
| 6 |
+
from reachy_mini_language_tutor.tools.core_tools import Tool, ToolDependencies
|
| 7 |
|
| 8 |
|
| 9 |
class RecallTool(Tool):
|
src/{reachy_mini_conversation_app/profiles/portuguese_tutor → reachy_mini_language_tutor/profiles/italian_tutor}/remember.py
RENAMED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
from __future__ import annotations
|
| 4 |
from typing import Any
|
| 5 |
|
| 6 |
-
from
|
| 7 |
|
| 8 |
|
| 9 |
class RememberTool(Tool):
|
|
|
|
| 3 |
from __future__ import annotations
|
| 4 |
from typing import Any
|
| 5 |
|
| 6 |
+
from reachy_mini_language_tutor.tools.core_tools import Tool, ToolDependencies
|
| 7 |
|
| 8 |
|
| 9 |
class RememberTool(Tool):
|
src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/profiles/italian_tutor/tools.txt
RENAMED
|
File without changes
|
src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/profiles/italian_tutor/voice.txt
RENAMED
|
File without changes
|
src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/profiles/portuguese_tutor/instructions.txt
RENAMED
|
File without changes
|
src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/profiles/portuguese_tutor/language.txt
RENAMED
|
File without changes
|
src/{reachy_mini_conversation_app → reachy_mini_language_tutor}/profiles/portuguese_tutor/proactive.txt
RENAMED
|
File without changes
|