feat(tui): add verbose turn token usage (#39281)
This commit is contained in:
parent
1be6d94267
commit
4d59b059ee
5 changed files with 70 additions and 6 deletions
|
|
@ -77,6 +77,7 @@ export function DevToolsBar() {
|
|||
const runtime = createMemo(() => runtimeStatus(frontendSamples()))
|
||||
const timing = () => config.data.debug?.timing ?? false
|
||||
const turnTokens = () => config.data.debug?.turn_tokens ?? false
|
||||
const verboseTurnTokens = () => turnTokens() === "verbose"
|
||||
|
||||
const offEscape = keymap.intercept(
|
||||
"key",
|
||||
|
|
@ -380,6 +381,16 @@ export function DevToolsBar() {
|
|||
>
|
||||
{turnTokens() ? "[x]" : "[ ]"} Turn token usage
|
||||
</Action>
|
||||
<Action
|
||||
onClick={() =>
|
||||
void config.update((draft) => {
|
||||
draft.debug = { ...draft.debug, turn_tokens: verboseTurnTokens() ? true : "verbose" }
|
||||
})
|
||||
}
|
||||
hoverBackground
|
||||
>
|
||||
{verboseTurnTokens() ? "[x]" : "[ ]"} Turn token usage (verbose)
|
||||
</Action>
|
||||
</box>
|
||||
<For each={groups()}>
|
||||
{(group) => (
|
||||
|
|
|
|||
|
|
@ -254,8 +254,8 @@ export const settings: Setting[] = [
|
|||
category: "Debug",
|
||||
path: ["debug", "turn_tokens"],
|
||||
default: false,
|
||||
values: [false, true],
|
||||
labels: ["off", "on"],
|
||||
values: [false, true, "verbose"],
|
||||
labels: ["off", "on", "verbose"],
|
||||
keywords: ["tokens", "usage", "debug"],
|
||||
},
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue