final updates

This commit is contained in:
Developers Digest
2025-08-08 11:13:52 -04:00
parent 6081a9f50a
commit efdef874d7
6 changed files with 54 additions and 36 deletions
+2 -9
View File
@@ -1151,9 +1151,7 @@ CRITICAL: When files are provided in the context:
const isOpenAI = model.startsWith('openai/gpt-5');
const modelProvider = isAnthropic ? anthropic : (isOpenAI ? openai : groq);
const actualModel = isAnthropic ? model.replace('anthropic/', '') :
(model === 'openai/gpt-5') ? 'gpt-5' :
(model === 'openai/gpt-5-nano') ? 'gpt-5-nano' :
(model === 'openai/gpt-5-mini') ? 'gpt-5-mini' : model;
(model === 'openai/gpt-5') ? 'gpt-5' : model;
// Make streaming API call with appropriate provider
const streamOptions: any = {
@@ -1231,14 +1229,9 @@ It's better to have 3 complete files than 10 incomplete files.`
// Add reasoning effort for GPT-5 models
if (isOpenAI) {
let reasoningEffort = 'medium'; // default for gpt-5-nano and gpt-5-mini
if (model === 'openai/gpt-5') {
reasoningEffort = 'high';
}
streamOptions.experimental_providerMetadata = {
openai: {
reasoningEffort: reasoningEffort
reasoningEffort: 'high'
}
};
}
+42
View File
@@ -3247,6 +3247,48 @@ Focus on the key sections and content, making it clean and modern.`;
</div>
)}
</div>
{/* Live streaming response display */}
{generationProgress.streamedCode && (
<motion.div
initial={{ opacity: 0, height: 0 }}
animate={{ opacity: 1, height: 'auto' }}
exit={{ opacity: 0, height: 0 }}
transition={{ duration: 0.3 }}
className="mt-3 border-t border-gray-300 pt-3"
>
<div className="flex items-center gap-2 mb-2">
<div className="flex items-center gap-1">
<div className="w-2 h-2 bg-green-500 rounded-full animate-pulse" />
<span className="text-xs font-medium text-gray-600">AI Response Stream</span>
</div>
<div className="flex-1 h-px bg-gradient-to-r from-gray-300 to-transparent" />
</div>
<div className="bg-gray-900 border border-gray-700 rounded max-h-32 overflow-y-auto scrollbar-hide">
<SyntaxHighlighter
language="jsx"
style={vscDarkPlus}
customStyle={{
margin: 0,
padding: '0.75rem',
fontSize: '11px',
lineHeight: '1.5',
background: 'transparent',
maxHeight: '8rem',
overflow: 'hidden'
}}
>
{(() => {
const lastContent = generationProgress.streamedCode.slice(-1000);
// Show the last part of the stream, starting from a complete tag if possible
const startIndex = lastContent.indexOf('<');
return startIndex !== -1 ? lastContent.slice(startIndex) : lastContent;
})()}
</SyntaxHighlighter>
<span className="inline-block w-2 h-3 bg-orange-400 ml-3 mb-3 animate-pulse" />
</div>
</motion.div>
)}
</div>
)}
</div>