mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-06 03:00:16 -04:00
feat(copilot+canvas rendering): add context window tracking to copilot and selectively render canvas components (#1622)
* Copilot context window * Fix pill * Speed up canvas * Fix react hook bug * Context pill div
This commit is contained in:
committed by
GitHub
parent
3dd36a8a35
commit
6f3df271fd
@@ -463,6 +463,8 @@ export async function POST(req: NextRequest) {
|
||||
logger.debug(`[${tracker.requestId}] Sent initial chatId event to client`)
|
||||
}
|
||||
|
||||
// Note: context_usage events are forwarded from sim-agent (which has accurate token counts)
|
||||
|
||||
// Start title generation in parallel if needed
|
||||
if (actualChatId && !currentChat?.title && conversationHistory.length === 0) {
|
||||
generateChatTitle(message)
|
||||
@@ -594,6 +596,7 @@ export async function POST(req: NextRequest) {
|
||||
lastSafeDoneResponseId = responseIdFromDone
|
||||
}
|
||||
}
|
||||
// Note: context_usage events are forwarded from sim-agent
|
||||
break
|
||||
|
||||
case 'error':
|
||||
|
||||
Reference in New Issue
Block a user