Skip to content

Commit

Permalink
perf: detail=false, not response variable update (#1419)
Browse files Browse the repository at this point in the history
  • Loading branch information
c121914yu authored May 9, 2024
1 parent af4c732 commit 6463427
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/service/core/ai/embedding/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
10 changes: 5 additions & 5 deletions projects/app/src/pages/api/v1/chat/completions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,13 +288,13 @@ 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,
Expand Down

0 comments on commit 6463427

Please sign in to comment.