-
Notifications
You must be signed in to change notification settings - Fork 101
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·58 lines (49 loc) · 1.65 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·58 lines (49 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env bash
# Drop this example into a TEN Framework checkout (README Quick start, step 2).
#
# Usage: ./setup.sh /path/to/ten-framework
#
# Reuses the sibling voice-assistant example's harness (Taskfile, scripts,
# Dockerfile), swaps in this tenapp/, and seeds ai_agents/.env from this
# directory's .env if present.
set -euo pipefail
HERE=$(cd "$(dirname "$0")" && pwd)
TEN_ROOT=${1:?usage: ./setup.sh /path/to/ten-framework}
EXAMPLES="$TEN_ROOT/ai_agents/agents/examples"
TARGET="$EXAMPLES/voice-assistant-with-moss"
if [[ ! -d "$EXAMPLES/voice-assistant" ]]; then
echo "error: $TEN_ROOT does not look like a TEN Framework checkout" >&2
echo " (missing ai_agents/agents/examples/voice-assistant)" >&2
exit 1
fi
if [[ -e "$TARGET" ]]; then
echo "error: $TARGET already exists; remove it to re-run setup" >&2
exit 1
fi
cp -R "$EXAMPLES/voice-assistant" "$TARGET"
rm -rf "$TARGET/tenapp"
cp -R "$HERE/tenapp" "$TARGET/tenapp"
chmod +x "$TARGET"/tenapp/scripts/*.sh
ENV_FILE="$TEN_ROOT/ai_agents/.env"
if [[ ! -f "$ENV_FILE" ]]; then
cp "$TEN_ROOT/ai_agents/.env.example" "$ENV_FILE"
fi
if [[ -f "$HERE/.env" ]]; then
{
echo
echo "# --- appended by apps/ten-moss/setup.sh ---"
cat "$HERE/.env"
} >>"$ENV_FILE"
echo "Appended $HERE/.env to $ENV_FILE"
else
echo "note: no $HERE/.env found; fill in $ENV_FILE by hand"
fi
cat <<EOF
Done. Example installed at:
$TARGET
Next, from that directory (inside TEN's dev container, or with TEN tooling
installed locally):
task install && task run
Then open http://localhost:3000. Default graph is voice_assistant (ambient).
Tool-call graph: http://localhost:3000?graph=voice_assistant_tools
EOF