Skip to content

skill

Classes:

BaseSkill

BaseSkill(metadata: SkillMetadata)

Methods:

Source code in src/hiperhealth/pipeline/skill.py
def __init__(self, metadata: SkillMetadata) -> None:
    """
    title: Initialize a base skill with immutable metadata.
    parameters:
      metadata:
        type: SkillMetadata
    """
    self.metadata = metadata

check_requirements

check_requirements(
    stage: str, ctx: PipelineContext
) -> list[Inquiry]

Override to return a list of Inquiry objects describing what additional data the skill needs. The default implementation returns an empty list (no extra data needed). Inquiries use three priority levels: - required: must have before this stage can run - supplementary: improves results, available now - deferred: only available after a future pipeline step parameters: stage: type: str ctx: type: PipelineContext returns: type: list[Inquiry]

Source code in src/hiperhealth/pipeline/skill.py
def check_requirements(
    self, stage: str, ctx: PipelineContext
) -> list[Inquiry]:
    """
    title: Determine what information is needed before execution.
    summary: |-
      Override to return a list of Inquiry objects describing
      what additional data the skill needs.  The default
      implementation returns an empty list (no extra data needed).
      Inquiries use three priority levels:
      - required: must have before this stage can run
      - supplementary: improves results, available now
      - deferred: only available after a future pipeline step
    parameters:
      stage:
        type: str
      ctx:
        type: PipelineContext
    returns:
      type: list[Inquiry]
    """
    return []

execute

execute(
    stage: str, ctx: PipelineContext
) -> PipelineContext
Source code in src/hiperhealth/pipeline/skill.py
def execute(self, stage: str, ctx: PipelineContext) -> PipelineContext:
    """
    title: The main execution hook for a stage.
    parameters:
      stage:
        type: str
      ctx:
        type: PipelineContext
    returns:
      type: PipelineContext
    """
    return ctx

post

post(stage: str, ctx: PipelineContext) -> PipelineContext
Source code in src/hiperhealth/pipeline/skill.py
def post(self, stage: str, ctx: PipelineContext) -> PipelineContext:
    """
    title: Called after the stage's main execution.
    parameters:
      stage:
        type: str
      ctx:
        type: PipelineContext
    returns:
      type: PipelineContext
    """
    return ctx

pre

pre(stage: str, ctx: PipelineContext) -> PipelineContext
Source code in src/hiperhealth/pipeline/skill.py
def pre(self, stage: str, ctx: PipelineContext) -> PipelineContext:
    """
    title: Called before the stage's main execution.
    parameters:
      stage:
        type: str
      ctx:
        type: PipelineContext
    returns:
      type: PipelineContext
    """
    return ctx

Skill

Bases: Protocol

Methods:

check_requirements

check_requirements(
    stage: str, ctx: PipelineContext
) -> list[Inquiry]
Source code in src/hiperhealth/pipeline/skill.py
def check_requirements(
    self, stage: str, ctx: PipelineContext
) -> list[Inquiry]:
    """
    title: Describe what information the skill still needs.
    parameters:
      stage:
        type: str
      ctx:
        type: PipelineContext
    returns:
      type: list[Inquiry]
    """
    ...

execute

execute(
    stage: str, ctx: PipelineContext
) -> PipelineContext
Source code in src/hiperhealth/pipeline/skill.py
def execute(self, stage: str, ctx: PipelineContext) -> PipelineContext:
    """
    title: Run the main execution hook for a stage.
    parameters:
      stage:
        type: str
      ctx:
        type: PipelineContext
    returns:
      type: PipelineContext
    """
    ...

post

post(stage: str, ctx: PipelineContext) -> PipelineContext
Source code in src/hiperhealth/pipeline/skill.py
def post(self, stage: str, ctx: PipelineContext) -> PipelineContext:
    """
    title: Run the post-execution hook for a stage.
    parameters:
      stage:
        type: str
      ctx:
        type: PipelineContext
    returns:
      type: PipelineContext
    """
    ...

pre

pre(stage: str, ctx: PipelineContext) -> PipelineContext
Source code in src/hiperhealth/pipeline/skill.py
def pre(self, stage: str, ctx: PipelineContext) -> PipelineContext:
    """
    title: Run the pre-execution hook for a stage.
    parameters:
      stage:
        type: str
      ctx:
        type: PipelineContext
    returns:
      type: PipelineContext
    """
    ...

SkillMetadata dataclass

SkillMetadata(
    name: str,
    version: str = '0.1.0',
    stages: tuple[str, ...] = (),
    description: str = '',
)