Structured outputs for regular replies; streaming can be enabled/disabled

This commit is contained in:
2026-03-01 19:25:15 -08:00
parent 15cffb3b66
commit 907a7caec6
7 changed files with 218 additions and 18 deletions

View File

@@ -249,11 +249,12 @@ async function onNewMessage(message: Message) {
// Check if provider supports streaming
const provider = state.provider!();
const useStreaming = provider.requestLLMResponseStreaming && state.llmconf!().streaming;
logInfo(
`[bot] Provider: ${provider.name()}, streaming supported: ${!!provider.requestLLMResponseStreaming}`
`[bot] Provider: ${provider.name()}, streaming supported: ${!!provider.requestLLMResponseStreaming}, streaming enabled: ${useStreaming}`
);
if (provider.requestLLMResponseStreaming) {
if (useStreaming) {
// Use streaming - accumulate all chunks, show only the delta (newest piece) in embed
let lastUpdateTime = Date.now();
const updateIntervalMs = 1500; // Update every ~1.5 seconds