|
6 | 6 |
|
7 | 7 | from attrs import NOTHING, Attribute, Factory, NothingType, define, field |
8 | 8 | from pydantic import BaseModel |
9 | | -from schema import Schema |
| 9 | +from schema import Any, Schema |
10 | 10 |
|
11 | 11 | from griptape import utils |
12 | 12 | from griptape.artifacts import ( |
@@ -164,11 +164,13 @@ def validate_tools(self, _: Attribute, tools: list[BaseTool]) -> None: |
164 | 164 | raise ValueError("tools names have to be unique in task") |
165 | 165 |
|
166 | 166 | @output_schema.validator # pyright: ignore[reportAttributeAccessIssue, reportOptionalMemberAccess] |
167 | | - def validate_output_schema(self, _: Attribute, output_schema: Optional[Union[Schema, type[BaseModel]]]) -> None: |
| 167 | + def validate_output_schema( |
| 168 | + self, _: Attribute, output_schema: Optional[Union[Schema, type[BaseModel], Any]] |
| 169 | + ) -> None: |
168 | 170 | if ( |
169 | 171 | output_schema is None |
170 | | - or isinstance(self.output_schema, Schema) |
171 | | - or (isinstance(self.output_schema, type) and issubclass(self.output_schema, BaseModel)) |
| 172 | + or isinstance(output_schema, Schema) |
| 173 | + or (isinstance(output_schema, type) and issubclass(output_schema, BaseModel)) |
172 | 174 | ): |
173 | 175 | return |
174 | 176 | raise ValueError(f"Unsupported output schema type: {type(self.output_schema)}") |
|
0 commit comments