diff --git a/src/celeste/constraints.py b/src/celeste/constraints.py index 31befbb..eb5b3da 100644 --- a/src/celeste/constraints.py +++ b/src/celeste/constraints.py @@ -382,8 +382,11 @@ def __call__(self, value: list) -> list: """Validate tools list against supported tools.""" for item in value: if isinstance(item, Tool) and type(item) not in self.tools: - supported = [t.__name__ for t in self.tools] - msg = f"Tool '{type(item).__name__}' not supported. Supported: {supported}" + if self.tools: + supported = [t.__name__ for t in self.tools] + msg = f"Tool '{type(item).__name__}' not supported. Supported: {supported}" + else: + msg = f"Tool '{type(item).__name__}' is not supported by this model" raise ConstraintViolationError(msg) return value diff --git a/src/celeste/protocols/chatcompletions/parameters.py b/src/celeste/protocols/chatcompletions/parameters.py index d6f2493..92b098d 100644 --- a/src/celeste/protocols/chatcompletions/parameters.py +++ b/src/celeste/protocols/chatcompletions/parameters.py @@ -99,7 +99,7 @@ def map( if isinstance(item, Tool): mapper = dispatch.get(type(item)) if mapper is None: - msg = f"Tool '{type(item).__name__}' is not supported by this provider" + msg = f"Tool '{type(item).__name__}' is not supported by Chat Completions" raise ValueError(msg) tools.append(mapper.map_tool(item)) elif isinstance(item, dict) and "name" in item: