mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-22 08:24:12 +00:00
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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user