@nicfox77/parakeet-stt 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/scripts/install.sh +39 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nicfox77/parakeet-stt",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Parakeet TDT INT8 speech-to-text plugin for OpenClaw. Supports V2 (English) and V3 (Multilingual) models.",
5
5
  "type": "module",
6
6
  "repository": {
@@ -8,6 +8,7 @@ set -e
8
8
  # Configuration
9
9
  PARAKEET_DIR="${PARAKEET_DIR:-$HOME/.openclaw/tools/parakeet}"
10
10
  VENV_DIR="$PARAKEET_DIR/.venv"
11
+ OPENCLAW_CONFIG="$HOME/.openclaw/openclaw.json"
11
12
 
12
13
  # Model URLs (GitHub release - mirrored from Handy project)
13
14
  # Fallback to Handy if GitHub is unavailable
@@ -143,6 +144,42 @@ for script in parakeet-lazy-daemon.py parakeet-audio-client.py parakeet_transcri
143
144
  fi
144
145
  done
145
146
 
147
+ # Configure OpenClaw to use Parakeet for audio transcription
148
+ configure_openclaw() {
149
+ if [ ! -f "$OPENCLAW_CONFIG" ]; then
150
+ echo "Warning: OpenClaw config not found at $OPENCLAW_CONFIG"
151
+ return 1
152
+ fi
153
+
154
+ # Check if jq is available
155
+ if ! command -v jq &> /dev/null; then
156
+ echo "Warning: jq not found, skipping automatic config"
157
+ echo "Please manually add to openclaw.json:"
158
+ echo ' tools.media.audio.models: [{"type": "cli", "command": "'$PARAKEET_DIR'/parakeet-audio-client.py", "args": ["{{MediaPath}}", "{{OutputDir}}"]}]'
159
+ return 1
160
+ fi
161
+
162
+ # Check if parakeet is already configured
163
+ if jq -e '.tools.media.audio.models[]? | select(.command | contains("parakeet"))' "$OPENCLAW_CONFIG" > /dev/null 2>&1; then
164
+ echo "Parakeet already configured in OpenClaw"
165
+ return 0
166
+ fi
167
+
168
+ echo "Configuring OpenClaw to use Parakeet for audio transcription..."
169
+
170
+ # Add parakeet to audio models
171
+ local tmp_config=$(mktemp)
172
+ jq '.tools.media.audio.models += [{
173
+ "type": "cli",
174
+ "command": "'$PARAKEET_DIR'/parakeet-audio-client.py",
175
+ "args": ["{{MediaPath}}", "{{OutputDir}}"]
176
+ }]' "$OPENCLAW_CONFIG" > "$tmp_config" && mv "$tmp_config" "$OPENCLAW_CONFIG"
177
+
178
+ echo "Added Parakeet to tools.media.audio.models"
179
+ }
180
+
181
+ configure_openclaw || true
182
+
146
183
  echo ""
147
184
  echo "=== Installation Complete ==="
148
185
  echo ""
@@ -155,5 +192,5 @@ echo "To switch models, run:"
155
192
  echo " $0 v2 # English optimized"
156
193
  echo " $0 v3 # Multilingual"
157
194
  echo ""
158
- echo "OpenClaw config (already configured):"
159
- echo ' tools.media.audio.models parakeet-audio-client.py'
195
+ echo "Restart OpenClaw gateway to apply changes:"
196
+ echo " openclaw gateway restart"