Skill
Waldiez Skill model.
WaldiezSkill
¶
Bases: WaldiezBase
Waldiez Skill.
Attributes:
Name | Type | Description |
---|---|---|
id | str | The ID of the skill. |
type | Literal['skill'] | The type of the "node" in a graph: "skill". |
name | str | The name of the skill. |
description | str | The description of the skill. |
tags | List[str] | The tags of the skill. |
requirements | List[str] | The requirements of the skill. |
created_at | str | The date and time when the skill was created. |
updated_at | str | The date and time when the skill was last updated. |
data | WaldiezSkillData | The data of the skill. See |
content: str
property
¶
Get the content (source) of the skill.
get_content() -> str
¶
Get the content of the skill.
Returns:
Type | Description |
---|---|
str | The content of the skill. |
Source code in waldiez/models/skill/skill.py
get_imports() -> Tuple[List[str], List[str]]
¶
is_interop: bool
property
¶
Check if the skill is interoperability.
Returns:
Type | Description |
---|---|
bool | True if the skill is interoperability, False otherwise. |
is_shared: bool
property
¶
Check if the skill is shared.
Returns:
Type | Description |
---|---|
bool | True if the skill is shared, False otherwise. |
load(data_or_path: Union[str, Path, Dict[str, Any]]) -> WaldiezSkill
staticmethod
¶
Load a skill from a read-only file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data_or_path | Union[str, Path, Dict[str, Any]] | The path to the read-only file or the loaded data. | required |
Returns:
Type | Description |
---|---|
WaldiezSkill | The skill. |
Raises:
Type | Description |
---|---|
FileNotFoundError | If the file is not found. |
ValueError | If the JSON is invalid or the data is invalid. |
Source code in waldiez/models/skill/skill.py
secrets: Dict[str, str]
property
¶
Get the secrets (environment variables) of the skill.
skill_type: WaldiezSkillType
property
¶
Get the skill type.
Returns:
Type | Description |
---|---|
WaldiezSkillType | The type of the skill: [shared, custom, langchain, crewai]. |
validate_data() -> Self
¶
Validate the data.
Returns:
Type | Description |
---|---|
WaldiezSkill | The skill. |
Raises:
Type | Description |
---|---|
ValueError | If the skill name is not in the content. If the skill content is invalid. |
Source code in waldiez/models/skill/skill.py
Waldiez Skill model.
WaldiezSkillData
¶
Bases: WaldiezBase
Waldiez Skill Data.
Attributes:
Name | Type | Description |
---|---|---|
skill_type | WaldiezSkillType | The type of the skill: shared, custom, langchain, crewai. |
content | str | The content (source code) of the skill. |
secrets | Dict[str, str] | The secrets (environment variables) of the skill. |
Waldiez Skill types.
WaldiezSkillType = Literal['shared', 'custom', 'langchain', 'crewai']
module-attribute
¶
Possible types of a Waldiez Skill.