From 32ebfba5ed7810ead375c613ee2419e167ba831c Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Tue, 25 Aug 2026 12:03:51 -0700 Subject: [PATCH] refactor(together_ai): build the trimmed supported-params list without mutating the inherited list --- litellm/llms/together_ai/chat/transformation.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/litellm/llms/together_ai/chat/transformation.py b/litellm/llms/together_ai/chat/transformation.py index eb0954bceef..88fd79f2366 100644 --- a/litellm/llms/together_ai/chat/transformation.py +++ b/litellm/llms/together_ai/chat/transformation.py @@ -30,10 +30,9 @@ class TogetherAIChatConfig(OpenAIGPTConfig): verbose_logger.debug( "Only some together models support function calling/response_format. Docs - https://docs.together.ai/docs/function-calling" ) - for param in FUNCTION_CALLING_ONLY_PARAMS: - if param in supported_params: - supported_params.remove(param) - return supported_params + return [ # mutable-ok: the inherited contract returns a plain list; building fresh avoids mutating the base class's value + param for param in supported_params if param not in FUNCTION_CALLING_ONLY_PARAMS + ] def map_openai_params( self,