Skip to content

Commit d0c0d2c

Browse files
llm feedback: model selector (#93)
* Simplify LLM feedback code while maintaining core functionality - Streamlined UI with cleaner layout and better visual hierarchy - Reduced CSS by 70% using a simpler container-based approach - Simplified JavaScript from ~400 lines to ~130 lines - Improved state management and evolution logic - Maintained all core functionality including art generation, preview, and history Closes #91 Mentat precommits passed. Log: https://mentat.ai/log/ccb24099-4857-47b7-b5d7-d856a21c9041 * Update .gitignore with additional common patterns Added patterns for: - Yarn PnP files - Additional build output directory (out/) - General debug logs - OS-specific files (DS_Store, Thumbs.db) Mentat precommits passed. Log: https://mentat.ai/log/75248827-ef9b-4de6-9167-557d758749fb * Make .gitignore more comprehensive for all app types - Removed wildcard prefixes to work recursively at any depth - Added patterns for various build tools and frameworks - Added web-specific patterns for compiled assets - Added testing and temporary file patterns - Improved organization and categorization Mentat precommits passed. Log: https://mentat.ai/log/9478638d-b20e-4b73-a8ec-7dc7c7cfd202 * Update .gitignore to better handle subfolder apps - Added `**/` prefix to match files at any directory depth - Added patterns for Yarn 2+ cache files - Included vanilla HTML/JS specific patterns - Added more build output and test directories - Improved handling of OS-specific files at all levels Mentat precommits passed. Log: https://mentat.ai/log/4786f47d-56c8-44b6-bb53-1e2e7696062a * Revert "Make .gitignore more comprehensive for all app types" This reverts commit a424654. * enhance visual poetry UI and generation enhance visual poetry UI and generation - Update presets to focus on visual poetry styles (Apollinaire, Mallarmé, etc) - Improve monospace text display with better styling and dimensions - Add seed parameter for reproducible generations - Remove separate current art window in favor of preview - Enhance generation logic with better state management - Improve error handling and logging * Tweaks more prompts * add model selector --------- Co-authored-by: MentatBot <160964065+MentatBot@users.noreply.github.com>
1 parent fbd48ea commit d0c0d2c

File tree

1 file changed

+33
-10
lines changed

1 file changed

+33
-10
lines changed

llm-feedback/index.html

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@
2020
margin-bottom: 20px;
2121
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
2222
}
23+
select {
24+
width: 100%;
25+
padding: 8px;
26+
margin-bottom: 10px;
27+
border: 1px solid #ddd;
28+
border-radius: 4px;
29+
font-size: 16px;
30+
}
2331
.mono {
2432
font-family: 'Courier New', Courier, monospace;
2533
white-space: pre;
@@ -74,6 +82,7 @@
7482
<h1>LLM ASCII Art Evolution</h1>
7583

7684
<div class="container">
85+
<label for="preset-select">Select Preset:</label>
7786
<select id="preset-select">
7887
<option value="calligram">Calligrammatic Style (Apollinaire)</option>
7988
<option value="fragments">Fragmented Minimalism (Mallarmé)</option>
@@ -87,20 +96,18 @@ <h1>LLM ASCII Art Evolution</h1>
8796
<option value="weather">Weather System Patterns</option>
8897
</select>
8998

90-
<label>
91-
Animation Prompt:
92-
<textarea id="base-prompt" rows="4"></textarea>
93-
</label>
99+
<label for="base-prompt">Animation Prompt:</label>
100+
<textarea id="base-prompt" rows="4"></textarea>
94101

95102
<div>
96103
<button id="startBtn">Start Evolution</button>
97104
<button id="stopBtn" disabled>Stop Evolution</button>
98105
</div>
99106

100-
<label>
101-
Temperature:
102-
<input type="number" id="temperature" value="0.8" min="0.1" max="2" step="0.1">
103-
</label>
107+
<select id="model-select"></select>
108+
109+
<label for="temperature">Temperature:</label>
110+
<input type="range" id="temperature" min="0" max="2" step="0.1" value="0.8">
104111

105112
<label>
106113
Seed (optional):
@@ -172,9 +179,25 @@ <h2>History</h2>
172179
history: document.getElementById('history'),
173180
preset: document.getElementById('preset-select'),
174181
prompt: document.getElementById('base-prompt'),
175-
preview: document.getElementById('preview-window')
182+
preview: document.getElementById('preview-window'),
183+
modelSelect: document.getElementById('model-select')
176184
};
177185

186+
// Initialize model selector
187+
fetch('https://text.pollinations.ai/models')
188+
.then(r => r.json())
189+
.then(models => {
190+
elements.modelSelect.innerHTML = models
191+
.map(m => `<option value="${m.name}" ${m.name === 'openai' ? 'selected' : ''}>${m.name} - ${m.description}</option>`)
192+
.join('');
193+
})
194+
.catch(() => elements.modelSelect.innerHTML = '<option value="openai" selected>OpenAI (Default)</option>');
195+
196+
// Get selected model
197+
function getSelectedModel() {
198+
return elements.modelSelect.value;
199+
}
200+
178201
// State
179202
let isRunning = false;
180203
let frames = [];
@@ -229,7 +252,7 @@ <h2>History</h2>
229252
let seed = elements.seed.value ? parseInt(elements.seed.value) : Math.floor(Math.random() * 10);
230253
elements.seed.value = seed; // Update input with chosen seed
231254

232-
const url = `https://text.pollinations.ai/${encodedPrompt}?system=${encodedSystem}&seed=${seed}`;
255+
const url = `https://text.pollinations.ai/${encodedPrompt}?system=${encodedSystem}&seed=${seed}&model=${getSelectedModel()}`;
233256
console.log('Request URL:', url);
234257

235258
console.log('Fetching...');

0 commit comments

Comments
 (0)