feat: support topk
Describe the change
TopK is well-used paramater for provider which uses OpenAI-compatible API format. This commit add the top_k parameter.
Provide OpenAI documentation link Provide a relevant API doc from https://platform.openai.com/docs/api-reference
Describe your solution
Add top_k as new parameter
Tests
Additional context
Some evidence that top_k is well used
- https://openrouter.ai/docs/api-reference/parameters
- https://docs.vllm.ai/en/v0.6.4/dev/sampling_params.html
Issue: #641
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 85.93%. Comparing base (
6181fac) to head (203eb5a). Report is 8 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #989 +/- ##
=======================================
Coverage 85.93% 85.93%
=======================================
Files 43 43
Lines 2268 2268
=======================================
Hits 1949 1949
Misses 300 300
Partials 19 19
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
@KevinZonda also need to add top_k for ChatCompletionRequest
@sashabaranov Please have a look. Sametimes, we need the top_k