feat: add get_ex_info method to lookup exception info

This commit is contained in:
Paul Gauthier (aider) 2024-11-07 12:45:29 -08:00
parent 8bc9ebf2aa
commit bba9ca3d5a

View file

@ -88,6 +88,10 @@ class LiteLLMExceptions:
def exceptions_tuple(self):
return tuple(self.exceptions)
def get_ex_info(self, ex):
"""Return the ExInfo for a given exception instance"""
return self.exceptions.get(ex.__class__)
litellm_ex = LiteLLMExceptions()