Repository navigation
model/openai: clarify token tailoring opt-in requirements - #2720
Conversation
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2720 +/- ##
===================================================
- Coverage 90.26596% 90.26298% -0.00299%
===================================================
Files 1291 1291
Lines 234394 234394
===================================================
- Hits 211578 211571 -7
- Misses 14232 14240 +8
+ Partials 8584 8583 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
What changed
Clarify in OpenAI option Godoc and the English/Chinese model guides that automatic token tailoring is disabled by default and requires
WithEnableTokenTailoring(true). SettingWithMaxInputTokensorWithContextWindowalone does not enable trimming before provider requests.Why
Configuring an input limit or context window can be mistaken for enabling automatic trimming. The documentation also distinguishes that opt-in behavior from exposing the budget and window to other framework consumers, including summary processing.
Testing
git diff --checkpassed.gofmt -l model/openai/options.goreported no formatting changes.go test ./...: all packages passed excepttool/duckduckgo, whose Unix socket test failed because the macOS default temporary path exceeded the socket path limit. The affectedmodel/openaipackage passed.tool/duckduckgopackage with a shorter temporary directory; it passed.Notes for reviewers
Documentation only; runtime behavior, API signatures, and defaults are unchanged.