Expose token usage from openAIResponsesAdapter
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- typescript
- Domain
- api
Research direction
Start by locating openAIResponsesAdapter and reading how it handles streamed response events. Check how response.completed exposes response.usage, then compare the adapter with the referenced openAIResponseAdapter. Done means an optional onUsage callback receives input_tokens, output_tokens, and total_tokens; an open pull request is already linked to this issue.
Written by the indexing model from the issue text.
Description
Is your feature request related to a problem? Please describe.
openAIResponsesAdapter() currently ignores response.completed, including response.usage.
Describe the solution you'd like
Could the adapter expose an optional callback?
openAIResponsesAdapter({
onUsage: (usage) => {
// input_tokens, output_tokens, total_tokens
},
});
This would let applications display token usage or estimated remaining context without implementing a custom stream adapter.
Describe alternatives you've considered
Local adapter that wraps/forks openAIResponseAdapter
Additional context
This would help implement a context available/used counter in the composer
- Dominant language
- TypeScript
- Stars
- 10k
- Forks
- 698
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 133
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from thesysdev/openui
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
thesysdev/openui#1445 · 2 comments ·
Maintainers usually reply within 1 day
-
Add dataInvention flag to PromptOptions to disable the 'generate realistic/plausible data' ruleOpen
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
thesysdev/openui#959 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 18/100
thesysdev/openui#1528 · 1 reaction ·
Maintainers usually reply within 1 day
All issues in thesysdev/openui
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
bug needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
DSpace/dspace-angular#6511 ·
Maintainers usually reply within 1 day
-
area: frontend area:byok bug severity:low
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Phone app shows Unknown for a remote machine whose key changedPossibly taken @janicduplessis claimed this today. Openarea: mobile priority: P3 type: bug
Difficulty 1/5 Under an hour Newbie friendliness 78/100
appandflow/stim#5006 · 1 comment ·
Maintainers usually reply within 1 day
-
Area - Local to Cloud Bug
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
microsoft/vscode-mssql#23209 ·
Maintainers usually reply within 1 day