feat: configure default max_tokens for anthropic translator#1933
feat: configure default max_tokens for anthropic translator#1933herewasmike wants to merge 10 commits intoenvoyproxy:mainfrom
Conversation
Signed-off-by: Mikhail Toldov <matoldov@gmail.com>
0247bb7 to
dbd525e
Compare
|
Related Documentation 3 document(s) may need updating based on files changed in this PR: Envoy's Space gcp-vertexai
|
Signed-off-by: Mikhail Toldov <matoldov@gmail.com>
|
I'm not sure if arbitrary default value + bodyMutator is the best approach. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1933 +/- ##
==========================================
- Coverage 84.33% 84.33% -0.01%
==========================================
Files 130 130
Lines 17987 17986 -1
==========================================
- Hits 15170 15169 -1
Misses 1873 1873
Partials 944 944 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
it returns 400 Bad Request |
|
This might be a bit confusing if low default is observed by default. Isn't it better for the client to be aware of and use the right values? Are you using a client where it is not configurable? |
|
Yes, I'm connecting 3rd party code in this particular case so it's not easy to change the client's behavior.
|
Signed-off-by: Mikhail Toldov <matoldov@gmail.com>
284e5be to
b5efeb0
Compare
b5efeb0 to
284e5be
Compare
Signed-off-by: Mikhail Toldov <matoldov@gmail.com>
Signed-off-by: Mikhail Toldov <matoldov@gmail.com>
284e5be to
2810ba3
Compare
|
/retest |
Description
max_tokens and max_completion_tokens are optional in openAI spec
https://developers.openai.com/api/reference/resources/chat/subresources/completions/methods/create
However when I try to send the request from the source I get 422 if my AIServiceBackend has AWSAnthropic schema.
It's impossible to add this field with bodyMutation due to ordering (I've considered mutating body before the translation but it seems to be a whole redesign rather than small fix with providing default)
Special notes for reviewers (if applicable)
Per gen AI policy I disclose that claude did help me with setting up this PR