network01 commited on
Commit
fc8865d
·
verified ·
1 Parent(s): abed822

Add AlanClaw Myanmar Agent Team demo

Browse files
README.md CHANGED
@@ -1,13 +1,39 @@
1
  ---
2
- title: Alanclaw Myanmar Agent Team
3
- emoji: 📉
4
- colorFrom: pink
5
  colorTo: indigo
6
  sdk: gradio
7
- sdk_version: 6.14.0
8
- python_version: '3.13'
9
  app_file: app.py
10
  pinned: false
 
 
11
  ---
12
 
13
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ title: AlanClaw Myanmar Agent Team
3
+ emoji: 🧠
4
+ colorFrom: blue
5
  colorTo: indigo
6
  sdk: gradio
7
+ sdk_version: 4.44.0
 
8
  app_file: app.py
9
  pinned: false
10
+ license: mit
11
+ short_description: Myanmar AI Agent Team demo.
12
  ---
13
 
14
+ # AlanClaw Myanmar Agent Team
15
+
16
+ AlanClaw is a Myanmar-focused AI Agent Team marketplace concept.
17
+
18
+ This Hugging Face Space demonstrates how users can choose an industry team, enter a business task, set safety rules, and receive a structured draft they can copy into Telegram, WeChat, Facebook, OTA listings, email, or internal workflows.
19
+
20
+ ## Included Teams
21
+
22
+ - Overseas Business Team
23
+ - Construction Industry Team
24
+ - Ecommerce Growth Team
25
+ - Myanmar Social Media Marketing Team
26
+ - Sallow / Swallow Hotel Promotion Team
27
+
28
+ ## Demo Notes
29
+
30
+ This demo intentionally uses deterministic template logic instead of a live LLM API. It is safe to run publicly and does not require API keys.
31
+
32
+ The generated output is a structured first draft. It should be reviewed by a human before publishing, sending, or using in a business commitment.
33
+
34
+ ## Safety Defaults
35
+
36
+ - Do not invent prices
37
+ - Do not promise room availability, discounts, refunds, delivery dates, or contract terms
38
+ - Mark uncertain details as "needs human confirmation"
39
+ - Do not send or publish anything automatically
app.py ADDED
@@ -0,0 +1,416 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from __future__ import annotations
2
+
3
+ from dataclasses import dataclass
4
+ from html import escape
5
+ from pathlib import Path
6
+
7
+ import gradio as gr
8
+
9
+
10
+ ASSET_DIR = Path(__file__).parent / "assets"
11
+ LOGO_PATH = ASSET_DIR / "alanclaw-agent-team-icon-512.png"
12
+
13
+
14
+ @dataclass(frozen=True)
15
+ class TeamConfig:
16
+ label: str
17
+ mission: str
18
+ channels: tuple[str, ...]
19
+ roles: tuple[str, ...]
20
+ menu: tuple[str, ...]
21
+ default_rules: tuple[str, ...]
22
+
23
+
24
+ TEAMS: dict[str, TeamConfig] = {
25
+ "Overseas Business Team": TeamConfig(
26
+ label="AlanClaw Overseas Business Team",
27
+ mission="Myanmar and overseas business support for sales, documents, project follow-up, multilingual communication, and market intelligence.",
28
+ channels=("Telegram", "WeChat", "Facebook", "Email", "Web"),
29
+ roles=(
30
+ "Myanmar sales assistant",
31
+ "Telegram / WeChat message drafter",
32
+ "Quotation and invoice assistant",
33
+ "Project follow-up assistant",
34
+ "Chinese / English / Burmese translator",
35
+ "Myanmar market intelligence analyst",
36
+ ),
37
+ menu=(
38
+ "Customer inquiry reply",
39
+ "Telegram / WeChat message draft",
40
+ "Quotation or invoice draft",
41
+ "Project follow-up summary",
42
+ "Chinese / English / Burmese translation",
43
+ "Market intelligence summary",
44
+ ),
45
+ default_rules=(
46
+ "Do not invent business data, prices, dates, stock, or commitments.",
47
+ "Keep customer-facing messages concise and ready for human review.",
48
+ "Mark missing facts as needs human confirmation.",
49
+ ),
50
+ ),
51
+ "Construction Industry Team": TeamConfig(
52
+ label="AlanClaw Construction Industry Team",
53
+ mission="Myanmar construction workflow support for BOQ, materials, quotations, meeting minutes, coordination, and project tracking.",
54
+ channels=("Telegram", "WeChat", "Email", "Excel", "PDF", "Web"),
55
+ roles=(
56
+ "Project follow-up assistant",
57
+ "BOQ and material list organizer",
58
+ "Quotation and invoice assistant",
59
+ "Meeting minutes assistant",
60
+ "Site coordination message drafter",
61
+ "Myanmar construction market intelligence analyst",
62
+ ),
63
+ menu=(
64
+ "Project progress follow-up",
65
+ "BOQ / material list cleanup",
66
+ "Quotation / invoice draft",
67
+ "Meeting minutes",
68
+ "Telegram / WeChat site coordination message",
69
+ "Risk and next-step checklist",
70
+ ),
71
+ default_rules=(
72
+ "Mark quantities, dates, prices, contract terms, and safety details as needs human confirmation.",
73
+ "Do not claim engineering, legal, financial, or safety certification authority.",
74
+ "Do not send instructions to site teams automatically.",
75
+ ),
76
+ ),
77
+ "Ecommerce Growth Team": TeamConfig(
78
+ label="AlanClaw Ecommerce Growth Team",
79
+ mission="Ecommerce growth support for product listings, campaigns, customer replies, order follow-up, reviews, and sales summaries.",
80
+ channels=("Telegram", "WeChat", "Facebook", "TikTok", "Email", "Web"),
81
+ roles=(
82
+ "Product listing optimizer",
83
+ "Customer inquiry reply assistant",
84
+ "Campaign copywriter",
85
+ "Order follow-up assistant",
86
+ "Review and reputation assistant",
87
+ "Sales data summary assistant",
88
+ ),
89
+ menu=(
90
+ "Product listing optimization",
91
+ "Customer inquiry reply",
92
+ "Telegram / WeChat sales message",
93
+ "Facebook / TikTok campaign copy",
94
+ "Order follow-up message",
95
+ "7-day campaign plan",
96
+ ),
97
+ default_rules=(
98
+ "Do not promise discounts, stock, delivery dates, refunds, or warranties without provided facts.",
99
+ "Ask for missing product, price, inventory, and policy details.",
100
+ "Do not change storefront data automatically.",
101
+ ),
102
+ ),
103
+ "Myanmar Social Media Marketing Team": TeamConfig(
104
+ label="AlanClaw Myanmar Social Media Marketing Team",
105
+ mission="Myanmar-focused social media marketing for Facebook, TikTok, Telegram, WeChat, multilingual content, and local campaign planning.",
106
+ channels=("Facebook", "TikTok", "Telegram", "WeChat", "Messenger", "Web"),
107
+ roles=(
108
+ "Myanmar content topic planner",
109
+ "Social copywriting expert",
110
+ "Facebook / TikTok campaign planner",
111
+ "Comment and inbox reply drafter",
112
+ "KOL / community outreach assistant",
113
+ "Burmese / Chinese / English localization expert",
114
+ ),
115
+ menu=(
116
+ "Facebook post set",
117
+ "TikTok short video scripts",
118
+ "Telegram / WeChat private traffic copy",
119
+ "Comment / inbox reply templates",
120
+ "Local campaign idea",
121
+ "7-day social media calendar",
122
+ ),
123
+ default_rules=(
124
+ "Avoid unverified claims, fake urgency, and misleading promotions.",
125
+ "Prefer Myanmar-local examples, channels, cities, and customer behavior.",
126
+ "Do not publish or send anything automatically.",
127
+ ),
128
+ ),
129
+ "Sallow / Swallow Hotel Promotion Team": TeamConfig(
130
+ label="AlanClaw Sallow / Swallow Hotel Promotion Team",
131
+ mission="Hotel promotion and lead generation for a Mandalay hotel, focused on OTA visibility, social media, travel-agent outreach, and private inquiry conversion.",
132
+ channels=("Agoda", "Booking / OTA", "Google Business", "Facebook", "TikTok", "Telegram", "WeChat", "Messenger"),
133
+ roles=(
134
+ "OTA exposure optimizer",
135
+ "Facebook hotel promotion expert",
136
+ "TikTok short video script expert",
137
+ "Mandalay travel content strategist",
138
+ "Travel agent partnership developer",
139
+ "Private inquiry conversion expert",
140
+ "Burmese / Chinese / English localization expert",
141
+ ),
142
+ menu=(
143
+ "OTA listing optimization",
144
+ "Facebook hotel promotion plan",
145
+ "TikTok short video scripts",
146
+ "Telegram / WeChat inquiry conversion scripts",
147
+ "Travel agent / guide / driver outreach",
148
+ "Mandalay travel content ideas",
149
+ "7-day hotel promotion calendar",
150
+ ),
151
+ default_rules=(
152
+ "Do not generate room prices, discounts, rate comparisons, or promotional prices.",
153
+ "Do not promise availability, upgrades, refunds, or booking changes.",
154
+ "Mark official name, address, facilities, room types, and policies as needs human confirmation unless provided.",
155
+ ),
156
+ ),
157
+ }
158
+
159
+
160
+ LANGUAGE_NOTES = {
161
+ "Chinese": "Write primarily in Chinese. Add English/Burmese variants only when requested.",
162
+ "English": "Write primarily in English. Keep the language clear for international business users.",
163
+ "Burmese": "Write in Burmese-friendly style. If Burmese text is uncertain, provide an English back-translation and mark it for native review.",
164
+ "Trilingual": "Provide Chinese, English, and Burmese/localization notes where useful.",
165
+ }
166
+
167
+
168
+ def _bullets(items: tuple[str, ...] | list[str]) -> str:
169
+ return "\n".join(f"- {item}" for item in items)
170
+
171
+
172
+ def _numbered(items: tuple[str, ...] | list[str]) -> str:
173
+ return "\n".join(f"{idx}. {item}" for idx, item in enumerate(items, start=1))
174
+
175
+
176
+ def build_demo_response(
177
+ team_name: str,
178
+ task: str,
179
+ language: str,
180
+ no_prices: bool,
181
+ no_commitments: bool,
182
+ mark_uncertain: bool,
183
+ channel: str,
184
+ ) -> str:
185
+ team = TEAMS[team_name]
186
+ task_text = task.strip() or "Start with a task menu and ask me what to do next."
187
+ rules = list(team.default_rules)
188
+ if no_prices:
189
+ rules.append("Do not create or estimate prices.")
190
+ if no_commitments:
191
+ rules.append("Do not promise availability, discounts, delivery dates, refunds, or contract terms.")
192
+ if mark_uncertain:
193
+ rules.append('Mark uncertain details as "needs human confirmation".')
194
+
195
+ return f"""# {team.label}
196
+
197
+ ## What This Team Does
198
+
199
+ {team.mission}
200
+
201
+ ## Recommended Team Roles
202
+
203
+ {_bullets(team.roles)}
204
+
205
+ ## Supported Channels
206
+
207
+ {", ".join(team.channels)}
208
+
209
+ ## Your Selected Channel
210
+
211
+ {channel}
212
+
213
+ ## Task Menu
214
+
215
+ {_numbered(team.menu)}
216
+
217
+ ## Draft For Your Task
218
+
219
+ **User task:** {task_text}
220
+
221
+ **Recommended next output structure:**
222
+
223
+ 1. Clarify the target audience and channel.
224
+ 2. Use only verified facts from the user.
225
+ 3. Produce a ready-to-review draft.
226
+ 4. Add a short checklist of missing facts.
227
+ 5. Provide one next action the user can confirm.
228
+
229
+ ## Starter Draft
230
+
231
+ Here is a safe first draft structure for **{channel}**:
232
+
233
+ **Headline / opening:**
234
+ Create a concise opening matched to the selected team and audience.
235
+
236
+ **Main message:**
237
+ Explain the offer, service, update, or promotion using only confirmed facts from the task.
238
+
239
+ **Action prompt:**
240
+ Invite the customer or teammate to reply, confirm details, or request manual follow-up.
241
+
242
+ **Needs human confirmation:**
243
+ - Exact business facts not provided in the task
244
+ - Any prices, stock, room availability, delivery dates, refund rules, or contract terms
245
+ - Names, addresses, phone numbers, facilities, and policies if not supplied
246
+
247
+ ## Language Rule
248
+
249
+ {LANGUAGE_NOTES[language]}
250
+
251
+ ## Safety Rules Applied
252
+
253
+ {_bullets(rules)}
254
+
255
+ ## Copyable Next Prompt
256
+
257
+ ```text
258
+ Use {team.label}.
259
+ Channel: {channel}
260
+ Task: {task_text}
261
+ Language: {language}
262
+ Rules: do not invent facts; mark missing details as needs human confirmation; do not send automatically.
263
+ ```
264
+ """
265
+
266
+
267
+ def team_summary(team_name: str) -> str:
268
+ team = TEAMS[team_name]
269
+ return f"""### {team.label}
270
+
271
+ **Mission:** {team.mission}
272
+
273
+ **Roles**
274
+ {_bullets(team.roles)}
275
+
276
+ **Task Menu**
277
+ {_numbered(team.menu)}
278
+ """
279
+
280
+
281
+ CUSTOM_CSS = """
282
+ .alanclaw-hero {
283
+ display: flex;
284
+ gap: 18px;
285
+ align-items: center;
286
+ padding: 18px;
287
+ border: 1px solid #dbeafe;
288
+ border-radius: 14px;
289
+ background: linear-gradient(135deg, #f8fbff 0%, #eef6ff 100%);
290
+ }
291
+ .alanclaw-hero img {
292
+ width: 76px;
293
+ height: 76px;
294
+ border-radius: 18px;
295
+ }
296
+ .alanclaw-hero h1 {
297
+ margin: 0 0 4px;
298
+ }
299
+ .alanclaw-hero p {
300
+ margin: 0;
301
+ color: #475569;
302
+ }
303
+ """
304
+
305
+
306
+ def build_app() -> gr.Blocks:
307
+ with gr.Blocks(css=CUSTOM_CSS, title="AlanClaw Myanmar Agent Team") as app:
308
+ logo_html = ""
309
+ if LOGO_PATH.exists():
310
+ logo_html = f'<img src="/file={escape(str(LOGO_PATH))}" alt="AlanClaw logo">'
311
+
312
+ gr.HTML(
313
+ f"""
314
+ <div class="alanclaw-hero">
315
+ {logo_html}
316
+ <div>
317
+ <h1>AlanClaw Myanmar Agent Team</h1>
318
+ <p>Choose an industry agent team, enter a business task, and get a safe structured draft for Myanmar-focused workflows.</p>
319
+ </div>
320
+ </div>
321
+ """
322
+ )
323
+
324
+ with gr.Row():
325
+ with gr.Column(scale=1):
326
+ team = gr.Dropdown(
327
+ choices=list(TEAMS.keys()),
328
+ value="Sallow / Swallow Hotel Promotion Team",
329
+ label="Agent Team",
330
+ )
331
+ channel = gr.Dropdown(
332
+ choices=(
333
+ "Telegram",
334
+ "WeChat",
335
+ "Facebook",
336
+ "TikTok",
337
+ "Agoda / OTA",
338
+ "Email",
339
+ "Internal workflow",
340
+ ),
341
+ value="WeChat",
342
+ label="Target Channel",
343
+ )
344
+ language = gr.Radio(
345
+ choices=("Chinese", "English", "Burmese", "Trilingual"),
346
+ value="Chinese",
347
+ label="Output Language",
348
+ )
349
+ no_prices = gr.Checkbox(value=True, label="Do not generate prices")
350
+ no_commitments = gr.Checkbox(value=True, label="Do not make business commitments")
351
+ mark_uncertain = gr.Checkbox(value=True, label='Mark missing facts as "needs human confirmation"')
352
+
353
+ with gr.Column(scale=2):
354
+ task = gr.Textbox(
355
+ label="Business Task",
356
+ lines=8,
357
+ placeholder=(
358
+ "Example: Write a WeChat Moments post for a Mandalay hotel. "
359
+ "Do not include prices. Unknown facilities should be marked for confirmation."
360
+ ),
361
+ )
362
+ generate = gr.Button("Generate Safe Draft", variant="primary")
363
+
364
+ output = gr.Markdown(label="AlanClaw Draft")
365
+
366
+ with gr.Accordion("Team Details", open=False):
367
+ team_info = gr.Markdown(team_summary("Sallow / Swallow Hotel Promotion Team"))
368
+
369
+ generate.click(
370
+ build_demo_response,
371
+ inputs=[team, task, language, no_prices, no_commitments, mark_uncertain, channel],
372
+ outputs=output,
373
+ )
374
+ team.change(team_summary, inputs=team, outputs=team_info)
375
+
376
+ gr.Examples(
377
+ examples=[
378
+ [
379
+ "Sallow / Swallow Hotel Promotion Team",
380
+ "Write 3 WeChat Moments posts for a Mandalay hotel. Do not include prices or promise room availability.",
381
+ "Chinese",
382
+ True,
383
+ True,
384
+ True,
385
+ "WeChat",
386
+ ],
387
+ [
388
+ "Myanmar Social Media Marketing Team",
389
+ "Create a 7-day Facebook and TikTok content calendar for a local Myanmar business.",
390
+ "Trilingual",
391
+ True,
392
+ True,
393
+ True,
394
+ "Facebook",
395
+ ],
396
+ [
397
+ "Construction Industry Team",
398
+ "Turn these site notes into a Telegram coordination message and next-step checklist.",
399
+ "Chinese",
400
+ False,
401
+ True,
402
+ True,
403
+ "Telegram",
404
+ ],
405
+ ],
406
+ inputs=[team, task, language, no_prices, no_commitments, mark_uncertain, channel],
407
+ )
408
+
409
+ return app
410
+
411
+
412
+ demo = build_app()
413
+
414
+
415
+ if __name__ == "__main__":
416
+ demo.launch()
assets/alanclaw-agent-team-icon-512.png ADDED
assets/alanclaw-agent-team-logo.svg ADDED
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ gradio>=4.44.0