Fix streaming issue for LLM instruction blocks (#5382)
This commit is contained in:
parent
b7dfa4c278
commit
b2404801d1
@ -23,13 +23,17 @@ async function executeLLMInstruction(config, context) {
|
|||||||
if (typeof input === "object") input = JSON.stringify(input);
|
if (typeof input === "object") input = JSON.stringify(input);
|
||||||
if (typeof input !== "string") input = String(input);
|
if (typeof input !== "string") input = String(input);
|
||||||
|
|
||||||
|
let completion;
|
||||||
const provider = aibitat.getProviderForConfig(aibitat.defaultProvider);
|
const provider = aibitat.getProviderForConfig(aibitat.defaultProvider);
|
||||||
const completion = await provider.complete([
|
if (provider.supportsAgentStreaming) {
|
||||||
{
|
completion = await provider.stream(
|
||||||
role: "user",
|
[{ role: "user", content: input }],
|
||||||
content: input,
|
[],
|
||||||
},
|
null
|
||||||
]);
|
);
|
||||||
|
} else {
|
||||||
|
completion = await provider.complete([{ role: "user", content: input }]);
|
||||||
|
}
|
||||||
|
|
||||||
introspect(`Successfully received LLM response`);
|
introspect(`Successfully received LLM response`);
|
||||||
if (resultVariable) config.resultVariable = resultVariable;
|
if (resultVariable) config.resultVariable = resultVariable;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user