Agentic-GenUI-Tools 0.2.0__py3-none-any.whl
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.
- adaptive_card_tools/__init__.py +10 -0
- adaptive_card_tools/builder.py +1891 -0
- adaptive_card_tools/catalog.py +488 -0
- adaptive_card_tools/examples.py +169 -0
- adaptive_card_tools/normalize.py +581 -0
- adaptive_card_tools/py.typed +0 -0
- adaptive_card_tools/theme.py +210 -0
- adaptive_card_tools/tool.py +142 -0
- agentic_genui_tools-0.2.0.dist-info/METADATA +284 -0
- agentic_genui_tools-0.2.0.dist-info/RECORD +13 -0
- agentic_genui_tools-0.2.0.dist-info/WHEEL +5 -0
- agentic_genui_tools-0.2.0.dist-info/licenses/LICENSE +21 -0
- agentic_genui_tools-0.2.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
"""Designed compositions, not named rendering templates.
|
|
2
|
+
|
|
3
|
+
These show how generic elements combine. The builder has no product, expense,
|
|
4
|
+
KPI, or approval special cases. All names/values are illustrative; example.com
|
|
5
|
+
URLs must be replaced by real application URLs. They are not part of the tool
|
|
6
|
+
prompt (which stays short for small models); use them for docs and tests.
|
|
7
|
+
"""
|
|
8
|
+
import copy
|
|
9
|
+
import json
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
BUSINESS_EXAMPLES = {
|
|
13
|
+
"product_comparison": {
|
|
14
|
+
"design": "Introduce the decision, put one product in each column, then end with a complete recommendation or trade-off paragraph. Each column can have an optional image, heading, optional badge/rating, full description, facts, and a link. Omit optional elements only when their information was not supplied; never shorten or drop supplied text to fit. The example uses the same feature labels for easy scanning; add a separate table if exact row alignment is important. Rearrange or add elements as appropriate; this is not a fixed product template.",
|
|
15
|
+
"request": {
|
|
16
|
+
"title": "Choose a laptop for your team",
|
|
17
|
+
"elements": [
|
|
18
|
+
{"type": "text", "text": "Two illustrative options for a hybrid team. Both include a three-year warranty and next-business-day support. Prices exclude tax."},
|
|
19
|
+
{"type": "columns", "columns": [
|
|
20
|
+
{"elements": [
|
|
21
|
+
{"type": "image", "url": "https://example.com/images/aurora-air.png", "alt": "Aurora Air laptop with a silver finish"},
|
|
22
|
+
{"type": "heading", "text": "Aurora Air 14"},
|
|
23
|
+
{"type": "badge", "text": "Best for travel", "tone": "info"},
|
|
24
|
+
{"type": "text", "text": "A lightweight laptop for colleagues who move between home, campus, and client meetings. Its smaller chassis prioritizes portability while retaining the connectivity needed for an external display and standard office accessories."},
|
|
25
|
+
{"type": "facts", "facts": {"Price": "$1,249 per device", "Memory": "16 GB", "Storage": "512 GB SSD", "Weight": "1.2 kg", "Battery": "Up to 14 hours", "Warranty": "3 years; next-business-day support"}},
|
|
26
|
+
{"type": "rating", "value": 4.4, "count": 128},
|
|
27
|
+
{"type": "actions", "actions": [{"type": "open_url", "label": "View Aurora Air details", "url": "https://example.com/products/aurora-air"}]}
|
|
28
|
+
]},
|
|
29
|
+
{"elements": [
|
|
30
|
+
{"type": "image", "url": "https://example.com/images/aurora-pro.png", "alt": "Aurora Pro laptop with a dark finish"},
|
|
31
|
+
{"type": "heading", "text": "Aurora Pro 16"},
|
|
32
|
+
{"type": "badge", "text": "Best for analysis", "tone": "success"},
|
|
33
|
+
{"type": "text", "text": "A larger laptop for analysts who work with several applications, large spreadsheets, and local development environments at the same time. The additional memory and storage provide more headroom, with a heavier device and shorter stated battery life as the trade-offs."},
|
|
34
|
+
{"type": "facts", "facts": {"Price": "$1,699 per device", "Memory": "32 GB", "Storage": "1 TB SSD", "Weight": "1.8 kg", "Battery": "Up to 10 hours", "Warranty": "3 years; next-business-day support"}},
|
|
35
|
+
{"type": "rating", "value": 4.6, "count": 94},
|
|
36
|
+
{"type": "actions", "actions": [{"type": "open_url", "label": "View Aurora Pro details", "url": "https://example.com/products/aurora-pro"}]}
|
|
37
|
+
]}
|
|
38
|
+
]},
|
|
39
|
+
{"type": "section", "title": "Decision guidance", "elements": [
|
|
40
|
+
{"type": "text", "text": "Choose Aurora Air when low weight and battery life matter most. Choose Aurora Pro when memory capacity and a larger workspace matter more than portability. Confirm compatibility with your organization's approved software and purchasing standards before placing an order."}
|
|
41
|
+
]}
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"expense_form": {
|
|
46
|
+
"design": "Start with the purpose and instructions; group related inputs into sections. Use a single submit button with a clear verb. IDs describe submitted fields. Defaults are included only when known. Descriptive text remains complete and wraps; input max_length is an explicit validation rule, not a text-shortening mechanism.",
|
|
47
|
+
"request": {
|
|
48
|
+
"title": "Submit an expense claim",
|
|
49
|
+
"elements": [
|
|
50
|
+
{"type": "text", "text": "Enter the details below and link to the receipt. Submission sends the values to your application's expense workflow; this card does not approve or reimburse the expense."},
|
|
51
|
+
{"type": "section", "title": "Expense details", "elements": [
|
|
52
|
+
{"type": "input_text", "id": "employee_name", "label": "Employee name", "required": True},
|
|
53
|
+
{"type": "input_date", "id": "expense_date", "label": "Expense date", "required": True},
|
|
54
|
+
{"type": "dropdown", "id": "category", "label": "Category", "options": [{"Travel": "travel"}, {"Meals": "meals"}, {"Equipment": "equipment"}], "placeholder": "Select a category", "required": True},
|
|
55
|
+
{"type": "input_number", "id": "amount", "label": "Amount (CAD)", "min": 0.01, "required": True},
|
|
56
|
+
{"type": "input_text", "id": "receipt_url", "label": "Receipt link", "format": "url", "placeholder": "https://…", "required": True}
|
|
57
|
+
]},
|
|
58
|
+
{"type": "section", "title": "Business purpose", "elements": [
|
|
59
|
+
{"type": "input_text", "id": "purpose", "label": "Explain why this expense was needed", "multiline": True, "required": True},
|
|
60
|
+
{"type": "input_toggle", "id": "confirmed", "label": "I confirm that these details are accurate", "required": True}
|
|
61
|
+
]}
|
|
62
|
+
],
|
|
63
|
+
"submit_label": "Submit expense claim"
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"weekly_business_review": {
|
|
67
|
+
"design": "Use compact columns for headline facts, a trend chart for change over time, a table for actionable exceptions, and a section for explanatory notes. Use full ISO dates for a line chart. Keep all numbers and narrative supplied by the user; don't infer omitted data points.",
|
|
68
|
+
"request": {
|
|
69
|
+
"title": "Weekly service review",
|
|
70
|
+
"elements": [
|
|
71
|
+
{"type": "text", "text": "Illustrative operations summary for the week ending 11 September 2026. Counts are taken from the reporting snapshot; reopened tickets remain included in the backlog."},
|
|
72
|
+
{"type": "columns", "columns": [
|
|
73
|
+
{"title": "Volume", "elements": [{"type": "facts", "facts": {"New requests": 142, "Resolved": 156}}]},
|
|
74
|
+
{"title": "Service", "elements": [{"type": "facts", "facts": {"SLA achieved": "96%", "Median response": "2.1 hours"}}]},
|
|
75
|
+
{"title": "Backlog", "elements": [{"type": "facts", "facts": {"Open requests": 38, "Older than 7 days": 6}}, {"type": "badge", "text": "Follow-up required", "tone": "warning"}]}
|
|
76
|
+
]},
|
|
77
|
+
{"type": "line", "title": "Requests resolved", "x_label": "Week ending", "y_label": "Requests", "series": [{"name": "Resolved", "values": [{"x": "2026-08-28", "y": 130}, {"x": "2026-09-04", "y": 148}, {"x": "2026-09-11", "y": 156}]}]},
|
|
78
|
+
{"type": "table", "title": "Items needing attention", "rows": [{"Item": "Access approvals", "Owner": "Service desk", "Next step": "Confirm the outstanding approvers and contact each requester with an updated timeline."}, {"Item": "Import failures", "Owner": "Applications team", "Next step": "Review the rejected records and document the correction before scheduling the next import."}]},
|
|
79
|
+
{"type": "progress_bar", "label": "Quarterly process improvements completed", "value": 7, "max": 10},
|
|
80
|
+
{"type": "section", "title": "Context", "elements": [{"type": "text", "text": "Resolution volume exceeded incoming demand this week, but six older requests still need individual follow-up. The improvement work remains in progress: seven of ten planned changes are complete, and the remaining three depend on testing and stakeholder review."}]}
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"approval_request": {
|
|
85
|
+
"design": "Present the complete request and decision context, then a comment input and explicit action buttons. Action data identifies the requested decision; the application authorizes and executes it. A nested actions element permits buttons within any section; only one explicit submit action set is needed.",
|
|
86
|
+
"request": {
|
|
87
|
+
"title": "Review a software renewal",
|
|
88
|
+
"elements": [
|
|
89
|
+
{"type": "badge", "text": "Awaiting review", "tone": "warning"},
|
|
90
|
+
{"type": "facts", "facts": {"Request": "REQ-1042", "Software": "Illustrative Analytics Suite", "Term": "12 months", "Cost": "$4,800 CAD", "Seats": 12}},
|
|
91
|
+
{"type": "text", "text": "The renewal maintains access for the reporting team while the replacement platform is assessed. The request includes twelve existing seats and no increase in the licensed user count. The owner has asked for a decision before the current term expires."},
|
|
92
|
+
{"type": "input_text", "id": "review_comment", "label": "Review comment", "multiline": True},
|
|
93
|
+
{"type": "actions", "actions": [{"type": "submit", "label": "Approve renewal", "data": {"request_id": "REQ-1042", "decision": "approve"}}, {"type": "submit", "label": "Request changes", "data": {"request_id": "REQ-1042", "decision": "request_changes"}}]}
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
BUSINESS_EXAMPLES["business_objectives_form"] = {
|
|
100
|
+
"design": "This reproduces the fully visible question in the user's reference image. The earlier industry options were outside the image and are not invented. Use question as the label, radio as the type, and options as complete strings. The form receives a Submit button automatically.",
|
|
101
|
+
"request": {
|
|
102
|
+
"questions": [{
|
|
103
|
+
"id": "business_objectives",
|
|
104
|
+
"type": "radio",
|
|
105
|
+
"options": [
|
|
106
|
+
"1. Grow recurring revenue",
|
|
107
|
+
"2. Increase average revenue per customer (ARPU)",
|
|
108
|
+
"3. Acquire new enterprise customers",
|
|
109
|
+
"4. Create strategic differentiation",
|
|
110
|
+
"5. Improve customer retention",
|
|
111
|
+
"6. Enter new markets"
|
|
112
|
+
],
|
|
113
|
+
"question": "3. Primary Business Objectives select one:"
|
|
114
|
+
}]
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
BUSINESS_EXAMPLES["kpi_dashboard"] = {
|
|
119
|
+
"design": "Status badge in the header, big-number metric tiles with coloured changes, a bar chart, and a table. Churn uses lower_is_better so a decrease is shown in green.",
|
|
120
|
+
"request": {
|
|
121
|
+
"title": "Weekly sales",
|
|
122
|
+
"subtitle": "Week ending 11 Sep 2026",
|
|
123
|
+
"status": "On track",
|
|
124
|
+
"elements": [
|
|
125
|
+
{"type": "metrics", "items": [
|
|
126
|
+
{"label": "Revenue", "value": "$48,200", "change": "+12%", "note": "vs last week"},
|
|
127
|
+
{"label": "Orders", "value": "312", "change": "-3%", "note": "vs last week"},
|
|
128
|
+
{"label": "Churn", "value": "2.1%", "change": "-0.4 pts", "lower_is_better": True}]},
|
|
129
|
+
{"type": "chart", "chart_type": "bar", "title": "Revenue by region", "data": {"North": 18200, "South": 12100, "West": 17900}},
|
|
130
|
+
{"type": "table", "title": "Top products", "rows": [{"Product": "Standing desk", "Units": 84, "Revenue": "$25,116"},
|
|
131
|
+
{"Product": "Task chair", "Units": 61, "Revenue": "$14,579"}]},
|
|
132
|
+
{"type": "progress", "label": "Quarterly target", "value": 68},
|
|
133
|
+
{"type": "buttons", "buttons": [{"label": "Open full report", "url": "https://example.com/reports/weekly"}]}
|
|
134
|
+
]
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
# What a small model often sends: Adaptive Card names, style keys, aliases,
|
|
139
|
+
# strings for numbers and dates, and a status word instead of a tone.
|
|
140
|
+
BUSINESS_EXAMPLES["messy_small_model_call"] = {
|
|
141
|
+
"design": "Not a pattern to copy: this shows the repairs. Every element renders; metadata.normalizations lists each fix.",
|
|
142
|
+
"request": {
|
|
143
|
+
"request": {
|
|
144
|
+
"Title": "Leave request",
|
|
145
|
+
"body": [
|
|
146
|
+
{"type": "TextBlock", "text": "Please review this request", "size": "Large", "weight": "Bolder"},
|
|
147
|
+
{"type": "FactSet", "facts": ["Employee: Priya Shah", "Dates: 14–18 Oct 2026", "Days: 5"]},
|
|
148
|
+
{"type": "Badge", "text": "Pending", "color": "yellow"},
|
|
149
|
+
{"type": "Input.Text", "label": "Comment for the employee", "isMultiline": "yes", "placeholder": "Optional"},
|
|
150
|
+
{"type": "DatePicker", "question": "Return date", "default": "October 21, 2026"},
|
|
151
|
+
{"type": "dropdown", "label": "Cover arranged by", "choices": "Alex, Sam, Jordan", "value": "sam"},
|
|
152
|
+
{"type": "ActionSet", "actions": [{"type": "Action.Submit", "title": "Approve"}, {"type": "Action.Submit", "title": "Reject"}]}
|
|
153
|
+
]
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
def get_example(name: str) -> dict:
|
|
161
|
+
"""Return a copy of an example specification for experimentation."""
|
|
162
|
+
return copy.deepcopy(BUSINESS_EXAMPLES[name]["request"])
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
def business_examples_doc() -> str:
|
|
166
|
+
parts = ["\nComplete composition examples (objects to place in request):"]
|
|
167
|
+
for name, example in BUSINESS_EXAMPLES.items():
|
|
168
|
+
parts.extend(["\n" + name + ": " + example["design"], json.dumps(example["request"], ensure_ascii=False, indent=2)])
|
|
169
|
+
return "\n".join(parts)
|