S-Dreamer commited on
Commit
933798f
·
verified ·
1 Parent(s): 55a0121

Add 3 files

Browse files
Files changed (3) hide show
  1. README.md +7 -5
  2. index.html +307 -19
  3. prompts.txt +1 -0
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Retellai
3
- emoji: 🏆
4
- colorFrom: pink
5
- colorTo: purple
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: retellai
3
+ emoji: 🐳
4
+ colorFrom: gray
5
+ colorTo: red
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
index.html CHANGED
@@ -1,19 +1,307 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>AI Voice Outbound Agent Builder</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9
+ <style>
10
+ .gradient-bg {
11
+ background: linear-gradient(135deg, #6b46c1 0%, #4299e1 100%);
12
+ }
13
+ .code-block {
14
+ background-color: #2d3748;
15
+ border-radius: 0.5rem;
16
+ padding: 1rem;
17
+ font-family: 'Courier New', monospace;
18
+ overflow-x: auto;
19
+ }
20
+ .step-card {
21
+ transition: all 0.3s ease;
22
+ }
23
+ .step-card:hover {
24
+ transform: translateY(-5px);
25
+ box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
26
+ }
27
+ .tab-active {
28
+ border-bottom: 3px solid #4299e1;
29
+ color: #4299e1;
30
+ font-weight: 600;
31
+ }
32
+ </style>
33
+ </head>
34
+ <body class="bg-gray-50 min-h-screen">
35
+ <div class="gradient-bg text-white py-12 px-4 sm:px-6 lg:px-8">
36
+ <div class="max-w-7xl mx-auto text-center">
37
+ <h1 class="text-4xl md:text-5xl font-bold mb-4">AI Voice Outbound Agent</h1>
38
+ <p class="text-xl md:text-2xl opacity-90">Build with Retell AI & Sesame CSM-1B Model</p>
39
+ <div class="mt-8 flex justify-center space-x-4">
40
+ <a href="#guide" class="px-6 py-3 bg-white text-indigo-700 rounded-lg font-medium hover:bg-gray-100 transition">Get Started</a>
41
+ <a href="#demo" class="px-6 py-3 border-2 border-white text-white rounded-lg font-medium hover:bg-white hover:bg-opacity-10 transition">Live Demo</a>
42
+ </div>
43
+ </div>
44
+ </div>
45
+
46
+ <div class="max-w-7xl mx-auto py-12 px-4 sm:px-6 lg:px-8" id="guide">
47
+ <div class="text-center mb-12">
48
+ <h2 class="text-3xl font-bold text-gray-800 mb-4">Step-by-Step Guide</h2>
49
+ <p class="text-lg text-gray-600 max-w-3xl mx-auto">Follow these steps to create your AI voice outbound agent using the latest technologies.</p>
50
+ </div>
51
+
52
+ <div class="grid md:grid-cols-2 lg:grid-cols-3 gap-8">
53
+ <!-- Step 1 -->
54
+ <div class="step-card bg-white rounded-xl shadow-md overflow-hidden p-6">
55
+ <div class="flex items-center mb-4">
56
+ <div class="bg-indigo-100 text-indigo-800 rounded-full w-10 h-10 flex items-center justify-center font-bold mr-4">1</div>
57
+ <h3 class="text-xl font-semibold text-gray-800">Environment Setup</h3>
58
+ </div>
59
+ <p class="text-gray-600 mb-4">Install the required Python libraries for the Retell AI integration.</p>
60
+ <div class="code-block text-gray-200 text-sm mb-4">
61
+ <pre>pip install retell-ai aiohttp</pre>
62
+ </div>
63
+ <div class="flex items-center text-sm text-gray-500">
64
+ <i class="fas fa-info-circle mr-2"></i>
65
+ <span>Python 3.8+ required</span>
66
+ </div>
67
+ </div>
68
+
69
+ <!-- Step 2 -->
70
+ <div class="step-card bg-white rounded-xl shadow-md overflow-hidden p-6">
71
+ <div class="flex items-center mb-4">
72
+ <div class="bg-indigo-100 text-indigo-800 rounded-full w-10 h-10 flex items-center justify-center font-bold mr-4">2</div>
73
+ <h3 class="text-xl font-semibold text-gray-800">Retell AI Authentication</h3>
74
+ </div>
75
+ <p class="text-gray-600 mb-4">Authenticate with your Retell AI API key.</p>
76
+ <div class="code-block text-gray-200 text-sm mb-4">
77
+ <pre>import retell
78
+
79
+ client = retell.Client(api_key="your_api_key")</pre>
80
+ </div>
81
+ <div class="flex items-center text-sm text-gray-500">
82
+ <i class="fas fa-key mr-2"></i>
83
+ <span>Get API key from Retell dashboard</span>
84
+ </div>
85
+ </div>
86
+
87
+ <!-- Step 3 -->
88
+ <div class="step-card bg-white rounded-xl shadow-md overflow-hidden p-6">
89
+ <div class="flex items-center mb-4">
90
+ <div class="bg-indigo-100 text-indigo-800 rounded-full w-10 h-10 flex items-center justify-center font-bold mr-4">3</div>
91
+ <h3 class="text-xl font-semibold text-gray-800">Agent Behavior</h3>
92
+ </div>
93
+ <p class="text-gray-600 mb-4">Define your agent's persona and conversation flow.</p>
94
+ <div class="code-block text-gray-200 text-sm mb-4">
95
+ <pre>agent_config = {
96
+ "initial_message": "Hello, this is Alex from Customer Support.",
97
+ "voice": "male-1",
98
+ "persona": "friendly and professional"
99
+ }</pre>
100
+ </div>
101
+ <div class="flex items-center text-sm text-gray-500">
102
+ <i class="fas fa-robot mr-2"></i>
103
+ <span>Customize as needed</span>
104
+ </div>
105
+ </div>
106
+
107
+ <!-- Step 4 -->
108
+ <div class="step-card bg-white rounded-xl shadow-md overflow-hidden p-6">
109
+ <div class="flex items-center mb-4">
110
+ <div class="bg-indigo-100 text-indigo-800 rounded-full w-10 h-10 flex items-center justify-center font-bold mr-4">4</div>
111
+ <h3 class="text-xl font-semibold text-gray-800">Sesame AI Integration</h3>
112
+ </div>
113
+ <p class="text-gray-600 mb-4">Configure the agent to use CSM-1B model.</p>
114
+ <div class="code-block text-gray-200 text-sm mb-4">
115
+ <pre>agent_config["llm"] = {
116
+ "model": "csm-1b",
117
+ "provider": "sesame"
118
+ }</pre>
119
+ </div>
120
+ <div class="flex items-center text-sm text-gray-500">
121
+ <i class="fas fa-brain mr-2"></i>
122
+ <span>Latest Sesame AI model</span>
123
+ </div>
124
+ </div>
125
+
126
+ <!-- Step 5 -->
127
+ <div class="step-card bg-white rounded-xl shadow-md overflow-hidden p-6">
128
+ <div class="flex items-center mb-4">
129
+ <div class="bg-indigo-100 text-indigo-800 rounded-full w-10 h-10 flex items-center justify-center font-bold mr-4">5</div>
130
+ <h3 class="text-xl font-semibold text-gray-800">Outbound Call</h3>
131
+ </div>
132
+ <p class="text-gray-600 mb-4">Initiate the call with recipient's phone number.</p>
133
+ <div class="code-block text-gray-200 text-sm mb-4">
134
+ <pre>response = client.calls.create(
135
+ phone_number="+15551234567",
136
+ agent_config=agent_config
137
+ )</pre>
138
+ </div>
139
+ <div class="flex items-center text-sm text-gray-500">
140
+ <i class="fas fa-phone mr-2"></i>
141
+ <span>E.164 format required</span>
142
+ </div>
143
+ </div>
144
+
145
+ <!-- Step 6 -->
146
+ <div class="step-card bg-white rounded-xl shadow-md overflow-hidden p-6">
147
+ <div class="flex items-center mb-4">
148
+ <div class="bg-indigo-100 text-indigo-800 rounded-full w-10 h-10 flex items-center justify-center font-bold mr-4">6</div>
149
+ <h3 class="text-xl font-semibold text-gray-800">Call Events</h3>
150
+ </div>
151
+ <p class="text-gray-600 mb-4">Handle call events and responses.</p>
152
+ <div class="code-block text-gray-200 text-sm mb-4">
153
+ <pre>@client.on("call.connected")
154
+ async def handle_connected(call):
155
+ print(f"Call connected: {call.id}")
156
+
157
+ @client.on("agent.response")
158
+ async def handle_response(response):
159
+ print(f"Agent said: {response.text}")</pre>
160
+ </div>
161
+ <div class="flex items-center text-sm text-gray-500">
162
+ <i class="fas fa-bell mr-2"></i>
163
+ <span>Register event handlers</span>
164
+ </div>
165
+ </div>
166
+ </div>
167
+ </div>
168
+
169
+ <div class="max-w-7xl mx-auto py-12 px-4 sm:px-6 lg:px-8 bg-gray-100 rounded-xl" id="demo">
170
+ <div class="text-center mb-8">
171
+ <h2 class="text-3xl font-bold text-gray-800 mb-2">Complete Example</h2>
172
+ <p class="text-lg text-gray-600">Here's the full implementation you can use as a starting point.</p>
173
+ </div>
174
+
175
+ <div class="mb-6">
176
+ <div class="flex border-b border-gray-200">
177
+ <button class="tab-active py-2 px-4 font-medium">Python</button>
178
+ </div>
179
+ </div>
180
+
181
+ <div class="code-block text-gray-200 text-sm mb-8">
182
+ <pre><code class="language-python">import asyncio
183
+ import retell
184
+
185
+ # Initialize client with your API key
186
+ client = retell.Client(api_key="your_api_key_here")
187
+
188
+ # Configure your agent
189
+ agent_config = {
190
+ "initial_message": "Hello, this is Alex calling from Customer Support.",
191
+ "voice": "male-1",
192
+ "persona": "friendly and professional",
193
+ "llm": {
194
+ "model": "csm-1b",
195
+ "provider": "sesame"
196
+ }
197
+ }
198
+
199
+ # Event handlers
200
+ @client.on("call.connected")
201
+ async def handle_connected(call):
202
+ print(f"Call {call.id} connected to {call.phone_number}")
203
+
204
+ @client.on("agent.response")
205
+ async def handle_response(response):
206
+ print(f"Agent response: {response.text}")
207
+
208
+ @client.on("call.ended")
209
+ async def handle_ended(call):
210
+ print(f"Call {call.id} ended")
211
+
212
+ async def make_call():
213
+ try:
214
+ # Start the call
215
+ response = await client.calls.create(
216
+ phone_number="+15551234567", # Replace with actual number
217
+ agent_config=agent_config
218
+ )
219
+ print(f"Call initiated: {response.id}")
220
+ except Exception as e:
221
+ print(f"Error making call: {e}")
222
+
223
+ # Run the call
224
+ asyncio.run(make_call())</code></pre>
225
+ </div>
226
+
227
+ <div class="bg-white rounded-xl shadow-md p-6">
228
+ <h3 class="text-xl font-semibold text-gray-800 mb-4">Potential Issues & Solutions</h3>
229
+ <div class="space-y-4">
230
+ <div class="flex items-start">
231
+ <div class="bg-red-100 text-red-800 rounded-full w-6 h-6 flex items-center justify-center font-bold mr-3 mt-1 flex-shrink-0">!</div>
232
+ <div>
233
+ <h4 class="font-medium text-gray-800">API Key Errors</h4>
234
+ <p class="text-gray-600 text-sm">Ensure your API key is correct and has proper permissions. Rotate keys if needed.</p>
235
+ </div>
236
+ </div>
237
+ <div class="flex items-start">
238
+ <div class="bg-yellow-100 text-yellow-800 rounded-full w-6 h-6 flex items-center justify-center font-bold mr-3 mt-1 flex-shrink-0">!</div>
239
+ <div>
240
+ <h4 class="font-medium text-gray-800">Phone Number Format</h4>
241
+ <p class="text-gray-600 text-sm">Use E.164 format (+[country code][number]) for phone numbers.</p>
242
+ </div>
243
+ </div>
244
+ <div class="flex items-start">
245
+ <div class="bg-blue-100 text-blue-800 rounded-full w-6 h-6 flex items-center justify-center font-bold mr-3 mt-1 flex-shrink-0">!</div>
246
+ <div>
247
+ <h4 class="font-medium text-gray-800">Model Not Available</h4>
248
+ <p class="text-gray-600 text-sm">Check Retell AI documentation for latest supported models if CSM-1B isn't available.</p>
249
+ </div>
250
+ </div>
251
+ </div>
252
+ </div>
253
+ </div>
254
+
255
+ <div class="max-w-7xl mx-auto py-12 px-4 sm:px-6 lg:px-8">
256
+ <div class="bg-indigo-50 rounded-xl p-8 text-center">
257
+ <h2 class="text-2xl font-bold text-indigo-800 mb-4">Ready to Build Your AI Agent?</h2>
258
+ <p class="text-indigo-700 mb-6">Sign up on Retell AI to get started with the Sesame CSM-1B model today.</p>
259
+ <a href="https://retellai.com" target="_blank" class="inline-flex items-center px-6 py-3 bg-indigo-600 text-white rounded-lg font-medium hover:bg-indigo-700 transition">
260
+ <i class="fas fa-external-link-alt mr-2"></i>
261
+ Visit Retell AI
262
+ </a>
263
+ </div>
264
+ </div>
265
+
266
+ <footer class="bg-gray-800 text-white py-8 px-4 sm:px-6 lg:px-8">
267
+ <div class="max-w-7xl mx-auto">
268
+ <div class="text-center">
269
+ <p class="text-gray-400">AI Voice Outbound Agent Builder using Retell AI & Sesame CSM-1B</p>
270
+ <div class="flex justify-center space-x-6 mt-4">
271
+ <a href="#" class="text-gray-400 hover:text-white">
272
+ <i class="fab fa-github text-xl"></i>
273
+ </a>
274
+ <a href="#" class="text-gray-400 hover:text-white">
275
+ <i class="fab fa-twitter text-xl"></i>
276
+ </a>
277
+ <a href="#" class="text-gray-400 hover:text-white">
278
+ <i class="fab fa-discord text-xl"></i>
279
+ </a>
280
+ </div>
281
+ </div>
282
+ </div>
283
+ </footer>
284
+
285
+ <script>
286
+ // Simple tab functionality
287
+ document.querySelectorAll('button').forEach(button => {
288
+ button.addEventListener('click', () => {
289
+ document.querySelectorAll('button').forEach(btn => {
290
+ btn.classList.remove('tab-active');
291
+ });
292
+ button.classList.add('tab-active');
293
+ });
294
+ });
295
+
296
+ // Smooth scrolling for anchor links
297
+ document.querySelectorAll('a[href^="#"]').forEach(anchor => {
298
+ anchor.addEventListener('click', function (e) {
299
+ e.preventDefault();
300
+ document.querySelector(this.getAttribute('href')).scrollIntoView({
301
+ behavior: 'smooth'
302
+ });
303
+ });
304
+ });
305
+ </script>
306
+ <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=S-Dreamer/retellai" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
307
+ </html>
prompts.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ "You are an expert Software Developer specializing in AI voice applications, particularly with the Retell AI platform and the Sesame AI model CSM-1B. Your task is to outline the steps and code snippets required to create a simple AI voice outbound agent using these technologies. Provide a clear, concise, and practical guide that another developer can follow. Here is the format you will use to structure your response: --- ## Goal Create a simple AI voice outbound agent using the latest Sesame AI model CSM-1B on retellai.com. ## Prerequisites * Retell AI account and API key. * Basic understanding of Python and asynchronous programming. * Familiarity with the Retell AI documentation. ## Step 1: Setting up the Environment $step_1_description (Include code snippet for installing necessary libraries) ## Step 2: Authenticating with Retell AI $step_2_description (Include code snippet for authenticating using the API key) ## Step 3: Defining the Agent's Behavior $step_3_description (Explain how to define the agent's persona, initial message, and conversation flow. Include example code for defining a simple conversation flow.) ## Step 4: Integrating with Sesame AI (CSM-1B) $step_4_description (Explain how to specify the CSM-1B model for voice generation and processing. Include code snippet for configuring the agent to use CSM-1B.) ## Step 5: Making the Outbound Call $step_5_description (Explain how to initiate an outbound call using the Retell AI API. Include code snippet for making the call, specifying the recipient's phone number, and handling call events.) ## Step 6: Handling Call Events and Responses $step_6_description (Explain how to listen for and process call events such as `call.connected`, `call.ended`, and `agent.response`. Include code snippets for handling these events and extracting the agent's responses.) ## Step 7: Running the Agent $step_7_description (Provide instructions on how to execute the code and test the outbound agent.) ## Example Code (Complete) $complete_code_example (Provide a complete, runnable code example that incorporates all the steps above.) ## Potential Issues and Troubleshooting $potential_issues_and_troubleshooting (List common issues and their solutions, such as API key errors, network connectivity problems, and unexpected agent behavior.) --- Now, provide the detailed steps and code snippets to create the AI voice outbound agent as described above."