fix(openai): tolerate empty content in forced tool choice (#40148)
Signed-off-by: QwertyJack <7554089+QwertyJack@users.noreply.github.com> Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com> Co-authored-by: QwertyJack <7554089+QwertyJack@users.noreply.github.com> Co-authored-by: chaunceyjiang <chaunceyjiang@gmail.com>
This commit is contained in:
co-authored by
QwertyJack
chaunceyjiang
parent
df8e63f4ed
commit
6467213a9f
@@ -459,7 +459,8 @@ class DelegatingParser(Parser):
|
||||
(ToolChoiceFunction, ChatCompletionNamedToolChoiceParam),
|
||||
):
|
||||
# Forced Function Call
|
||||
assert content is not None
|
||||
if content is None:
|
||||
return [], None
|
||||
function_calls.append(
|
||||
FunctionCall(name=self._get_function_name(request), arguments=content)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user