modified
This commit is contained in:
parent
7e41eed17e
commit
312f9dce8e
1 changed files with 113 additions and 0 deletions
113
README.md
113
README.md
|
|
@ -56,6 +56,119 @@ waifu/
|
||||||
└── live2dcubismcore.min.js # Runtime Cubism 4
|
└── live2dcubismcore.min.js # Runtime Cubism 4
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Diagrama de funcionamiento
|
||||||
|
|
||||||
|
### Arquitectura general
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
flowchart TB
|
||||||
|
subgraph Browser["🌐 Navegador"]
|
||||||
|
UI["Chat · Live2D · Ajustes"]
|
||||||
|
Mic["Micrófono continuo + VAD"]
|
||||||
|
Cam["Cámara + FaceMesh"]
|
||||||
|
Geo["Geolocalización"]
|
||||||
|
end
|
||||||
|
|
||||||
|
subgraph Server["⚙️ Servidor — main.py"]
|
||||||
|
WS["WebSocket /ws"]
|
||||||
|
Wake["Wake check «Arisu»"]
|
||||||
|
STT["Groq Whisper STT"]
|
||||||
|
Prefetch["Prefetch clima"]
|
||||||
|
LLM["Groq LLM + historial"]
|
||||||
|
Tools["Tool calling"]
|
||||||
|
TTS["ElevenLabs TTS"]
|
||||||
|
end
|
||||||
|
|
||||||
|
subgraph Modules["📦 Módulos"]
|
||||||
|
W["weather.py"]
|
||||||
|
S["websearch.py"]
|
||||||
|
T["workspace.py"]
|
||||||
|
end
|
||||||
|
|
||||||
|
subgraph APIs["☁️ APIs externas"]
|
||||||
|
Groq["Groq"]
|
||||||
|
Eleven["ElevenLabs"]
|
||||||
|
OM["Open-Meteo"]
|
||||||
|
Web["Serper · DuckDuckGo · Wikipedia"]
|
||||||
|
end
|
||||||
|
|
||||||
|
UI <-->|"texto · chunks · widget"| WS
|
||||||
|
Mic -->|"PCM 16 kHz · wake_check"| WS
|
||||||
|
Geo -->|"geo_config"| WS
|
||||||
|
Cam --> UI
|
||||||
|
|
||||||
|
WS --> Wake --> STT
|
||||||
|
WS --> STT
|
||||||
|
WS --> Prefetch --> W --> OM
|
||||||
|
Prefetch -->|"weather_widget"| WS
|
||||||
|
STT --> LLM
|
||||||
|
WS -->|"question"| LLM
|
||||||
|
LLM --> Tools
|
||||||
|
Tools --> S --> Web
|
||||||
|
Tools --> T
|
||||||
|
LLM --> Groq
|
||||||
|
STT --> Groq
|
||||||
|
LLM --> TTS --> Eleven
|
||||||
|
TTS -->|"tts_audio"| WS
|
||||||
|
```
|
||||||
|
|
||||||
|
### Flujo de una conversación
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
sequenceDiagram
|
||||||
|
autonumber
|
||||||
|
participant U as Usuario
|
||||||
|
participant B as Navegador
|
||||||
|
participant S as Servidor
|
||||||
|
participant G as Groq
|
||||||
|
participant X as Open-Meteo / Web / Terminal
|
||||||
|
participant E as ElevenLabs
|
||||||
|
|
||||||
|
alt Voz con «Arisu»
|
||||||
|
U->>B: «Arisu, ¿clima en Madrid?»
|
||||||
|
B->>S: wake_check (PCM base64)
|
||||||
|
S->>G: Whisper
|
||||||
|
G-->>S: transcripción
|
||||||
|
S-->>B: wake_ok + text
|
||||||
|
Note over B: Si no hay pregunta en wake_ok,<br/>graba la siguiente frase (post-buffer)
|
||||||
|
else Micrófono manual
|
||||||
|
U->>B: Hablar → Detener
|
||||||
|
B->>S: PCM binario
|
||||||
|
S->>G: Whisper
|
||||||
|
G-->>S: texto
|
||||||
|
S-->>B: transcript
|
||||||
|
else Texto escrito
|
||||||
|
U->>B: Escribe en el chat
|
||||||
|
end
|
||||||
|
|
||||||
|
B->>S: question
|
||||||
|
|
||||||
|
opt Pregunta de clima
|
||||||
|
S->>X: Open-Meteo
|
||||||
|
X-->>S: datos
|
||||||
|
S-->>B: weather_widget
|
||||||
|
end
|
||||||
|
|
||||||
|
S->>G: LLM (+ historial + datos clima)
|
||||||
|
|
||||||
|
loop Herramientas si el LLM las necesita
|
||||||
|
S->>X: web_search / workspace
|
||||||
|
X-->>S: resultados
|
||||||
|
S-->>B: tool_event · tool_result
|
||||||
|
S->>G: continúa con resultados
|
||||||
|
end
|
||||||
|
|
||||||
|
G-->>S: respuesta con [tags]
|
||||||
|
S-->>B: thinking → chunk × N → done
|
||||||
|
|
||||||
|
opt TTS activado
|
||||||
|
S->>E: texto con tags
|
||||||
|
E-->>S: MP3
|
||||||
|
S-->>B: tts_audio
|
||||||
|
B->>B: lip-sync Live2D + expresiones
|
||||||
|
end
|
||||||
|
```
|
||||||
|
|
||||||
## Uso
|
## Uso
|
||||||
|
|
||||||
| Acción | Cómo |
|
| Acción | Cómo |
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue