Fix mypy type error in fireworks_ai transformation (#20391)

Cast message to dict before calling pop() to satisfy mypy's type checker.
The message is typed as a Union of TypedDicts which don't have the
'provider_specific_fields' key, but the runtime check already confirms
it's a dict with this key.
This commit is contained in:
shin-bot-litellm
2026-02-04 15:44:45 -08:00
committed by GitHub
parent d2e113111f
commit d1994a148d
@@ -239,7 +239,7 @@ class FireworksAIConfig(OpenAIGPTConfig):
# Remove fields not permitted by FireworksAI that may cause:
# "Not permitted, field: 'messages[n].provider_specific_fields'"
if isinstance(message, dict) and "provider_specific_fields" in message:
message.pop("provider_specific_fields", None)
cast(dict, message).pop("provider_specific_fields", None)
return messages