vibefast-cli 0.2.3 → 0.2.4
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.
- package/.wrangler/state/v3/r2/miniflare-R2BucketObject/d1cc388a1a0ef44dd5669fd1a165d168b61362136c8b5fa50aefd96c72688e54.sqlite +0 -0
- package/.wrangler/state/v3/r2/miniflare-R2BucketObject/d1cc388a1a0ef44dd5669fd1a165d168b61362136c8b5fa50aefd96c72688e54.sqlite-shm +0 -0
- package/.wrangler/state/v3/r2/miniflare-R2BucketObject/d1cc388a1a0ef44dd5669fd1a165d168b61362136c8b5fa50aefd96c72688e54.sqlite-wal +0 -0
- package/.wrangler/state/v3/r2/vibefast-recipes/blobs/177b5d7279681c1bec396cafe63779a2d89eaf538109e55733147727276e2b9f0000019a81f04ba2 +0 -0
- package/.wrangler/state/v3/r2/vibefast-recipes/blobs/4fe398bba6e2d5f13b569bc1be4244e696d86caa04c323db2d9fb0b9381c508f0000019a81f0503f +0 -0
- package/.wrangler/state/v3/r2/vibefast-recipes/blobs/f68f19a655380ac7fb575eb49c0623cde74046261ed89c498ba5107b8aacde9d0000019a81f05484 +0 -0
- package/package.json +1 -1
- package/recipes/chatbot/packages/backend/convex/agents.ts +116 -0
- package/recipes/chatbot/packages/backend/convex/chatbotAgent.ts +1085 -0
- package/recipes/chatbot/packages/backend/convex/chatbotHistory.ts +307 -0
- package/recipes/chatbot/packages/backend/convex/lib/rateLimit.ts +100 -0
- package/recipes/chatbot/packages/backend/convex/lib/telemetry.ts +29 -0
- package/recipes/chatbot/packages/backend/convex/ragKnowledge.ts +714 -0
- package/recipes/chatbot/packages/backend/convex/tools/index.ts +18 -0
- package/recipes/chatbot/packages/backend/convex/tools/knowledgeRetrieval.ts +92 -0
- package/recipes/chatbot/packages/backend/convex/tools/tavilySearch.ts +83 -0
- package/recipes/chatbot/packages/backend/convex/tools/userProfile.ts +72 -0
- package/recipes/chatbot/recipe.json +89 -1
- package/recipes/chatbot@latest.zip +0 -0
- package/recipes/image-generator/packages/backend/convex/imageGeneration/index.ts +12 -0
- package/recipes/image-generator/packages/backend/convex/imageGeneratorFunctions.ts +290 -0
- package/recipes/image-generator/recipe.json +41 -1
- package/recipes/image-generator@latest.zip +0 -0
- package/recipes/voice-bot/packages/backend/convex/router.ts +81 -0
- package/recipes/voice-bot/recipe.json +48 -1
- package/recipes/voice-bot@latest.zip +0 -0
|
@@ -10,6 +10,14 @@
|
|
|
10
10
|
{
|
|
11
11
|
"from": "apps/native/src/features/image-generator",
|
|
12
12
|
"to": "apps/native/src/features/image-generator"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"from": "packages/backend/convex/imageGeneration/index.ts",
|
|
16
|
+
"to": "packages/backend/convex/imageGeneration/index.ts"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"from": "packages/backend/convex/imageGeneratorFunctions.ts",
|
|
20
|
+
"to": "packages/backend/convex/imageGeneratorFunctions.ts"
|
|
13
21
|
}
|
|
14
22
|
],
|
|
15
23
|
"nav": {
|
|
@@ -18,5 +26,37 @@
|
|
|
18
26
|
"icon": "🎨",
|
|
19
27
|
"color": "#A855F7"
|
|
20
28
|
},
|
|
21
|
-
"target": "native"
|
|
29
|
+
"target": "native",
|
|
30
|
+
"env": [
|
|
31
|
+
{
|
|
32
|
+
"key": "OPENAI_API_KEY",
|
|
33
|
+
"description": "OpenAI key to call DALL·E or other text-to-image models.",
|
|
34
|
+
"example": "sk-abc123def456",
|
|
35
|
+
"link": "https://platform.openai.com/account/api-keys"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"key": "GEMINI_API_KEY",
|
|
39
|
+
"description": "Google Generative AI key used to access Gemini image models.",
|
|
40
|
+
"example": "AIzaSyExampleGeminiKey",
|
|
41
|
+
"link": "https://console.cloud.google.com/apis/credentials"
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"manualSteps": [
|
|
45
|
+
{
|
|
46
|
+
"title": "Create an OpenAI API key",
|
|
47
|
+
"description": "Sign into the OpenAI dashboard and create a server API key for image generation.",
|
|
48
|
+
"link": "https://platform.openai.com/account/api-keys"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"title": "Create a Gemini API key",
|
|
52
|
+
"description": "Enable Generative AI APIs in Google Cloud and copy a key for Gemini image models.",
|
|
53
|
+
"link": "https://console.cloud.google.com/apis/credentials"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"title": "Store the keys in .env",
|
|
57
|
+
"description": "Add whichever providers you plan to use to your environment so Convex can authenticate.",
|
|
58
|
+
"file": ".env",
|
|
59
|
+
"content": "OPENAI_API_KEY=sk-...\nGEMINI_API_KEY=AIzaSy...\n"
|
|
60
|
+
}
|
|
61
|
+
]
|
|
22
62
|
}
|
|
Binary file
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { httpRouter } from 'convex/server';
|
|
2
|
+
|
|
3
|
+
import { httpAction } from './_generated/server';
|
|
4
|
+
|
|
5
|
+
const http = httpRouter();
|
|
6
|
+
|
|
7
|
+
const ELEVENLABS_TOKEN_ENDPOINT =
|
|
8
|
+
'https://api.elevenlabs.io/v1/convai/conversation/token';
|
|
9
|
+
|
|
10
|
+
const fetchElevenLabsConversationToken = httpAction(
|
|
11
|
+
async (_ctx, request): Promise<Response> => {
|
|
12
|
+
const apiKey = process.env.ELEVENLABS_API_KEY;
|
|
13
|
+
if (!apiKey) {
|
|
14
|
+
return new Response(
|
|
15
|
+
JSON.stringify({
|
|
16
|
+
error: 'ELEVENLABS_API_KEY is not configured on the backend',
|
|
17
|
+
}),
|
|
18
|
+
{
|
|
19
|
+
status: 500,
|
|
20
|
+
headers: { 'content-type': 'application/json' },
|
|
21
|
+
},
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const url = new URL(request.url);
|
|
26
|
+
const agentId = url.searchParams.get('agent_id');
|
|
27
|
+
if (!agentId) {
|
|
28
|
+
return new Response(
|
|
29
|
+
JSON.stringify({ error: 'agent_id query parameter is required' }),
|
|
30
|
+
{
|
|
31
|
+
status: 400,
|
|
32
|
+
headers: { 'content-type': 'application/json' },
|
|
33
|
+
},
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const upstreamUrl = new URL(ELEVENLABS_TOKEN_ENDPOINT);
|
|
38
|
+
url.searchParams.forEach((value, key) => {
|
|
39
|
+
upstreamUrl.searchParams.set(key, value);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
try {
|
|
43
|
+
const upstreamResponse = await fetch(upstreamUrl, {
|
|
44
|
+
method: 'GET',
|
|
45
|
+
headers: {
|
|
46
|
+
'xi-api-key': apiKey,
|
|
47
|
+
accept: 'application/json',
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
const payload = await upstreamResponse.text();
|
|
52
|
+
return new Response(payload, {
|
|
53
|
+
status: upstreamResponse.status,
|
|
54
|
+
headers: {
|
|
55
|
+
'content-type':
|
|
56
|
+
upstreamResponse.headers.get('content-type') || 'application/json',
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
} catch (error) {
|
|
60
|
+
console.error(
|
|
61
|
+
'[voice.token] Failed to fetch ElevenLabs conversation token',
|
|
62
|
+
error,
|
|
63
|
+
);
|
|
64
|
+
return new Response(
|
|
65
|
+
JSON.stringify({ error: 'Failed to fetch ElevenLabs token' }),
|
|
66
|
+
{
|
|
67
|
+
status: 502,
|
|
68
|
+
headers: { 'content-type': 'application/json' },
|
|
69
|
+
},
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
http.route({
|
|
76
|
+
path: '/voice/conversation-token',
|
|
77
|
+
method: 'GET',
|
|
78
|
+
handler: fetchElevenLabsConversationToken,
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
export default http;
|
|
@@ -10,6 +10,10 @@
|
|
|
10
10
|
{
|
|
11
11
|
"from": "apps/native/src/features/voice-bot",
|
|
12
12
|
"to": "apps/native/src/features/voice-bot"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"from": "packages/backend/convex/router.ts",
|
|
16
|
+
"to": "packages/backend/convex/router.ts"
|
|
13
17
|
}
|
|
14
18
|
],
|
|
15
19
|
"nav": {
|
|
@@ -18,5 +22,48 @@
|
|
|
18
22
|
"icon": "🗣️",
|
|
19
23
|
"color": "#14B8A6"
|
|
20
24
|
},
|
|
21
|
-
"target": "native"
|
|
25
|
+
"target": "native",
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"expo": [
|
|
28
|
+
"@elevenlabs/react-native",
|
|
29
|
+
"@livekit/react-native",
|
|
30
|
+
"@livekit/react-native-webrtc",
|
|
31
|
+
"@livekit/react-native-expo-plugin",
|
|
32
|
+
"@config-plugins/react-native-webrtc"
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
"env": [
|
|
36
|
+
{
|
|
37
|
+
"key": "ELEVENLABS_API_KEY",
|
|
38
|
+
"description": "API key for ElevenLabs Conversational AI (used by the backend token route).",
|
|
39
|
+
"example": "elevenlabs_api_key_example",
|
|
40
|
+
"link": "https://elevenlabs.io/account"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"key": "ELEVENLABS_AGENT_ID",
|
|
44
|
+
"description": "Agent ID from your ElevenLabs Conversational AI agent configuration.",
|
|
45
|
+
"example": "agent-abc123",
|
|
46
|
+
"link": "https://elevenlabs.io/"
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"manualSteps": [
|
|
50
|
+
{
|
|
51
|
+
"title": "Create an ElevenLabs Conversational AI agent",
|
|
52
|
+
"description": "Sign up at ElevenLabs, enable the Conversational AI tab, and provision an agent with speech capabilities."
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"title": "Copy your agent ID and API key",
|
|
56
|
+
"description": "Copy the agent ID and the API key from the ElevenLabs dashboard so the backend token route can authenticate."
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"title": "Store env variables",
|
|
60
|
+
"description": "Add the agent ID and API key to your `.env` file to unlock the voice route.",
|
|
61
|
+
"file": ".env",
|
|
62
|
+
"content": "ELEVENLABS_AGENT_ID=agent-...\nELEVENLABS_API_KEY=elevenlabs_...\n"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"title": "Install native dependencies and build a dev client",
|
|
66
|
+
"description": "Voice bot requires a dev client (WebRTC/native modules), so run `pnpx expo prebuild` and start a native build (`pnpm ios -d` or `pnpm android -d`)."
|
|
67
|
+
}
|
|
68
|
+
]
|
|
22
69
|
}
|
|
Binary file
|