Skip to content

Commit

Permalink
Merge pull request #448 from kreneskyp/no_default_tags
Browse files Browse the repository at this point in the history
Skill.tags is now optional. Was blocking the saving of skills
  • Loading branch information
kreneskyp authored Feb 15, 2024
2 parents 1eca74f + 5bcff95 commit df4d841
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 6 additions & 0 deletions ix/runnable/output_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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"]
Expand Down
8 changes: 1 addition & 7 deletions ix/skills/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
Expand Down

0 comments on commit df4d841

Please sign in to comment.