mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-17 15:53:59 -06:00
fix: replies without reported token usage show an empty Info button (#33220)
A recent dev change marks a reply as having incomplete usage when the provider reports no token counts, so the session analytics can tell measured replies apart. The chat then treated that marker as usage and showed the Info button under every such reply, with a tooltip that only said "incomplete: true". The Info button now only appears when the reply carries actual usage data, while the stored marker stays as it is for analytics.
This commit is contained in:
@@ -1205,7 +1205,7 @@
|
||||
</Tooltip>
|
||||
{/if}
|
||||
|
||||
{#if message.usage && $visibleControls['chat.usage']}
|
||||
{#if Object.keys(message.usage ?? {}).some((key) => key !== 'incomplete') && $visibleControls['chat.usage']}
|
||||
{@const usage = JSON.stringify(message.usage, null, 2)
|
||||
.replace(/"([^(")"]+)":/g, '$1:')
|
||||
.slice(1, -1)
|
||||
|
||||
Reference in New Issue
Block a user