diff --git a/ix/runnable/output_parser.py b/ix/runnable/output_parser.py index 1c57f112..002b7ca5 100644 --- a/ix/runnable/output_parser.py +++ b/ix/runnable/output_parser.py @@ -23,6 +23,9 @@ def invoke( config: Optional[RunnableConfig] = None, **kwargs: Any, ) -> FunctionCall: + if isinstance(input, dict): + input = AIMessage(**input) + additional_kwargs = input.additional_kwargs if "function_call" in additional_kwargs: function_call = additional_kwargs["function_call"] @@ -42,6 +45,9 @@ async def ainvoke( config: Optional[RunnableConfig] = None, **kwargs: Any, ) -> FunctionCall: + if isinstance(input, dict): + input = AIMessage(**input) + additional_kwargs = input.additional_kwargs if "function_call" in additional_kwargs: function_call = additional_kwargs["function_call"] diff --git a/ix/skills/types.py b/ix/skills/types.py index fcbd318c..efd0e519 100644 --- a/ix/skills/types.py +++ b/ix/skills/types.py @@ -15,7 +15,7 @@ class SkillBase(BaseModel): name: str = Field(max_length=128) description: Optional[str] = None code: str - tags: List[str] = Field(default_factory=list) + tags: Optional[List[str]] = Field(default_factory=list) func_name: Optional[str] = None input_schema: Optional[dict[str, Any]] = None @@ -31,12 +31,6 @@ class EditSkill(SkillBase): class Config: from_attributes = True - @model_validator(mode="before") - def default_tags(cls, values): - if not values["tags"]: - values["tags"] = [] - return values - @model_validator(mode="before") def parse_code_and_set_fields(cls, values): code = values.get("code", None)