Skip to content

Commit

Permalink
generalize the exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Hk669 committed Jan 5, 2025
1 parent cff4e65 commit 7fae546
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions autogen/exception_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,14 @@ def __init__(self, message: str = "The provided agents list does not overlap wit
super().__init__(self.message)


class O1ModelToolNotSupportedError(Exception):
"""Exception raised when tools are used with o1 models."""
class ModelToolNotSupportedError(Exception):
"""
Exception raised when attempting to use tools with models that do not support them.
"""

def __init__(
self,
message: str = "Tools are not supported with O1 models. Refer to the documentation at https://platform.openai.com/docs/guides/reasoning#limitations",
model: str,
):
self.message = message
self.message = f"Tools are not supported with {model} models. Refer to the documentation at https://platform.openai.com/docs/guides/reasoning#limitations"
super().__init__(self.message)

0 comments on commit 7fae546

Please sign in to comment.