a bit more progressive update and single turn

This commit is contained in:
karpathy
2025-11-22 15:24:47 -08:00
parent 827bfd3d3e
commit 87b4a178ec
5 changed files with 283 additions and 39 deletions

View File

@@ -71,6 +71,20 @@
font-size: 14px;
}
.stage-loading {
display: flex;
align-items: center;
gap: 12px;
padding: 16px;
margin: 12px 0;
background: #f9fafb;
border-radius: 8px;
border: 1px solid #e0e0e0;
color: #666;
font-size: 14px;
font-style: italic;
}
.spinner {
width: 20px;
height: 20px;

View File

@@ -71,13 +71,39 @@ export default function ChatInterface({
) : (
<div className="assistant-message">
<div className="message-label">LLM Council</div>
<Stage1 responses={msg.stage1} />
<Stage2
rankings={msg.stage2}
labelToModel={msg.metadata?.label_to_model}
aggregateRankings={msg.metadata?.aggregate_rankings}
/>
<Stage3 finalResponse={msg.stage3} />
{/* Stage 1 */}
{msg.loading?.stage1 && (
<div className="stage-loading">
<div className="spinner"></div>
<span>Running Stage 1: Collecting individual responses...</span>
</div>
)}
{msg.stage1 && <Stage1 responses={msg.stage1} />}
{/* Stage 2 */}
{msg.loading?.stage2 && (
<div className="stage-loading">
<div className="spinner"></div>
<span>Running Stage 2: Peer rankings...</span>
</div>
)}
{msg.stage2 && (
<Stage2
rankings={msg.stage2}
labelToModel={msg.metadata?.label_to_model}
aggregateRankings={msg.metadata?.aggregate_rankings}
/>
)}
{/* Stage 3 */}
{msg.loading?.stage3 && (
<div className="stage-loading">
<div className="spinner"></div>
<span>Running Stage 3: Final synthesis...</span>
</div>
)}
{msg.stage3 && <Stage3 finalResponse={msg.stage3} />}
</div>
)}
</div>
@@ -94,24 +120,26 @@ export default function ChatInterface({
<div ref={messagesEndRef} />
</div>
<form className="input-form" onSubmit={handleSubmit}>
<textarea
className="message-input"
placeholder="Ask your question... (Shift+Enter for new line, Enter to send)"
value={input}
onChange={(e) => setInput(e.target.value)}
onKeyDown={handleKeyDown}
disabled={isLoading}
rows={3}
/>
<button
type="submit"
className="send-button"
disabled={!input.trim() || isLoading}
>
Send
</button>
</form>
{conversation.messages.length === 0 && (
<form className="input-form" onSubmit={handleSubmit}>
<textarea
className="message-input"
placeholder="Ask your question... (Shift+Enter for new line, Enter to send)"
value={input}
onChange={(e) => setInput(e.target.value)}
onKeyDown={handleKeyDown}
disabled={isLoading}
rows={3}
/>
<button
type="submit"
className="send-button"
disabled={!input.trim() || isLoading}
>
Send
</button>
</form>
)}
</div>
);
}