Merge pull request #64 from janhq/fix/#36

fix: remove parsing json error and trim llm answer
This commit is contained in:
NamH 2023-09-05 21:24:59 -07:00 committed by GitHub
commit 57635b86fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -108,7 +108,6 @@ async function handleRequest(env: Env, request: Request) {
const content = obj.choices[0].delta.content;
if (content) deltaText = deltaText.concat(content);
} catch (e) {
console.log(e);
}
}
cachedChunk = "";
@ -118,7 +117,7 @@ async function handleRequest(env: Env, request: Request) {
const variables = {
id: messageBody.id,
data: {
content: answer,
content: answer.trim(),
},
};