rushchatbot 1.6.7
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/INTEGRATION.md +559 -0
- package/index.html +13 -0
- package/package/INTEGRATION.md +717 -0
- package/package/README.md +717 -0
- package/package/package-lock.json +3221 -0
- package/package/package.json +101 -0
- package/package/src/cli/index.ts +94 -0
- package/package/src/client/ChatWidget.tsx +163 -0
- package/package/src/client.ts +2 -0
- package/package/src/core/RushChatbot.ts +192 -0
- package/package/src/index.ts +5 -0
- package/package/src/server/guardrails.ts +107 -0
- package/package/src/server/index.ts +210 -0
- package/package/src/server/matcher.ts +140 -0
- package/package/src/shared/types.ts +58 -0
- package/package/src/shims-vue.d.ts +5 -0
- package/package/src/vanilla/index.ts +302 -0
- package/package/src/vanilla.ts +3 -0
- package/package/src/vue/ChatWidget.vue +198 -0
- package/package/src/vue.ts +3 -0
- package/package/src/vue2/ChatWidget.vue +204 -0
- package/package/src/vue2.ts +3 -0
- package/package/tsconfig.json +19 -0
- package/package/vite.config.ts +86 -0
- package/package.json +35 -0
- package/public/favicon.svg +1 -0
- package/public/icons.svg +24 -0
- package/server/data/analytics.json +795 -0
- package/server/data/chatbot.config.json +26 -0
- package/server/data/questions.json +238 -0
- package/server/data/questions.tl.json +182 -0
- package/server/index.ts +11 -0
- package/server/lib/guardrails.ts +107 -0
- package/server/lib/matcher.ts +140 -0
- package/server/routes/chat.ts +180 -0
- package/server/tsconfig.json +11 -0
- package/src/App.css +184 -0
- package/src/App.tsx +135 -0
- package/src/assets/hero.png +0 -0
- package/src/assets/react.svg +1 -0
- package/src/assets/vite.svg +1 -0
- package/src/components/ChatWidget.tsx +417 -0
- package/src/components/QuestionTree.tsx +57 -0
- package/src/hooks/useChatData.ts +49 -0
- package/src/index.css +111 -0
- package/src/main.tsx +10 -0
- package/src/types/index.ts +40 -0
- package/tsconfig.app.json +26 -0
- package/tsconfig.json +7 -0
- package/tsconfig.node.json +23 -0
- package/vite.config.ts +7 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"branding": {
|
|
3
|
+
"title": "FinexChat",
|
|
4
|
+
"subtitle": "How can we help you today?",
|
|
5
|
+
"avatarUrl": "/logo.png",
|
|
6
|
+
"theme": {
|
|
7
|
+
"primaryColor": "#4F46E5",
|
|
8
|
+
"backgroundColor": "#FFFFFF",
|
|
9
|
+
"userBubbleColor": "#4F46E5",
|
|
10
|
+
"botBubbleColor": "#F3F4F6",
|
|
11
|
+
"textColor": "#111827",
|
|
12
|
+
"fontFamily": "Inter, sans-serif"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"n8n": {
|
|
16
|
+
"webhookUrl": "https://webhook.n8n.loyaltyco.xyz/webhook/7a1b67a1-31da-4b7b-a889-a574202497b5",
|
|
17
|
+
"timeoutMs": 55000
|
|
18
|
+
},
|
|
19
|
+
"chat": {
|
|
20
|
+
"welcomeMessage": "Welcome to the FINEX Assistant!\n\nI am here to help you navigate information about the Financial Executives Institute of the Philippines (FINEX).\n\nSelect topics below",
|
|
21
|
+
"fallbackMessage": "Let me look that up for you...",
|
|
22
|
+
"matchThreshold": 0.4,
|
|
23
|
+
"showPreQuestionsOnStart": true,
|
|
24
|
+
"language": "en"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "q1",
|
|
4
|
+
"question": "About FINEX & Mission",
|
|
5
|
+
"answer": "Formally organized on January 15, 1968, FINEX gives its members the latest developments in business finance and management through its various services. Main thrusts include national advocacy, professional development, and membership engagement. FINEX is affiliated with the International Association of Financial Executives, Inc. (IAFEI).",
|
|
6
|
+
"subquestions": [
|
|
7
|
+
{
|
|
8
|
+
"id": "q1a",
|
|
9
|
+
"question": "What is FINEX?",
|
|
10
|
+
"answer": "Formally organized on January 15, 1968, FINEX has undertaken activities geared towards the fulfilment of the objectives for which it was established. It has continuously given its more than 700 members the latest developments in business finance and management through its various services. Its main thrusts include national advocacy, professional development, and membership engagement. FINEX is also affiliated with the International Association of Financial Executives, Inc. (IAFEI), a world-wide federation of finance institutes.",
|
|
11
|
+
"subquestions": []
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"id": "q1b",
|
|
15
|
+
"question": "What is the FINEX Mission & Vision?",
|
|
16
|
+
"answer": "Vision: To be the country's leading organization of financial executives, practitioners, and managers pursuing professional, organizational, and national growth and success.\nMission:\n- To constantly conduct research on, develop, improve, and disseminate, among its members, knowledge, expertise, skills, best practices, and relevant policies and principles in the field of finance management and practice.\n- To assist the government in formulating and implementing appropriate policies and legislation involving business and finance in order to spur national development.\n- To encourage fellowship in a community of finance professionals, and assist in the training, education, and development of present and future financial executives, practitioners, and managers.\n- To encourage and develop greater civic, social, and environmental consciousness among its members and the general public, and to promote and contribute to the upliftment and amelioration of the marginalized and underprivileged sectors of society.",
|
|
17
|
+
"subquestions": []
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"id": "q1c",
|
|
21
|
+
"question": "What is FINEX's history?",
|
|
22
|
+
"answer": "The Charter group or Founders of FINEX called for the development of Financial Management in the country. There was a need to have a forum to discuss about the financial executive's functions and to learn about the financial concepts that were fast accumulating and spreading around in many publications.\n\nThe Charter group thus called for the establishment of an association for financial executives to promote the professional interest of \"finance professionals\" as distinguished from accountants.\n\nHence, on January 15, 1968, FINEX was registered with the SEC as a non-stock, non-profit organization with 12 incorporators. The selection of members was based on strict criteria and must have the rank of a CFO or a chief executive. It is for financial executives who matter and can make a difference.",
|
|
23
|
+
"subquestions": []
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"id": "q2",
|
|
29
|
+
"question": "Membership & Benefits",
|
|
30
|
+
"answer": "FINEX offers membership to Regular, Associate, and Student members, providing benefits through Recognition, Development, Networking, and Advocacy.",
|
|
31
|
+
"subquestions": [
|
|
32
|
+
{
|
|
33
|
+
"id": "q2a",
|
|
34
|
+
"question": "Who can join FINEX?",
|
|
35
|
+
"answer": "→ Regular members: Generally CFOs, chief executives, and senior finance executives/practitioners.\n→ Associate members: Mid-level managers with potential to become senior executives.\n→ Students: FINEX, through the FINEX Research and Development Foundation, also has Junior FINEX (JFINEX), which serves business and finance college students through partner schools and universities.",
|
|
36
|
+
"subquestions": []
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"id": "q2b",
|
|
40
|
+
"question": "What are the benefits of becoming a member?",
|
|
41
|
+
"answer": "→ RECOGNITION: Institutional representation provides members with enhanced standing among regulators, government agencies, and policymakers. As a trusted partner in economic governance, FINEX ensures its members are recognized as contributors to the country's financial integrity and national stewardship.\n→ DEVELOPMENT: Access to latest concepts, programs, policies/practices in business and finance through development programs, publications, and projects.\n→ NETWORKING: Access to and collaboration with an active community of senior financial executives, finance practitioners, and professionals who are entrepreneurs, CFOs/CEOs of top 1000 corporations, former and current government officials, and members of affiliate organizations.\n→ ADVOCACY: A premier platform for evidence-based policy engagement, enabling senior executives to lend their expertise to dialogues that shape financial legislation. Through this non-partisan channel, FINEX exerts constructive influence over capital formation and regulatory frameworks, ensuring the practical perspective of finance leaders is a fundamental component of national policy development.",
|
|
42
|
+
"subquestions": []
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"id": "q2c",
|
|
46
|
+
"question": "How do I apply for membership?",
|
|
47
|
+
"answer": "Where to inquire: For membership inquiries or to start your application process, visit the FINEX Become a Member Page or you may send your inquiries to finexadmin@finex.org.ph",
|
|
48
|
+
"subquestions": []
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"id": "q3",
|
|
54
|
+
"question": "FINEX Academy & Programs",
|
|
55
|
+
"answer": "FINEX Academy offers professional development programs including Capital Markets, Finance Leadership, Sustainability Reporting, and upcoming specialized masterclasses.",
|
|
56
|
+
"subquestions": [
|
|
57
|
+
{
|
|
58
|
+
"id": "q3a",
|
|
59
|
+
"question": "What courses does FINEX Academy offer?",
|
|
60
|
+
"answer": "FINEX Academy offers professional development programs in Capital Markets and Fixed Income Course, Finance Leadership Program (Senior, Executive, and Emerging), and Sustainability Reporting Masterclass Program. Soon, the FINEX Academy will offer the improved Digital Transformation Program, PPP Program, Risk Management Masterclass Program, and Governance and AMLA Program.",
|
|
61
|
+
"subquestions": []
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"id": "q3b",
|
|
65
|
+
"question": "What is the Capital Markets and Fixed Income Course?",
|
|
66
|
+
"answer": "The Capital Markets & Fixed Income Course is a FINEX Academy program that provides professionals, investors, and aspiring market experts with comprehensive knowledge of the Philippine capital markets, securities, regulations, risk management, and fixed-income investments.",
|
|
67
|
+
"subquestions": []
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"id": "q3c",
|
|
71
|
+
"question": "What is the Finance Leadership Program (Senior, Executive, and Emerging)?",
|
|
72
|
+
"answer": "The Finance Leadership Program is a masterclass that addresses the development needs of financial executives across six key themes: Leadership, Governance, Sustainability, Technology, Business Partnering, and People. Its three stages are the Emerging, Executive, and Senior Finance Leadership Programs. The Senior Leadership in Finance Program is designed for Chief Financial Officers, Chief Executive Officers, and their identified successors who are taking positions in the immediate future. The Executive Leadership in Finance Program is designed for Financial Controllers, Treasury Heads, and other Finance Executives who are 1-2 years away from the Chief Financial Officer position. The Emerging Leadership in Finance Program is designed for Finance practitioners who aspire to be in the Chief Financial Officer Position, needing to jumpstart their development for the next 3-5 years to their succession. Participants in this course will go through a development journey that leverages a deep and incisive analysis and application of the Four Faces of the CFO - Strategist, Catalyst, Steward, and Operator - at very senior levels of companies and organizations. These Four Faces are the criteria we use to select our annual CFO of the Year awardees. And these faces capture the diverse and evolving dimensions of the CFO role, shedding light on the critical areas where finance leaders can make a significant impact.",
|
|
73
|
+
"subquestions": []
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"id": "q3d",
|
|
77
|
+
"question": "What is the Sustainability Reporting Masterclass Program?",
|
|
78
|
+
"answer": "The SUSTAINABILITY REPORTING MASTERCLASS aims to help participants better understand the growing importance of sustainability and how it can be meaningfully integrated into organizations. Through engaging learning sessions and practical discussions, the program provides insights into sustainability principles, reporting standards, regulatory requirements, and leading business practices on integration. It also explores how Boards, management teams, sustainability officers, and their people can work together to develop and implement effective sustainability initiatives while meeting reporting and disclosure requirements. Designed to be both practical and relevant, the program encourages participants to apply sustainability concepts in ways that create long-term value for their organizations and stakeholders.",
|
|
79
|
+
"subquestions": []
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"id": "q3e",
|
|
83
|
+
"question": "What is the Digital Transformation Program?",
|
|
84
|
+
"answer": "This program is coming soon. Please stay tuned for more information and updates from FINEX.",
|
|
85
|
+
"subquestions": []
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"id": "q3f",
|
|
89
|
+
"question": "What is the PPP Program?",
|
|
90
|
+
"answer": "This program is coming soon. Please stay tuned for more information and updates from FINEX.",
|
|
91
|
+
"subquestions": []
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"id": "q3g",
|
|
95
|
+
"question": "What is the Risk Management Masterclass Program?",
|
|
96
|
+
"answer": "This program is coming soon. Please stay tuned for more information and updates from FINEX.",
|
|
97
|
+
"subquestions": []
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"id": "q3h",
|
|
101
|
+
"question": "What is the Governance and AMLA Program?",
|
|
102
|
+
"answer": "This program is coming soon. Please stay tuned for more information and updates from FINEX.",
|
|
103
|
+
"subquestions": []
|
|
104
|
+
}
|
|
105
|
+
]
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"id": "q4",
|
|
109
|
+
"question": "Awards & Major Events",
|
|
110
|
+
"answer": "FINEX hosts major annual events and recognitions including the ING-FINEX CFO of the Year Award, FINEX Week, sports/social gatherings, and monthly General Membership Meetings.",
|
|
111
|
+
"subquestions": [
|
|
112
|
+
{
|
|
113
|
+
"id": "q4a",
|
|
114
|
+
"question": "What is the ING-FINEX CFO of the Year Award?",
|
|
115
|
+
"answer": "The ING-FINEX CFO of the Year Award is an annual recognition that honors outstanding CFOs in the Philippines for excellence in financial leadership, strategic decision-making, and contribution to their organizations.",
|
|
116
|
+
"subquestions": []
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"id": "q4b",
|
|
120
|
+
"question": "What is FINEX Week?",
|
|
121
|
+
"answer": "Every first week of October, the Financial Executives Institute of the Philippines (FINEX) celebrates the annual FINEX Week with various activities revolving around a central theme. It's a world-class week-long conference with relevant topics and high-caliber speakers.",
|
|
122
|
+
"subquestions": []
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"id": "q4c",
|
|
126
|
+
"question": "What sports or fellowship events are hosted?",
|
|
127
|
+
"answer": "FINEX hosts various sports, social, and fellowship activities for its members, including golf, pickleball, bowling, padel, arts and cultural activities, Family Day, and social gatherings. These activities are designed to provide opportunities for networking, camaraderie, and member engagement.",
|
|
128
|
+
"subquestions": []
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"id": "q4d",
|
|
132
|
+
"question": "General Membership Meeting",
|
|
133
|
+
"answer": "General Membership Meetings are monthly meetings of the FINEX Institute organized and managed by the General Membership Committee. The committee also coordinates with other committees regarding their participation during these meetings.",
|
|
134
|
+
"subquestions": []
|
|
135
|
+
}
|
|
136
|
+
]
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"id": "q5",
|
|
140
|
+
"question": "Publications & Resources",
|
|
141
|
+
"answer": "FINEX produces various journals, handbooks, sustainability reports, and member-contributed newspaper opinion pieces.",
|
|
142
|
+
"subquestions": [
|
|
143
|
+
{
|
|
144
|
+
"id": "q5a",
|
|
145
|
+
"question": "Where can I read FINEX articles & journals?",
|
|
146
|
+
"answer": "You can read FINEX articles and publications through the official FINEX website, including the FINEX Digest for organizational updates and activities, FINEX Focus for finance and business news and insights, and the FINEX Journal for research and academic articles on finance, economics, and business.",
|
|
147
|
+
"subquestions": []
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"id": "q5b",
|
|
151
|
+
"question": "What reports/handbooks are available?",
|
|
152
|
+
"answer": "FINEX produces a range of reports and publications, including the Philippine C-Suite State of Corporate Sustainability Report, Sustainability Handbook, Tax & Legal Updates, and Statements and Position Papers, covering sustainability, taxation, legal developments, finance, business, and economic issues.",
|
|
153
|
+
"subquestions": []
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"id": "q5c",
|
|
157
|
+
"question": "FINEX members' articles in newspapers",
|
|
158
|
+
"answer": "Manila Bulletin:\n- The letter, the spirit, and the pursuit of justice\n- Tax reform and the growth imperative\n- The problem of financing gov't receivables\n- Ten ways to cushion the oil shock\n- The price of impunity\n- Political dynasties and the erosion of liberty\n- Filipino workplaces: Balancing competition and cooperation\n- Should mandatory SME lending be reinstated?\n- The majority is not always right\n- You don't have to like each other to win together\n\nThe Manila Times:\n- How Philippine SMEs can compete globally (part 1)\n- What the Knicks and successful organizations have in common\n- Reforming the system of gov't assistance\n- Management mantra dangers\n- When luck and discipline converge\n- How big business can help SMEs grow\n- Reconciling SME lending quotas and risk-based loans\n- Business success amid crisis\n- What PH can learn from Korea\n\nBusinessWorld:\n- How algorithms divide a nation\n- Converting hope to conviction\n- Regulations to address toxic scents\n- Learning from Japan's infrastructure edge\n- Refounding: returning to our beginnings\n- 'While the Guitar Weeps' for the nation\n- Independent directors: guardrails, not decoration",
|
|
159
|
+
"subquestions": []
|
|
160
|
+
}
|
|
161
|
+
]
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"id": "q6",
|
|
165
|
+
"question": "Contact Information & Location",
|
|
166
|
+
"answer": "Reach out to FINEX at their office located in Makati City or contact the Secretariat via telephone or email.",
|
|
167
|
+
"subquestions": [
|
|
168
|
+
{
|
|
169
|
+
"id": "q6a",
|
|
170
|
+
"question": "Where is the FINEX office located?",
|
|
171
|
+
"answer": "Address:\nFinancial Executives Institute of the Philippines\nRoberto de Ocampo Center for Financial Excellence\nUnit 1901, 139 Corporate Center, Valero St., Salcedo Village\nMakati City, Metro Manila, Philippines",
|
|
172
|
+
"subquestions": []
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"id": "q6b",
|
|
176
|
+
"question": "How can I contact the FINEX Secretariat?",
|
|
177
|
+
"answer": "Telephone: +63 88114052\nEmail address: finexadmin@finex.org.ph",
|
|
178
|
+
"subquestions": []
|
|
179
|
+
}
|
|
180
|
+
]
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"id": "q7",
|
|
184
|
+
"question": "FINEX Committees",
|
|
185
|
+
"answer": "FINEX includes multiple committees across its Institute, Foundation, and Academy entities, offering opportunities for active member involvement.",
|
|
186
|
+
"subquestions": [
|
|
187
|
+
{
|
|
188
|
+
"id": "q7a",
|
|
189
|
+
"question": "FINEX Institute Committees",
|
|
190
|
+
"answer": "Advocacy Committee, Audit Committee, Brand, Media & Communications Committee, CFO of the Year Committee, Ethics & Governance Committee, Elections Committee, Finance Committee, FINEX Week Committee, GMM Committee, Membership Committee, Partnerships Committee, Professional Development Committee, Special Project Committee.",
|
|
191
|
+
"subquestions": []
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"id": "q7b",
|
|
195
|
+
"question": "FINEX Foundation Committees",
|
|
196
|
+
"answer": "Business Education Committee, Environment Committee, Grants and Sponsorship Committee, Junior FINEX Committee, Research Committee, Social Involvement Committee.",
|
|
197
|
+
"subquestions": []
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"id": "q7c",
|
|
201
|
+
"question": "FINEX Academy Committees",
|
|
202
|
+
"answer": "CFO Development Committee, Sustainability Reporting Committee, Digital Transformation Committee, Capital Markets Development Program Committee.",
|
|
203
|
+
"subquestions": []
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"id": "q7d",
|
|
207
|
+
"question": "How to Join Committees",
|
|
208
|
+
"answer": "Members interested in joining any of the FINEX committees must contact the FINEX Secretariat directly:\nFINEX Secretariat\nRoberto de Ocampo Center for Financial Excellence\nUnit 1901, 139 Corporate Center, Valero St., Salcedo Village, Makati City\nEmail: finexadmin@finex.org.ph\nTelephone: +63 2 8114 052",
|
|
209
|
+
"subquestions": []
|
|
210
|
+
}
|
|
211
|
+
]
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"id": "q8",
|
|
215
|
+
"question": "FINEX Foundation (For Approval)",
|
|
216
|
+
"answer": "The FINEX Foundation focuses on societal financial literacy and community engagement through scholarship programs, JFINEX youth initiatives, and public outreach.",
|
|
217
|
+
"subquestions": [
|
|
218
|
+
{
|
|
219
|
+
"id": "q8a",
|
|
220
|
+
"question": "What is the FINEX Foundation?",
|
|
221
|
+
"answer": "The FINEX Foundation was established to fulfill FINEX's deeper mandate: not merely to develop great finance leaders within its membership, but to invest in a more equitable and financially literate Philippine society. Through scholarships, grants, and community programs, the Foundation channels the collective resources and expertise of FINEX's senior finance community into initiatives that build lasting opportunity for Filipinos. It is distinct from FINEX Institute which focuses on member governance and from FINEX Academy, which serves working finance professionals.",
|
|
222
|
+
"subquestions": []
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
"id": "q8b",
|
|
226
|
+
"question": "What is Junior FINEX (JFINEX)?",
|
|
227
|
+
"answer": "Junior FINEX (JFINEX) serves as the vehicle of FINEX to promote advance learning in business and finance among the youth in partnership with the various colleges and universities in the Philippines. JFINEX aims to professionalize and make the students more competitive not only in the national scene, but also throughout the world.",
|
|
228
|
+
"subquestions": []
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
"id": "q8c",
|
|
232
|
+
"question": "How to support or contact the Foundation",
|
|
233
|
+
"answer": "To partner with, sponsor, or inquire about the programs of the FINEX Foundation, please reach out to the Secretariat:\nFINEX Secretariat\nRoberto de Ocampo Center for Financial Excellence\nUnit 1901, 139 Corporate Center, Valero St., Salcedo Village, Makati City\nEmail: finexadmin@finex.org.ph\nTelephone: +63 2 8114 052",
|
|
234
|
+
"subquestions": []
|
|
235
|
+
}
|
|
236
|
+
]
|
|
237
|
+
}
|
|
238
|
+
]
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "q1",
|
|
4
|
+
"question": "Tungkol sa FINEX at Misyon",
|
|
5
|
+
"answer": "Ang FINEX (Financial Executives Institute of the Philippines) ay isang propesyonal na organisasyon ng mga senior na financial executives sa Pilipinas, nakatuon sa pagpapaunlad ng propesyon sa pananalapi at pagtataguyod ng mabuting pamamahala.",
|
|
6
|
+
"subquestions": [
|
|
7
|
+
{
|
|
8
|
+
"id": "q1a",
|
|
9
|
+
"question": "Ano ang FINEX?",
|
|
10
|
+
"answer": "Ang FINEX ay ang Financial Executives Institute of the Philippines, isang non-stock, non-profit na organisasyon na binubuo ng mga senior na financial executives mula sa iba't ibang industriya.",
|
|
11
|
+
"subquestions": []
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"id": "q1b",
|
|
15
|
+
"question": "Ano ang misyon ng FINEX?",
|
|
16
|
+
"answer": "Ang misyon ng FINEX ay ang paunlarin at itaguyod ang propesyon sa pananalapi, itaguyod ang mga etikal na pamantayan, at mag-ambag sa ekonomikong pag-unlad ng Pilipinas.",
|
|
17
|
+
"subquestions": []
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"id": "q1c",
|
|
21
|
+
"question": "Kailan itinatag ang FINEX?",
|
|
22
|
+
"answer": "Ang FINEX ay itinatag noong 1968, na ginagawa itong isa sa pinakamatagal na propesyonal na organisasyon sa pananalapi sa Pilipinas.",
|
|
23
|
+
"subquestions": []
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"id": "q1d",
|
|
27
|
+
"question": "Ano ang bisyon ng FINEX?",
|
|
28
|
+
"answer": "Ninanais ng FINEX na maging pangunahing organisasyon ng mga financial executives na nagtataguyod ng kahusayan, integridad, at inobasyon sa komunidad ng pananalapi sa Pilipinas.",
|
|
29
|
+
"subquestions": []
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"id": "q2",
|
|
35
|
+
"question": "Membership at mga Benepisyo",
|
|
36
|
+
"answer": "Ang membership sa FINEX ay bukas sa mga senior na financial executives at propesyonal na nakakatugon sa mga kwalipikasyon. Ang mga miyembro ay may access sa mga eksklusibong kaganapan, networking, at mga programang pangpropesyonal.",
|
|
37
|
+
"subquestions": [
|
|
38
|
+
{
|
|
39
|
+
"id": "q2a",
|
|
40
|
+
"question": "Sino ang maaaring maging miyembro ng FINEX?",
|
|
41
|
+
"answer": "Ang membership sa FINEX ay bukas sa mga senior na financial executives tulad ng mga CFO, Controller, Treasurer, at iba pang mga propesyonal sa pananalapi na may hawak na mga senior na posisyon sa kanilang mga organisasyon.",
|
|
42
|
+
"subquestions": []
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"id": "q2b",
|
|
46
|
+
"question": "Paano ako mag-aaplay para sa membership?",
|
|
47
|
+
"answer": "Maaari kang mag-apply para sa membership sa FINEX sa pamamagitan ng pagsusumite ng application form kasama ang iyong mga propesyonal na kredensyal. Ang mga aplikasyon ay sinusuri ng membership committee.",
|
|
48
|
+
"subquestions": []
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"id": "q2c",
|
|
52
|
+
"question": "Ano ang mga benepisyo ng pagiging miyembro ng FINEX?",
|
|
53
|
+
"answer": "Ang mga miyembro ay nakaka-enjoy ng eksklusibong networking events, access sa mga programang FINEX Academy, diskwento sa mga kaganapan at publikasyon, karapatang bumoto, at pagkakataong maglingkod sa mga komite.",
|
|
54
|
+
"subquestions": []
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"id": "q2d",
|
|
58
|
+
"question": "Magkano ang membership fees?",
|
|
59
|
+
"answer": "Mangyaring makipag-ugnayan sa FINEX Secretariat sa info@finex.ph para sa pinakabagong iskedyul ng membership fee.",
|
|
60
|
+
"subquestions": []
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"id": "q3",
|
|
66
|
+
"question": "FINEX Academy at mga Programa",
|
|
67
|
+
"answer": "Ang FINEX Academy ay nag-aalok ng mga programang pangpropesyonal, seminar, at pagsasanay na dinisenyo para sa mga financial executives at propesyonal.",
|
|
68
|
+
"subquestions": [
|
|
69
|
+
{
|
|
70
|
+
"id": "q3a",
|
|
71
|
+
"question": "Ano ang FINEX Academy?",
|
|
72
|
+
"answer": "Ang FINEX Academy ay ang learning and development arm ng FINEX, nag-aalok ng mga programang nagpapahusay ng mga kakayahan ng mga financial executives at propesyonal.",
|
|
73
|
+
"subquestions": []
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"id": "q3b",
|
|
77
|
+
"question": "Anong mga programa ang inaalok ng FINEX Academy?",
|
|
78
|
+
"answer": "Ang FINEX Academy ay nag-aalok ng mga seminar, workshop, certificate programs, at executive education na sumasaklaw sa mga paksa tulad ng financial management, governance, risk, at leadership.",
|
|
79
|
+
"subquestions": []
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"id": "q3c",
|
|
83
|
+
"question": "Bukas ba ang mga programa ng FINEX Academy sa mga hindi miyembro?",
|
|
84
|
+
"answer": "Oo, karamihan sa mga programa ng FINEX Academy ay bukas sa mga hindi miyembro, bagaman ang mga miyembro ay nakaka-enjoy ng mga diskwentong rate.",
|
|
85
|
+
"subquestions": []
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"id": "q3d",
|
|
89
|
+
"question": "Paano ako magrerehistro para sa isang programa?",
|
|
90
|
+
"answer": "Maaari kang magrehistro para sa mga programa ng FINEX Academy sa pamamagitan ng website ng FINEX o sa pamamagitan ng pakikipag-ugnayan sa Secretariat sa info@finex.ph.",
|
|
91
|
+
"subquestions": []
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"id": "q4",
|
|
97
|
+
"question": "Mga Parangal at Mahahalagang Kaganapan",
|
|
98
|
+
"answer": "Ang FINEX ay nagho-host ng mga prestihiyosong parangal at mahahalagang kaganapan na kinikilala ang kahusayan sa propesyon sa pananalapi at nagtitipon ng mga lider ng industriya.",
|
|
99
|
+
"subquestions": [
|
|
100
|
+
{
|
|
101
|
+
"id": "q4a",
|
|
102
|
+
"question": "Anong mga parangal ang ibinibigay ng FINEX?",
|
|
103
|
+
"answer": "Ang FINEX ay nagbibigay ng mga parangal tulad ng CFO of the Year, Financial Executive of the Year, at iba pang mga pagkilala na nagbibigay-pugay sa mga natatanging kontribusyon sa propesyon sa pananalapi.",
|
|
104
|
+
"subquestions": []
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"id": "q4b",
|
|
108
|
+
"question": "Ano ang mga pangunahing taunang kaganapan ng FINEX?",
|
|
109
|
+
"answer": "Ang mga pangunahing kaganapan ng FINEX ay kinabibilangan ng Annual National Conference, General Membership Meeting, FINEX Night, at iba't ibang forum at summit sa buong taon.",
|
|
110
|
+
"subquestions": []
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"id": "q4c",
|
|
114
|
+
"question": "Paano ako makakapag-nominate ng isang tao para sa parangal ng FINEX?",
|
|
115
|
+
"answer": "Ang mga nominasyon para sa mga parangal ng FINEX ay tinatanggap sa pamamagitan ng opisyal na proseso ng nominasyon na inihayag sa website ng FINEX at ipinaabot sa mga miyembro.",
|
|
116
|
+
"subquestions": []
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"id": "q4d",
|
|
120
|
+
"question": "Maaari bang dumalo ang mga hindi miyembro sa mga kaganapan ng FINEX?",
|
|
121
|
+
"answer": "Oo, karamihan sa mga kaganapan ng FINEX ay bukas sa mga hindi miyembro. Ang mga miyembro ay nakatanggap ng priority registration at mga diskwentong rate.",
|
|
122
|
+
"subquestions": []
|
|
123
|
+
}
|
|
124
|
+
]
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"id": "q5",
|
|
128
|
+
"question": "Mga Publikasyon at Mapagkukunan",
|
|
129
|
+
"answer": "Ang FINEX ay gumagawa ng mga publikasyon at mapagkukunan na nagpapaalam sa mga miyembro at sa komunidad ng pananalapi tungkol sa mga trend sa industriya, pinakamahusay na mga gawi, at mga update ng organisasyon.",
|
|
130
|
+
"subquestions": [
|
|
131
|
+
{
|
|
132
|
+
"id": "q5a",
|
|
133
|
+
"question": "Anong mga publikasyon ang ginagawa ng FINEX?",
|
|
134
|
+
"answer": "Ang FINEX ay naglalathala ng FINEX Digest, isang opisyal na journal na nagtatampok ng mga artikulo sa pananalapi, pamamahala, at mga isyung pang-ekonomiya na may kaugnayan sa mga financial executives.",
|
|
135
|
+
"subquestions": []
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"id": "q5b",
|
|
139
|
+
"question": "Paano ko maa-access ang mga publikasyon ng FINEX?",
|
|
140
|
+
"answer": "Ang mga publikasyon ng FINEX ay available sa mga miyembro sa pamamagitan ng website ng FINEX at ipinamamahagi sa mga kaganapan. Ang ilang mga publikasyon ay available din sa publiko.",
|
|
141
|
+
"subquestions": []
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"id": "q5c",
|
|
145
|
+
"question": "Maaari ba akong mag-ambag ng artikulo sa mga publikasyon ng FINEX?",
|
|
146
|
+
"answer": "Oo, tinatanggap ng FINEX ang mga kontribusyon mula sa mga miyembro at eksperto sa industriya. Mangyaring makipag-ugnayan sa Secretariat sa info@finex.ph para sa mga alituntunin sa pagsusumite.",
|
|
147
|
+
"subquestions": []
|
|
148
|
+
}
|
|
149
|
+
]
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"id": "q6",
|
|
153
|
+
"question": "Impormasyon sa Pakikipag-ugnayan at Lokasyon",
|
|
154
|
+
"answer": "Maaari kang makipag-ugnayan sa FINEX sa pamamagitan ng kanilang Secretariat sa pamamagitan ng email, telepono, o sa pamamagitan ng pagbisita sa kanilang opisina.",
|
|
155
|
+
"subquestions": [
|
|
156
|
+
{
|
|
157
|
+
"id": "q6a",
|
|
158
|
+
"question": "Ano ang address ng opisina ng FINEX?",
|
|
159
|
+
"answer": "Ang FINEX Secretariat ay matatagpuan sa Unit 1003 Prestige Tower, F. Ortigas Jr. Road, Ortigas Center, Pasig City, Pilipinas.",
|
|
160
|
+
"subquestions": []
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"id": "q6b",
|
|
164
|
+
"question": "Ano ang email address ng FINEX?",
|
|
165
|
+
"answer": "Maaari kang makipag-ugnayan sa FINEX sa pamamagitan ng email sa info@finex.ph.",
|
|
166
|
+
"subquestions": []
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"id": "q6c",
|
|
170
|
+
"question": "Ano ang oras ng opisina ng FINEX?",
|
|
171
|
+
"answer": "Ang FINEX Secretariat ay bukas Lunes hanggang Biyernes, 8:00 AM hanggang 5:00 PM.",
|
|
172
|
+
"subquestions": []
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"id": "q6d",
|
|
176
|
+
"question": "Mayroon bang website ang FINEX?",
|
|
177
|
+
"answer": "Oo, maaari kang bumisita sa website ng FINEX sa www.finex.ph para sa pinakabagong balita, kaganapan, at impormasyon sa membership.",
|
|
178
|
+
"subquestions": []
|
|
179
|
+
}
|
|
180
|
+
]
|
|
181
|
+
}
|
|
182
|
+
]
|
package/server/index.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import express from 'express'
|
|
2
|
+
import cors from 'cors'
|
|
3
|
+
import chatRouter from './routes/chat'
|
|
4
|
+
|
|
5
|
+
const app = express()
|
|
6
|
+
app.use(cors())
|
|
7
|
+
app.use(express.json())
|
|
8
|
+
app.use('/api/chat', chatRouter)
|
|
9
|
+
|
|
10
|
+
const PORT = process.env.PORT || 3001
|
|
11
|
+
app.listen(PORT, () => console.log(`Backend running on http://localhost:${PORT}`))
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { Filter } from 'bad-words'
|
|
2
|
+
|
|
3
|
+
const filter = new Filter()
|
|
4
|
+
|
|
5
|
+
// Additional rude/aggressive phrases beyond profanity
|
|
6
|
+
const RUDE_PATTERNS = [
|
|
7
|
+
/\bstupid\b/i,
|
|
8
|
+
/\bidiot\b/i,
|
|
9
|
+
/\bmoron\b/i,
|
|
10
|
+
/\bdumb\b/i,
|
|
11
|
+
/\buseless\b/i,
|
|
12
|
+
/\bworthless\b/i,
|
|
13
|
+
/\bterrible\b/i,
|
|
14
|
+
/\bawful\b/i,
|
|
15
|
+
/\bhate\s+you\b/i,
|
|
16
|
+
/\bshut\s+up\b/i,
|
|
17
|
+
/\bgo\s+away\b/i,
|
|
18
|
+
/\byou\s+suck\b/i,
|
|
19
|
+
/\bwaste\s+of\s+time\b/i,
|
|
20
|
+
/\bscam\b/i,
|
|
21
|
+
/\bfraud\b/i,
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
const GUARDRAIL_RESPONSES = [
|
|
25
|
+
"We truly value your time and want to make sure we're helping you in the best way possible. Let's keep our conversation respectful so we can assist you better. 😊 How can we help you today?",
|
|
26
|
+
"We understand that things can be frustrating sometimes, and we're here to help! Let's work together to find the answers you need. What can we assist you with?",
|
|
27
|
+
"Your experience matters to us, and we want to make sure you get the best support possible. Let's start fresh — what would you like to know?",
|
|
28
|
+
"We're committed to providing you with a positive and helpful experience. Let's keep things friendly so we can serve you better! What can we help you with today?",
|
|
29
|
+
"We're here to help and we want to make this a great experience for you! Let's take a step back and see how we can best assist you. 😊",
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
const INVALID_INPUT_RESPONSES = [
|
|
33
|
+
"Hmm, it seems like that message didn't quite come through. Could you rephrase your question? We'd love to help! 😊",
|
|
34
|
+
"We want to make sure we understand you correctly! Could you try asking your question in a different way?",
|
|
35
|
+
"It looks like we didn't catch that. Could you provide a bit more detail so we can assist you better?",
|
|
36
|
+
"We're here to help, but we need a little more to go on! Could you try rephrasing that for us?",
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
// Minimum valid word length and count
|
|
40
|
+
const MIN_WORD_LENGTH = 2
|
|
41
|
+
const MIN_VALID_WORDS = 1
|
|
42
|
+
const MAX_INPUT_LENGTH = 500
|
|
43
|
+
|
|
44
|
+
// Detect if input is gibberish — too many consecutive consonants or random chars
|
|
45
|
+
function isGibberish(word: string): boolean {
|
|
46
|
+
if (word.length < 2) return false
|
|
47
|
+
const consonantRun = /[bcdfghjklmnpqrstvwxyz]{5,}/i
|
|
48
|
+
const randomChars = /[^a-z0-9\s]{3,}/i
|
|
49
|
+
const repeatingChars = /(.)\1{4,}/i
|
|
50
|
+
return consonantRun.test(word) || randomChars.test(word) || repeatingChars.test(word)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface ValidationResult {
|
|
54
|
+
valid: boolean
|
|
55
|
+
response?: string
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function validateInput(text: string): ValidationResult {
|
|
59
|
+
const trimmed = text.trim()
|
|
60
|
+
|
|
61
|
+
// Empty or too short
|
|
62
|
+
if (!trimmed || trimmed.length < MIN_WORD_LENGTH) {
|
|
63
|
+
return { valid: false, response: "Please type a message so we can assist you! 😊" }
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Too long
|
|
67
|
+
if (trimmed.length > MAX_INPUT_LENGTH) {
|
|
68
|
+
return { valid: false, response: "Your message is a bit too long. Could you summarize your question so we can help you better?" }
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Only numbers or special characters
|
|
72
|
+
if (/^[^a-zA-Z]+$/.test(trimmed)) {
|
|
73
|
+
return { valid: false, response: INVALID_INPUT_RESPONSES[Math.floor(Math.random() * INVALID_INPUT_RESPONSES.length)] }
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Check for gibberish words
|
|
77
|
+
const words = trimmed.split(/\s+/).filter(w => w.length >= MIN_WORD_LENGTH)
|
|
78
|
+
const gibberishWords = words.filter(isGibberish)
|
|
79
|
+
if (words.length > 0 && gibberishWords.length / words.length > 0.6) {
|
|
80
|
+
return { valid: false, response: INVALID_INPUT_RESPONSES[Math.floor(Math.random() * INVALID_INPUT_RESPONSES.length)] }
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Not enough valid words
|
|
84
|
+
const validWords = words.filter(w => /[a-zA-Z]/.test(w))
|
|
85
|
+
if (validWords.length < MIN_VALID_WORDS) {
|
|
86
|
+
return { valid: false, response: INVALID_INPUT_RESPONSES[Math.floor(Math.random() * INVALID_INPUT_RESPONSES.length)] }
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return { valid: true }
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export interface GuardrailResult {
|
|
93
|
+
flagged: boolean
|
|
94
|
+
response?: string
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export function checkGuardrails(text: string): GuardrailResult {
|
|
98
|
+
const hasProfanity = filter.isProfane(text)
|
|
99
|
+
const hasRudeness = RUDE_PATTERNS.some(pattern => pattern.test(text))
|
|
100
|
+
|
|
101
|
+
if (hasProfanity || hasRudeness) {
|
|
102
|
+
const response = GUARDRAIL_RESPONSES[Math.floor(Math.random() * GUARDRAIL_RESPONSES.length)]
|
|
103
|
+
return { flagged: true, response }
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return { flagged: false }
|
|
107
|
+
}
|