chore(lint): use a PEP 604 union for the flat tool_choice helper (UP007)
Some checks failed
LiteLLM Rust / rustfmt, clippy, test (push) Has been cancelled

This commit is contained in:
mateo-berri 2026-08-01 17:13:15 -07:00
parent 23d26d5e64
commit eea9bb1497

View file

@ -141,7 +141,7 @@ def _tool_call_dict_from_output_item(item: Mapping[str, Any], index: int) -> _Ch
return tool_call_dict
def _flat_responses_tool_choice(choice_type: str, name: str) -> Union[ToolChoiceFunctionParam, ToolChoiceCustomParam]:
def _flat_responses_tool_choice(choice_type: str, name: str) -> ToolChoiceFunctionParam | ToolChoiceCustomParam:
if choice_type == "custom":
return ToolChoiceCustomParam(type="custom", name=name)
return ToolChoiceFunctionParam(type="function", name=name)