Merge pull request #2856 from lazyhope/anthropic-tools-use-2024-04-04

Support latest Anthropic Tools Use (2024-04-04)
This commit is contained in:
Krish Dholakia 2024-04-05 14:31:26 -07:00 committed by GitHub
commit a50edef1e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 231 additions and 59 deletions

View file

@ -207,6 +207,8 @@ def map_finish_reason(
return "stop"
elif finish_reason == "max_tokens": # anthropic
return "length"
elif finish_reason == "tool_use": # anthropic
return "tool_calls"
return finish_reason