Skip to content

Version operations

Defines the version operations for the SkillOperations class.

VersionOperations(invoker)

Handles version operations for skill sub-namespace.

Examples:

  1. List versions:
versions = await lm_invoker.skill.version.list(skill_id)
  1. Create a version:
version = await lm_invoker.skill.version.create(skill_id, file)
  1. Retrieve a version:
version = await lm_invoker.skill.version.retrieve(skill_id, version)
  1. Delete a version:
await lm_invoker.skill.version.delete(skill_id, version)

Initializes the version operations.

Parameters:

Name Type Description Default
invoker BaseLMInvoker

The LM invoker to use for the version operations.

required

__init_subclass__(**kwargs)

Wrap subclass operation methods to normalize errors.

Parameters:

Name Type Description Default
**kwargs Any

Additional keyword arguments to initialize the subclass.

{}

create(skill_id, file, **kwargs) async

Creates a new version of a skill.

Parameters:

Name Type Description Default
skill_id str

The ID of the skill.

required
file Attachment

File attachment of the skill version.

required
**kwargs Any

Additional keyword arguments to create a skill version.

{}

Returns:

Name Type Description
Skill Skill

The created skill version.

Raises:

Type Description
NotImplementedError

The version operation is not supported.

delete(skill_id, version) async

Deletes a specific version of a skill.

Parameters:

Name Type Description Default
skill_id str

The ID of the skill.

required
version str

The version identifier to delete.

required

Raises:

Type Description
NotImplementedError

The version operation is not supported.

list(skill_id) async

Lists all versions of a skill.

Parameters:

Name Type Description Default
skill_id str

The ID of the skill.

required

Returns:

Type Description
list[Skill]

list[Skill]: The list of skill versions.

Raises:

Type Description
NotImplementedError

The version operation is not supported.

retrieve(skill_id, version) async

Retrieves a specific version of a skill.

Parameters:

Name Type Description Default
skill_id str

The ID of the skill.

required
version str

The version identifier.

required

Returns:

Name Type Description
Skill Skill

The retrieved skill version.

Raises:

Type Description
NotImplementedError

The version operation is not supported.