Skip to content

AvailableCommand

Base classes

Name Children Inherits
AnnotatedObject
aclientp.schema.base
Base class for generated models.

⋔ Inheritance diagram

graph TD
  95970862527952["slash_commands.AvailableCommand"]
  95970862258240["base.AnnotatedObject"]
  95970862254416["base.Schema"]
  95970851503232["main.BaseModel"]
  125067848591872["builtins.object"]
  95970862258240 --> 95970862527952
  95970862254416 --> 95970862258240
  95970851503232 --> 95970862254416
  125067848591872 --> 95970851503232

🛈 DocStrings

Bases: AnnotatedObject

Information about a command.

Source code in src/aclientp/schema/slash_commands.py
class AvailableCommand(AnnotatedObject):
    """Information about a command."""

    description: str
    """Human-readable description of what the command does."""

    input: AvailableCommandInput | None = None
    """Input for the command if required."""

    name: str
    """Command name (e.g., `create_plan`, `research_codebase`)."""

    @classmethod
    def create(cls, name: str, description: str, input_hint: str | None = None) -> Self:
        """Create a new Command.

        Args:
            name: Name of the command.
            description: Description of the command.
            input_hint: Hint for the input.

        Returns:
            A new available command.
        """
        spec = AvailableCommandInput(root=CommandInputHint(hint=input_hint)) if input_hint else None
        return cls(name=name, description=description, input=spec)

description instance-attribute

description: str

Human-readable description of what the command does.

input class-attribute instance-attribute

input: AvailableCommandInput | None = None

Input for the command if required.

name instance-attribute

name: str

Command name (e.g., create_plan, research_codebase).

create classmethod

create(name: str, description: str, input_hint: str | None = None) -> Self

Create a new Command.

Parameters:

Name Type Description Default
name str

Name of the command.

required
description str

Description of the command.

required
input_hint str | None

Hint for the input.

None

Returns:

Type Description
Self

A new available command.

Source code in src/aclientp/schema/slash_commands.py
@classmethod
def create(cls, name: str, description: str, input_hint: str | None = None) -> Self:
    """Create a new Command.

    Args:
        name: Name of the command.
        description: Description of the command.
        input_hint: Hint for the input.

    Returns:
        A new available command.
    """
    spec = AvailableCommandInput(root=CommandInputHint(hint=input_hint)) if input_hint else None
    return cls(name=name, description=description, input=spec)

:fa-brands-github: Show source on GitHub