Skip to content

Commit

Permalink
finesse llm cost display
Browse files Browse the repository at this point in the history
  • Loading branch information
mcjustin committed Nov 14, 2024
1 parent bda7541 commit 5c1faea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion static/ips/assets/js/llmChat.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(8) + " (in) + " + costOutput.toString(8) + " (out) = " + cost.toString(8);
row.cells[4].textContent = costInput.toString().substring(0,7) + " (in) + " + costOutput.toString().substring(0,7) + " (out) = " + cost.toString().substring(0,7);
} 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
Expand Down

0 comments on commit 5c1faea

Please sign in to comment.