From bda754175fe857c128fce901a5c4cb6428e28edd Mon Sep 17 00:00:00 2001 From: Justin McReynolds Date: Thu, 14 Nov 2024 15:07:04 -0800 Subject: [PATCH] finesse display of llm cost --- static/ips/assets/js/llmChat.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/ips/assets/js/llmChat.js b/static/ips/assets/js/llmChat.js index 65314a01..1dacf4cb 100644 --- a/static/ips/assets/js/llmChat.js +++ b/static/ips/assets/js/llmChat.js @@ -99,7 +99,7 @@ async function sendMessage() { row.cells[1].textContent = data.content; // Response row.cells[2].textContent = promptTokens; // Prompt Tokens row.cells[3].textContent = completionTokens; // Completion Tokens - row.cells[4].textContent = costInput.toString() + " (in) + " + costOutput.toString() + " (out) = " + cost.toString(); + row.cells[4].textContent = costInput.toString(8) + " (in) + " + costOutput.toString(8) + " (out) = " + cost.toString(8); } catch (error) { console.error('Error sending message to LLM:', error); row.cells[1].textContent = 'Failed to get a response. Please try again.'; // Update response cell with error message