diff --git a/src/lib/Chat.svelte b/src/lib/Chat.svelte
index 760cbcd..5c4baed 100644
--- a/src/lib/Chat.svelte
+++ b/src/lib/Chat.svelte
@@ -17,7 +17,10 @@
updateChatSettings,
resetChatSettings,
setChatSettingValue,
- addChatFromJSON
+ addChatFromJSON,
+
+ updateRunningTotal
+
} from './Storage.svelte'
import { getChatSettingObjectByKey, getChatSettingList, getRequestSettingList } from './Settings.svelte'
import {
@@ -59,6 +62,7 @@
import { v4 as uuidv4 } from 'uuid'
import { exportChatAsJSON, exportProfileAsJSON } from './Export.svelte'
import { clickOutside } from 'svelte-use-click-outside'
+ import { getPrice } from './Stats.svelte';
// This makes it possible to override the OpenAI API base URL in the .env file
const apiBase = import.meta.env.VITE_API_BASE || 'https://api.openai.com'
@@ -86,9 +90,10 @@
$: chatSettings = chat.settings
$: globalStore = $globalStorage
+ // Make sure chat object is ready to go
+ updateChatSettings(chatId)
+
onMount(async () => {
- // Make sure chat object is ready to go
- updateChatSettings(chatId)
// Focus the input on mount
focusInput()
@@ -147,7 +152,6 @@
const sendRequest = async (messages: Message[], doingSummary?:boolean, withSummary?:boolean): Promise
+ {model} total {usage.total_tokens} + tokens ~= ${getPrice(usage, model).toFixed(6)} +
+ {/each} +System Prompt
+ {:else if message.usage} -- This message was generated on {message.model || defaultModel} using {message.usage.total_tokens} +
{/if} @@ -158,6 +162,11 @@ {/key}