Skill Plugin Model
Smarter API PluginData Skill Connection Manifest Constants.
Smarter API Manifest - Plugin.spec.
- class smarter.apps.plugin.manifest.models.skill_plugin.spec.SAMSkillPluginSpec(*, selector: SAMPluginCommonSpecSelector, prompt: SAMPluginCommonSpecPrompt, skillData: SkillData)[source]
Bases:
SAMPluginCommonSpecSmarter API SkillData Connection Manifest SkillConnection.spec.
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'from_attributes': True, 'frozen': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_post_init(context, /)
This function is meant to behave like a BaseModel method to initialize private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
- Return type:
- Parameters:
self – The BaseModel instance.
context – The context.
- class smarter.apps.plugin.manifest.models.skill_plugin.spec.SkillData(*, name: str, description: str, license: str | None = None, allowedTools: list[str] | None = None, instructions: ~typing.Annotated[str, ~annotated_types.MaxLen(max_length=2048)], resources: list[str] | None = <factory>)[source]
Bases:
SmarterBasePydanticModelSmarter API - generic API Skill data class.
Models a single SKILL.md-format skill as discrete, validated manifest properties: the YAML frontmatter fields (
name,description,license,allowed-tools) plus the Markdowninstructionsbody and any bundledresourcesfile references.to_skill_document()andfrom_skill_document()provide lossless round-tripping to/from the canonical SKILL.md text representation persisted byPluginDataSkill.skill_document, so a manifest author can author a skill either as structured YAML keys underskillData, or by pasting a raw SKILL.md file’s contents and parsing it withfrom_skill_document().- classmethod from_skill_document(skill_document)[source]
Parse a raw SKILL.md document (YAML frontmatter + Markdown body) into a.
validated SkillData instance.
This is the inverse of
to_skill_document(), and allows a manifest author to paste an existing SKILL.md file’s contents directly rather than re-authoring it as structured YAML keys.- Parameters:
skill_document (
str) – The raw SKILL.md file contents.- Returns:
A validated SkillData instance.
- Return type:
- Raises:
SAMValidationError – If the document has no frontmatter block, the frontmatter is not valid YAML, the frontmatter does not parse to a mapping, or required keys are missing.
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'from_attributes': True, 'frozen': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_post_init(context, /)
This function is meant to behave like a BaseModel method to initialize private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
- Return type:
- Parameters:
self – The BaseModel instance.
context – The context.
- to_skill_document()[source]
Render this SkillData as a canonical SKILL.md document: a YAML frontmatter.
block followed by the Markdown instructions body.
This is the inverse of
from_skill_document(), and is the representation persisted toPluginDataSkill.skill_documentwhen the manifest controller materializes this spec into a Django model instance.- Returns:
The rendered SKILL.md text.
- Return type:
Smarter API Plugin Manifest.
- class smarter.apps.plugin.manifest.models.skill_plugin.model.SAMSkillPlugin(*, apiVersion: str, kind: str, metadata: SAMPluginCommonMetadata, spec: SAMSkillPluginSpec, status: SAMPluginCommonStatus | None = None)[source]
Bases:
SAMPluginCommonSmarter API Manifest - Skill Connection Model.
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'from_attributes': True, 'frozen': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_post_init(context, /)
This function is meant to behave like a BaseModel method to initialize private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
- Return type:
- Parameters:
self – The BaseModel instance.
context – The context.
- spec: SAMSkillPluginSpec