Move tool definitions from system prompt to parameter and refactor tool calling parse

This commit is contained in:
Zihao Li 2024-04-05 16:01:40 +08:00
parent b0d80de14d
commit d2cf9d2cf1
2 changed files with 38 additions and 45 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