Merge branch 'nate/track-session-cost-and-usage' of https://github.com/continuedev/continue into nate/track-session-cost-and-usage
This commit is contained in:
commit
f969e7df2d
1 changed files with 18 additions and 0 deletions
|
|
@ -322,6 +322,15 @@ export function createSession(history: ChatHistoryItem[] = []): Session {
|
|||
title: DEFAULT_SESSION_TITLE,
|
||||
workspaceDirectory: process.cwd(),
|
||||
history,
|
||||
usage: {
|
||||
totalCost: 0,
|
||||
promptTokens: 0,
|
||||
completionTokens: 0,
|
||||
promptTokensDetails: {
|
||||
cachedTokens: 0,
|
||||
cacheWriteTokens: 0,
|
||||
},
|
||||
},
|
||||
};
|
||||
SessionManager.getInstance().setSession(session);
|
||||
return session;
|
||||
|
|
@ -553,6 +562,15 @@ export function startNewSession(history: ChatHistoryItem[] = []): Session {
|
|||
title: DEFAULT_SESSION_TITLE,
|
||||
workspaceDirectory: process.cwd(),
|
||||
history,
|
||||
usage: {
|
||||
totalCost: 0,
|
||||
promptTokens: 0,
|
||||
completionTokens: 0,
|
||||
promptTokensDetails: {
|
||||
cachedTokens: 0,
|
||||
cacheWriteTokens: 0,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
manager.setSession(newSession);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue