Build applications that make decisions (chatbots, agents, simulations, etc...). Monitor, trace, persist, and execute on your own infrastructure.
Python aiburrchatbot-frameworkdagsgenerative-aigraphshacktoberfestllmopsllmsmlopspersistent-data-structurestate-machinestate-managementvisibility
Turns off displaying cost for now
Stefan Krawczyk0e8138cd5230
diff --git a/telemetry/ui/src/components/routes/app/InsightsView.tsx b/telemetry/ui/src/components/routes/app/InsightsView.tsxindex 1c85c7a3..ab843c7c 100644--- a/telemetry/ui/src/components/routes/app/InsightsView.tsx+++ b/telemetry/ui/src/components/routes/app/InsightsView.tsx@@ -1,11 +1,15 @@import { Step } from '../../../api';export const InsightsView = (props: { steps: Step[] }) => {+ // TODO: (1) ingest model costs from some static file.+ // TODO: (2) track costs on a per model basis.+ // TODO: (3) visualize / surface that.+// Initialize a variable to hold the total sumlet totalPromptTokens = 0;let totalCompletionTokens = 0;- const openaiPromptTokenCost = 500 / 1_000_000;- const openaiCompletionTokenCost = 1500 / 1_000_000;+ // const openaiPromptTokenCost = 500 / 1_000_000;+ // const openaiCompletionTokenCost = 1500 / 1_000_000;let totalLLMCalls = 0;// Iterate over each step@@ -27,18 +31,20 @@ export const InsightsView = (props: { steps: Step[] }) => {}});- const totalCost =- (totalPromptTokens * openaiPromptTokenCost +- totalCompletionTokens * openaiCompletionTokenCost) /- 100.0;+ // Skip for now+ // const totalCost =+ // (totalPromptTokens * openaiPromptTokenCost ++ // totalCompletionTokens * openaiCompletionTokenCost) /+ // 100.0;if (totalLLMCalls > 0) {// Display the total sum+ // Skip cost forreturn (<div><h2>Total Prompt Tokens: {totalPromptTokens}</h2><h2>Total Completion Tokens: {totalCompletionTokens}</h2>- <h2>Total Cost: ${totalCost}</h2>+ {/*<h2>Total Cost: ${totalCost}</h2>*/}<h2>Total LLM Calls: {totalLLMCalls}</h2></div>);