Skip to content

Commit f94dcbd

Browse files
fix: improve agent chat styling and add sentence case to prompt (#55)
- Revert to Inter sans-serif font for response content - Fix bullet/numbering list rendering with explicit list-style-type - Add sentence case instruction to agent system prompt - Remove typing animation
1 parent 6300744 commit f94dcbd

File tree

2 files changed

+27
-46
lines changed

2 files changed

+27
-46
lines changed

docs/src/app/globals.css

Lines changed: 22 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&family=Source+Serif+4:ital,wght@0,400;0,500;0,600;1,400&display=swap');
1+
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');
22
@import "tailwindcss";
33

44
@theme {
@@ -103,43 +103,14 @@ code {
103103

104104
/* Agent response content */
105105
.response-content {
106-
font-family: "Source Serif 4", Georgia, serif;
107-
font-size: 17px;
108-
line-height: 1.75;
106+
font-family: var(--font-inter), -apple-system, BlinkMacSystemFont, sans-serif;
107+
font-size: 15px;
108+
line-height: 1.7;
109109
color: #1e293b;
110110
-webkit-font-smoothing: antialiased;
111111
}
112-
113-
/* Typing animation */
114-
@keyframes typeIn {
115-
from {
116-
opacity: 0;
117-
transform: translateY(4px);
118-
}
119-
to {
120-
opacity: 1;
121-
transform: translateY(0);
122-
}
123-
}
124-
125-
.response-content > * {
126-
animation: typeIn 0.3s ease-out forwards;
127-
opacity: 0;
128-
}
129-
130-
.response-content > *:nth-child(1) { animation-delay: 0ms; }
131-
.response-content > *:nth-child(2) { animation-delay: 50ms; }
132-
.response-content > *:nth-child(3) { animation-delay: 100ms; }
133-
.response-content > *:nth-child(4) { animation-delay: 150ms; }
134-
.response-content > *:nth-child(5) { animation-delay: 200ms; }
135-
.response-content > *:nth-child(6) { animation-delay: 250ms; }
136-
.response-content > *:nth-child(7) { animation-delay: 300ms; }
137-
.response-content > *:nth-child(8) { animation-delay: 350ms; }
138-
.response-content > *:nth-child(9) { animation-delay: 400ms; }
139-
.response-content > *:nth-child(10) { animation-delay: 450ms; }
140-
.response-content > *:nth-child(n+11) { animation-delay: 500ms; }
141112
.response-content p {
142-
margin: 0.875em 0;
113+
margin: 0.75em 0;
143114
}
144115
.response-content p:first-child {
145116
margin-top: 0;
@@ -157,10 +128,10 @@ code {
157128
line-height: 1.3;
158129
}
159130
.response-content h1 {
160-
font-size: 1.25em;
131+
font-size: 1.2em;
161132
}
162133
.response-content h2 {
163-
font-size: 1.125em;
134+
font-size: 1.1em;
164135
}
165136
.response-content h3 {
166137
font-size: 1em;
@@ -174,16 +145,25 @@ code {
174145
font-weight: 600;
175146
color: #0f172a;
176147
}
177-
.response-content ul,
148+
.response-content ul {
149+
margin: 0.75em 0;
150+
padding-left: 1.25em;
151+
list-style-type: disc;
152+
}
178153
.response-content ol {
179-
margin: 0.875em 0;
180-
padding-left: 1.5em;
154+
margin: 0.75em 0;
155+
padding-left: 1.25em;
156+
list-style-type: decimal;
181157
}
182158
.response-content li {
183-
margin: 0.375em 0;
159+
margin: 0.35em 0;
160+
padding-left: 0.25em;
184161
}
185-
.response-content li::marker {
186-
color: #64748b;
162+
.response-content ul ul {
163+
list-style-type: circle;
164+
}
165+
.response-content ul ul ul {
166+
list-style-type: square;
187167
}
188168
.response-content code {
189169
font-family: "JetBrains Mono", ui-monospace, monospace;

src/policyengine_api/agent_sandbox.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,11 @@
4949
5050
Follow PolicyEngine's writing style:
5151
52-
1. **Active voice**: "The reform reduces poverty by 3.2%" not "Poverty is reduced by 3.2%"
53-
2. **Quantitative precision**: Use specific numbers, avoid vague words like "significantly" or "substantially"
54-
3. **Neutral tone**: Describe what policies do, not whether they're good or bad
55-
4. **Tables for data**: Present breakdowns and comparisons in markdown tables
52+
1. **Sentence case**: Use sentence case for all headings (e.g. "Tax breakdown" not "Tax Breakdown")
53+
2. **Active voice**: "The reform reduces poverty by 3.2%" not "Poverty is reduced by 3.2%"
54+
3. **Quantitative precision**: Use specific numbers, avoid vague words like "significantly" or "substantially"
55+
4. **Neutral tone**: Describe what policies do, not whether they're good or bad
56+
5. **Tables for data**: Present breakdowns and comparisons in markdown tables
5657
5758
Example response format:
5859
| Item | Amount |

0 commit comments

Comments
 (0)