mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-12 08:42:18 +00:00
fix(types): avoid mutable redaction return
This commit is contained in:
parent
d6fce94217
commit
0d5f0c44b5
1 changed files with 4 additions and 3 deletions
|
|
@ -5372,14 +5372,15 @@ def _parse_tool_call_arguments(raw: Any, tool_name: str | None, context: str) ->
|
|||
return raw
|
||||
if not isinstance(raw, str):
|
||||
return {}
|
||||
if raw == REDACTED_BY_LITELLM:
|
||||
return {}
|
||||
normalized_raw: Final = "{}" if raw == REDACTED_BY_LITELLM else raw
|
||||
from litellm.litellm_core_utils.prompt_templates.common_utils import (
|
||||
parse_tool_call_arguments,
|
||||
)
|
||||
|
||||
try:
|
||||
parsed: Final = parse_tool_call_arguments(raw, tool_name=tool_name, context=context)
|
||||
parsed: Final = parse_tool_call_arguments(
|
||||
normalized_raw, tool_name=tool_name, context=context
|
||||
)
|
||||
except ValueError as e:
|
||||
verbose_logger.warning("Failed to parse tool call arguments: %s", e)
|
||||
return {}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue