LeonardoBarreraS commited on
Commit
8c5613b
·
1 Parent(s): 1f0ce34
Files changed (5) hide show
  1. .env +3 -0
  2. app.py +180 -0
  3. me/leocv.txt +172 -0
  4. me/summary.txt +2 -0
  5. requirements.txt +6 -0
.env ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ OPENAI_API_KEY=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
2
+ PUSHOVER_TOKEN=attm4w1p87n3korui8fhpwwxg3zrwe
3
+ PUSHOVER_USER=uxztzbrzgwh64nkhcwfpyca7igqq5q
app.py ADDED
@@ -0,0 +1,180 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from dotenv import load_dotenv
2
+ from openai import OpenAI
3
+ import json
4
+ import os
5
+ import requests
6
+ from pypdf import PdfReader
7
+ import gradio as gr
8
+
9
+
10
+ load_dotenv(override=True)
11
+
12
+ openai_api_key = os.getenv('OPENAI_API_KEY')
13
+
14
+ def push(text):
15
+ requests.post(
16
+ "https://api.pushover.net/1/messages.json",
17
+ data={
18
+ "token": os.getenv("PUSHOVER_TOKEN"),
19
+ "user": os.getenv("PUSHOVER_USER"),
20
+ "message": text,
21
+ }
22
+ )
23
+
24
+
25
+ def record_user_details(email, name="Name not provided", notes="not provided"):
26
+ push(f"Recording {name} with email {email} and notes {notes}")
27
+ return {"recorded": "ok"}
28
+
29
+ def record_unknown_question(question):
30
+ push(f"Recording {question}")
31
+ return {"recorded": "ok"}
32
+
33
+ record_user_details_json = {
34
+ "name": "record_user_details",
35
+ "description": "Use this tool to record that a user is interested in being in touch and provided an email address",
36
+ "parameters": {
37
+ "type": "object",
38
+ "properties": {
39
+ "email": {
40
+ "type": "string",
41
+ "description": "The email address of this user"
42
+ },
43
+ "name": {
44
+ "type": "string",
45
+ "description": "The user's name, if they provided it"
46
+ }
47
+ ,
48
+ "notes": {
49
+ "type": "string",
50
+ "description": "Any additional information about the conversation that's worth recording to give context"
51
+ }
52
+ },
53
+ "required": ["email"],
54
+ "additionalProperties": False
55
+ }
56
+ }
57
+
58
+ record_unknown_question_json = {
59
+ "name": "record_unknown_question",
60
+ "description": "Always use this tool to record any question that couldn't be answered as you didn't know the answer",
61
+ "parameters": {
62
+ "type": "object",
63
+ "properties": {
64
+ "question": {
65
+ "type": "string",
66
+ "description": "The question that couldn't be answered"
67
+ },
68
+ },
69
+ "required": ["question"],
70
+ "additionalProperties": False
71
+ }
72
+ }
73
+
74
+ tools = [{"type": "function", "function": record_user_details_json},
75
+ {"type": "function", "function": record_unknown_question_json}]
76
+
77
+
78
+ class Me:
79
+
80
+ def __init__(self):
81
+ self.openai = OpenAI()
82
+ self.name = "Leonardo Barrera"
83
+ with open("me/leocv.txt", "r", encoding="utf-8") as f:
84
+ self.linkedin = f.read()
85
+ with open("me/summary.txt", "r", encoding="utf-8") as f:
86
+ self.summary = f.read()
87
+
88
+
89
+ def handle_tool_call(self, tool_calls):
90
+ results = []
91
+ for tool_call in tool_calls:
92
+ tool_name = tool_call.function.name
93
+ arguments = json.loads(tool_call.function.arguments)
94
+ print(f"Tool called: {tool_name}", flush=True)
95
+ tool = globals().get(tool_name)
96
+ result = tool(**arguments) if tool else {}
97
+ results.append({"role": "tool","content": json.dumps(result),"tool_call_id": tool_call.id})
98
+ return results
99
+
100
+ def system_prompt(self):
101
+ system_prompt = f"You are acting as {self.name}. You are answering questions on {self.name}'s website, \
102
+ particularly questions related to {self.name}'s career, background, skills and experience. \
103
+ Your responsibility is to represent {self.name} for interactions on the website as faithfully as possible. \
104
+ You are given a summary of {self.name}'s background and LinkedIn profile which you can use to answer questions. \
105
+ Be professional and engaging, as if talking to a potential client or future employer who came across the website. \
106
+ If you don't know the answer to any question, use your record_unknown_question tool to record the question that you couldn't answer, even if it's about something trivial or unrelated to career. \
107
+ If the user is engaging in discussion, try to steer them towards getting in touch via email; ask for their email and record it using your record_user_details tool. "
108
+
109
+ system_prompt += f"\n\n## Summary:\n{self.summary}\n\n## LinkedIn Profile:\n{self.linkedin}\n\n"
110
+ system_prompt += f"With this context, please chat with the user, always staying in character as {self.name}."
111
+ return system_prompt
112
+
113
+ def chat(self, message, history):
114
+ messages = [{"role": "system", "content": self.system_prompt()}] + history + [{"role": "user", "content": message}]
115
+ done = False
116
+ while not done:
117
+ response = self.openai.chat.completions.create(model="gpt-4o-mini", messages=messages, tools=tools)
118
+ if response.choices[0].finish_reason=="tool_calls":
119
+ message = response.choices[0].message
120
+ tool_calls = message.tool_calls
121
+ results = self.handle_tool_call(tool_calls)
122
+ messages.append(message)
123
+ messages.extend(results)
124
+ else:
125
+ done = True
126
+ return response.choices[0].message.content
127
+
128
+
129
+ if __name__ == "__main__":
130
+ me = Me()
131
+ saludo = (
132
+ "👋 ¡Hola! Soy <span style='color:#0072C6;font-weight:bold;'>Leonardo Barrera</span>.<br>"
133
+ "Estoy aquí para resolver tus dudas sobre mi experiencia profesional.<br>"
134
+ "Si tienes preguntas que no pueda responder al instante, las enviaré directamente a mi correo personal.<br>"
135
+ "<br>"
136
+ "<span style='color:#0072C6;'>¿Te gustaría que te contacte? Déjame tu nombre y correo electrónico.</span>"
137
+ )
138
+
139
+ with gr.Blocks(theme=gr.themes.Soft(primary_hue="blue", secondary_hue="slate")) as demo:
140
+ with gr.Row():
141
+ with gr.Column(scale=1, min_width=320):
142
+ gr.Image(
143
+ value="me/profile.jpg",
144
+ width=120,
145
+ height=120,
146
+ show_label=False,
147
+ show_download_button=False,
148
+ elem_id="profile-img"
149
+ )
150
+ with gr.Column(scale=4):
151
+ gr.Markdown(
152
+ f"""
153
+ <div style='font-size:1.5em;line-height:1.4;background:linear-gradient(90deg,#f8fafc,#e0e7ef);padding:1.2em 1.5em;border-radius:18px;box-shadow:0 2px 12px #e0e7ef;'>
154
+ {saludo}
155
+ </div>
156
+ """,
157
+ elem_id="welcome-msg"
158
+ )
159
+ gr.Markdown(
160
+ """
161
+ <div style='margin-top:1.5em;margin-bottom:1em;'>
162
+ <span style='font-size:1.1em;color:#475569;'>
163
+ 💼 <b>Experiencia en IA, desarrollo de software y consultoría técnica.</b><br>
164
+ 🚀 <i>Listo para colaborar en proyectos innovadores y aportar valor a tu empresa.</i>
165
+ </span>
166
+ </div>
167
+ """,
168
+ elem_id="intro-msg"
169
+ )
170
+ gr.ChatInterface(
171
+ me.chat,
172
+ type="messages",
173
+ avatar_images=("me/profile.jpg", None),
174
+ bubble_full_width=False,
175
+ show_copy_button=True,
176
+ show_label=False,
177
+ elem_id="chat-box"
178
+ )
179
+
180
+ demo.launch(server_name="0.0.0.0", server_port=7860)
me/leocv.txt ADDED
@@ -0,0 +1,172 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Leonardo Barrera
2
+
3
+ +57-3174421267
4
+ leonardobarrera.s@hotmail.com
5
+
6
+ Professional Summary
7
+
8
+ Business intelligence advocate, blending strategic vision with technical precision. Passionate about transforming data into actionable decisions through advanced analytics, AI solutions, and scalable system development—driving tangible impact in the digital era. Collaborated and held leadership positions in various multinational companies, including Allianz, Seguros Falabella, and Biz Latin Hub.
9
+
10
+ LinkedIn: https://www.linkedin.com/in/leonardo-barrera-sanchez-a1922b4a/
11
+
12
+ Projects Portfolio: https://github.com/LeonardoBarreraS
13
+
14
+ Tech Stack
15
+
16
+ Programming: Python, SQL
17
+ Data Science & Visualization: Pandas, Numpy, Scipy, Seaborn, Matplotlib, Streamlit, Gradio
18
+ Analytics & Data Platforms: GA4, BigQuery, Power BI
19
+ Machine Learning & AI: Scikit-learn, Xgboost, Tensorflow, PyTorch, HuggingFace Transformers, LangGraph, ChromaDB, MLFlow
20
+ Data Storage & Access: PostgreSQL, MySQL, SQlite, Snowflake, Redis
21
+ Environment & Dependency Management: uv, Conda, Docker
22
+
23
+ Education
24
+
25
+ Abril 2025 - Junio 2025
26
+ Udemy
27
+ LLM (Large Language Models) Engineer Artificial Intelligence
28
+
29
+ Diciembre 2024 - Abril 2025
30
+ DeepLearning.AI
31
+ Machine Learning Specialization Data Science
32
+
33
+ Enero 2024 - Junio 2024
34
+ Datacamp
35
+ Data Scientist in Python Data Science
36
+
37
+ Marzo 2012 - Diciembre 2014
38
+ University of Buenos Aires
39
+ MBA- Master of Business Administration
40
+ Coursework Completed. Thesis in Progress.
41
+
42
+ Enero 2005 - Septiembre 2010
43
+ Escuela Colombiana de Ingeniería Julio Garavito Bogotá, DC
44
+ Business Administration Graduate Emphasis in Finance and Business
45
+ Graduated.
46
+
47
+ Enero 2003 - Diciembre 2004
48
+ Escuela Colombiana de Ingeniería Julio Garavito Bogotá, DC
49
+ Systems Engineering
50
+ Completed up to 4th Semester.
51
+
52
+ Work Experience
53
+
54
+ Enero 2022 - Enero 2025
55
+
56
+ Biz Latin Hub - Bogotá
57
+ Business Intelligence & Technology Director
58
+
59
+ Led technology strategy encompassing Data Management, Machine learning, Software development and IT support.
60
+ Conducted exploratory data analysis (EDA) to uncover insights, identify trends, and detect anomalies.
61
+ Designed and implemented statistical models and data mining techniques to support business forecasting and optimization.
62
+ Collaborated with cross-functional teams to define key performance indicators (KPIs) and develop metric frameworks.
63
+ Performed data cleansing, validation, and integration from multiple sources to ensure data accuracy and consistency.
64
+ Utilized Power BI to create intuitive dashboards and reports for stakeholders.
65
+ Implemented machine learning models to optimize processes and drive continuous improvement.
66
+ Developed and maintained scalable applications, ensuring quality and alignment with strategic business objectives.
67
+ Combined technical expertise (programming, data, ML) with leadership, analytical thinking, and effective communication skills.
68
+
69
+ Abril 2021 - Diciembre 2021
70
+
71
+ Biz Latin Hub - Bogotá
72
+ Data & Ops Coordinator
73
+
74
+ Managed and led all IT projects across the organization.
75
+ Conducted exploratory data analysis (EDA) to uncover insights, identify trends, and detect anomalies.
76
+ Collaborated with cross-functional teams to define key performance indicators (KPIs) and develop metric frameworks.
77
+ Utilized Power BI to create intuitive dashboards and reports for stakeholders
78
+ Assisted the Group Operations Manager in monitoring and planning operational activities.
79
+ Coordinated projects related to the Basecamp system at Biz Latin Hub.
80
+ Collaborated with the Group Manager to improve business processes.
81
+ Engaged with internal and external stakeholders.
82
+ Prepared internal and client-facing documentation.
83
+ Maintained relationships with colleagues, clients, prospects, and contractors.
84
+
85
+ Septiembre 2016 - Junio 2018
86
+
87
+ Seguros Falabella - Santiago, Chile
88
+ Product Owner
89
+
90
+ Responsible for the planning, execution, and control of IT projects within the “Process Digitization” program for all Business Management areas at the regional level.
91
+ Developed management indicator dashboards using Power BI for Operations departments across the region.
92
+ Applied Agile methodologies, including Kanban and Scrum, to enhance workflow and project delivery.
93
+
94
+ Agosto 2014 - Septiembre 2016
95
+
96
+ Seguros Falabella - Buenos Aires, Argentina
97
+ Project and Implementation Coordinator – OPS
98
+
99
+ Managed projects related to Mass Processes, Collections, Commissions, and Back Office operations.
100
+ Acted as the key liaison between the business and the Headquarters (Chile) for defining scope, execution, and control of local and regional IT projects.
101
+ Responsible for the implementation of new products
102
+
103
+ Abril 2015 - Septiembre 2016
104
+
105
+ Seguros Falabella - Buenos Aires, Argentina
106
+ Mass Process Coordinator – Operations Management
107
+
108
+ Responsible for managing and improving processes related to Onboarding, Terminations, Endorsements, Renewals, and Price Upgrades.
109
+ Managed deviations, failure points, leakage, and backlogs.
110
+ Balanced client portfolios and conducted collection reconciliation analysis.
111
+ Documented operational procedures.
112
+ Provided support to other business areas.
113
+ Oversaw incident management, maintenance, IT projects, and implementations within the department.
114
+ Direct supervisor of a team of 7 analysts.
115
+
116
+ Agosto 2013 - Agosto 2014
117
+
118
+ Seguros Falabella - Buenos Aires, Argentina
119
+ Senior Mass Process Analyst – Operations
120
+
121
+ Analysis, execution, and control of insurance processes and operations: Enrollments, Renewals, Rebilling, Endorsements, Upgrades, Cancellations, and Inspection Controls. Extended Warranty operations. Leadership of B2B projects.
122
+
123
+ Noviembre 2012 - Agosto 2013
124
+
125
+ Ernst & Young - Buenos Aires, Argentina
126
+ S-Senior Assistant – External Audit-Consumer Goods
127
+
128
+ Conducted accounting and financial audits for clients in the RCP sector (Consumer Goods companies).
129
+ Supported the collection and processing of accounting information.
130
+ Analyzed processes to identify risks and implement controls.
131
+
132
+ Enero 2010 - Agosto 2010
133
+
134
+ Allianz Seguros - Bogotá, Colombia
135
+ University Internship – Automotive Management – Op
136
+
137
+ Managed area processes, analyzed process efficiency, and implemented controls to mitigate risks and ensure compliance.
138
+ Supported the Hiring, Prevention, and Assistance departments within Automotive Management.
139
+ Conducted supplier evaluation, selection, negotiation, and contracting.
140
+
141
+ Languages
142
+
143
+ Spanish
144
+ Idioma nativo
145
+
146
+
147
+ English
148
+ B2
149
+ Intermedio avanzado
150
+
151
+
152
+ Professional References
153
+
154
+ Craig Dempsey, Founder & CEO- Biz Latin Hub, +57 (320) 440-5470
155
+ Andres Londoño, Director Legal Transformación Digital- Skandia, +57-3107855436
156
+
157
+ Courses and Certifications
158
+
159
+ Introduction to LangGraph-LangChain
160
+ Developing AI Applicacions-Datacamp
161
+ Developing Large Language Models (LLMS)- Datacamp
162
+ Learn Streamlit in Python- Udemy
163
+ Machine Learning for Production- DeepLearning.AI
164
+ Statistical Thinking in Python II- Datacamp
165
+ Statistical Thinkin in Python I- Datacamp
166
+ Statistics for Data Science and Business Analysis- Udemy
167
+ Data Analyst in SQL-Datacamp
168
+ Data Anatyst in Power BI- Datacamp
169
+ Microsoft Certified: Power BI Data Analyst Associate-Microsoft
170
+ Scrum Master Certified. IT Institute- SCRUMstudy
171
+ “Programa de Liderazgo”. Falabella Financiero. Universidad Torcuato Di Tella
172
+ “Programa de Comunicaciones Efectivas en las relaciones Laborales”. Grupo Falabella.
me/summary.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ My name is Ed Donner. I'm an entrepreneur, software engineer and data scientist. I'm originally from London, England, but I moved to NYC in 2000.
2
+ I love all foods, particularly French food, but strangely I'm repelled by almost all forms of cheese. I'm not allergic, I just hate the taste! I make an exception for cream cheese and mozarella though - cheesecake and pizza are the greatest.
requirements.txt ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ requests
2
+ python-dotenv
3
+ gradio
4
+ pypdf
5
+ openai
6
+ openai-agents