feat:add compaction and log token cost - #191
Kavya Sree Kaitepalli (KavyaSree2610) merged 6 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #191 +/- ##
==========================================
+ Coverage 68.52% 71.52% +2.99%
==========================================
Files 44 44
Lines 2821 2946 +125
==========================================
+ Hits 1933 2107 +174
+ Misses 888 839 -49
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Copilot add tests to make the patch coverage 100% |
…aths Co-authored-by: KavyaSree2610 <92566732+KavyaSree2610@users.noreply.github.com>
Added tests covering the uncovered patch lines in a34a9da — patch coverage is now 100% locally: (the remaining New tests:
|
Summary
OpenAIApiandAzureOpenAIApinow log input/output/total token counts returned by the Responses API after every call, warning whenusageis absent.context_management=[{"type": "compaction", ...}]with a configurablecompact_threshold(default 200k tokens). When the server compacts, the client rebuilds its local history around the returned compaction item and logs the event. Requiresopenai==3.17.0; adds a--debug-httpCLI flag for inspecting the underlyinghttpx2client.auto_memory/eval/swebenchverified.py.(ec4ffae)
twine check— The release failed withImportError: cannot import name 'errors' from 'packaging', becausepip install -e .downgraded twine 7.0's deps (packaging>=26.1,rich>=14.3.3). Bumpedpackagingto 26.3 andrichto 15.0.0, and moved thebuild/twineinstall after the project install.