Commit 6463427d by Archer Committed by GitHub

perf: detail=false, not response variable update (#1419)

parent af4c732d
......@@ -32,7 +32,7 @@ export async function getVectorsByText({ model, input, type }: GetVectorProps) {
})
.then(async (res) => {
if (!res.data) {
return Promise.reject('Embedding API 404');
return Promise.reject('Embedding API is not responding');
}
if (!res?.data?.[0]?.embedding) {
console.log(res);
......
......@@ -288,15 +288,15 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
event: detail ? SseResponseEventEnum.answer : undefined,
data: '[DONE]'
});
responseWrite({
res,
event: SseResponseEventEnum.updateVariables,
data: JSON.stringify(newVariables)
});
if (responseDetail && detail) {
responseWrite({
res,
event: SseResponseEventEnum.updateVariables,
data: JSON.stringify(newVariables)
});
responseWrite({
res,
event: SseResponseEventEnum.flowResponses,
data: JSON.stringify(feResponseData)
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment