Update packages/trace-viewer/src/ui/aiTab.tsx

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Simon Knott <info@simonknott.de>
This commit is contained in:
Simon Knott 2025-02-11 16:09:58 +01:00 committed by GitHub
parent 10b2c89637
commit 5884946d8c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -41,15 +41,15 @@ export function AITab({ state }: { state?: AIState }) {
return { ...message, content };
})
const response = await fetch('./llm/chat-completion', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(hydratedMessages),
signal: controller.signal,
});
try {
const response = await fetch('./llm/chat-completion', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(hydratedMessages),
signal: controller.signal,
});
const decoder = new TextDecoder();
let reply = '';
function update() {