Fix streaming issue for LLM instruction blocks (#5382)

This commit is contained in:
Timothy Carambat
2026-04-07 12:03:07 -07:00
committed by GitHub
parent b7dfa4c278
commit b2404801d1

View File

@@ -23,13 +23,17 @@ async function executeLLMInstruction(config, context) {
if (typeof input === "object") input = JSON.stringify(input);
if (typeof input !== "string") input = String(input);
let completion;
const provider = aibitat.getProviderForConfig(aibitat.defaultProvider);
const completion = await provider.complete([
{
role: "user",
content: input,
},
]);
if (provider.supportsAgentStreaming) {
completion = await provider.stream(
[{ role: "user", content: input }],
[],
null
);
} else {
completion = await provider.complete([{ role: "user", content: input }]);
}
introspect(`Successfully received LLM response`);
if (resultVariable) config.resultVariable = resultVariable;