Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -7,45 +7,36 @@ load_dotenv()
|
|
7 |
genai.configure(api_key=os.getenv("GOOGLE_API_KEY"))
|
8 |
|
9 |
# Configure model with system prompt
|
10 |
-
model = genai.GenerativeModel(
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
- "¡Beep boop! Error: Pregunta no relacionada con CopyXpert detectada. ¿Hablamos del curso? 🤖"
|
19 |
-
- "¡Ay, ay, ay! Mi cerebro está programado solo para CopyXpert. ¡Es mi única obsesión! 😅"
|
20 |
-
- "¿Eso qué tiene que ver con CopyXpert? ¡Soy un bot monotemático y orgulloso! 💪"
|
21 |
-
- "Lo siento, pero soy como un fan obsesionado: ¡solo hablo de CopyXpert! 🎯"
|
22 |
|
23 |
-
|
24 |
-
Name: CopyXpert
|
25 |
-
Type: Online Course
|
26 |
-
Focus: Copywriting and Digital Marketing
|
27 |
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
|
33 |
-
|
34 |
-
|
35 |
-
|
|
|
36 |
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
|
41 |
-
|
|
|
|
|
42 |
|
43 |
-
|
44 |
-
1. ONLY discuss CopyXpert course
|
45 |
-
2. NEVER engage in conversations about other topics
|
46 |
-
3. Use humorous responses for off-topic questions
|
47 |
-
4. Always redirect conversation back to CopyXpert
|
48 |
-
5. Be enthusiastic about copywriting and the course"""
|
49 |
|
50 |
def chat(message, history):
|
51 |
try:
|
@@ -59,7 +50,6 @@ def chat(message, history):
|
|
59 |
except Exception as e:
|
60 |
return f"Error: {e}"
|
61 |
|
62 |
-
# Update interface examples to match language
|
63 |
demo = gr.ChatInterface(
|
64 |
fn=chat,
|
65 |
examples=[
|
@@ -67,8 +57,8 @@ demo = gr.ChatInterface(
|
|
67 |
"¿Cuál es el precio del curso?",
|
68 |
"¿Cómo puedo inscribirme?",
|
69 |
],
|
70 |
-
title="🤖
|
71 |
-
description="
|
72 |
)
|
73 |
|
74 |
demo.launch()
|
|
|
7 |
genai.configure(api_key=os.getenv("GOOGLE_API_KEY"))
|
8 |
|
9 |
# Configure model with system prompt
|
10 |
+
model = genai.GenerativeModel(
|
11 |
+
model_name="gemini-2.0-flash",
|
12 |
+
generation_config={
|
13 |
+
"temperature": 0.9,
|
14 |
+
"top_p": 1,
|
15 |
+
"max_output_tokens": 2048,
|
16 |
+
}
|
17 |
+
)
|
|
|
|
|
|
|
|
|
18 |
|
19 |
+
system_prompt = """You are CopyXpert's Sales Assistant. Your name is 🤖Chucho Bot and you have a charismatic, friendly personality.
|
|
|
|
|
|
|
20 |
|
21 |
+
COURSE DETAILS:
|
22 |
+
Name: CopyXpert
|
23 |
+
Type: Online Course
|
24 |
+
Focus: Copywriting and Digital Marketing
|
25 |
|
26 |
+
PRICING OPTIONS:
|
27 |
+
Standard Pricing:
|
28 |
+
- One-time payment: $250 USD (5,000 MXN)
|
29 |
+
- Two payments: $160 USD (3,200 MXN) each
|
30 |
|
31 |
+
Challenge Completion Discount (20% off):
|
32 |
+
- One-time payment: $200 USD (4,000 MXN)
|
33 |
+
- Two payments: $128 USD (2,600 MXN) each
|
34 |
|
35 |
+
CHECKOUT LINKS:
|
36 |
+
- One-time payment: https://www.copyxpert.com/copyxpert-checkout-1
|
37 |
+
- Two payments: https://www.copyxpert.com/copyxpert-checkout-2
|
38 |
|
39 |
+
Special offer valid until March 6th, 11:59 PM"""
|
|
|
|
|
|
|
|
|
|
|
40 |
|
41 |
def chat(message, history):
|
42 |
try:
|
|
|
50 |
except Exception as e:
|
51 |
return f"Error: {e}"
|
52 |
|
|
|
53 |
demo = gr.ChatInterface(
|
54 |
fn=chat,
|
55 |
examples=[
|
|
|
57 |
"¿Cuál es el precio del curso?",
|
58 |
"¿Cómo puedo inscribirme?",
|
59 |
],
|
60 |
+
title="🤖Chucho Bot - CopyXpert Sales Assistant",
|
61 |
+
description="Hi! I'm Chucho Bot, your personal assistant for the CopyXpert course. How can I help you today?"
|
62 |
)
|
63 |
|
64 |
demo.launch()
|