Version operations
Modules concerning the version operations of a skill.
AnthropicVersionOperations(invoker, skill_ops)
Bases: VersionOperations
Handles skill version operations for the AnthropicLMInvoker class.
Initializes the version operations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
invoker
|
AnthropicLMInvoker
|
The LM invoker to use for the version operations. |
required |
skill_ops
|
AnthropicSkillOperations
|
The parent skill operations instance. |
required |
create(skill_id, file, **kwargs)
async
Creates a new version of a skill.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
skill_id
|
str
|
The skill identifier. |
required |
file
|
Attachment
|
The skill file to upload (ZIP archive or markdown file). |
required |
**kwargs
|
Any
|
Additional keyword arguments passed to Anthropic's versions.create. |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
Skill |
Skill
|
The created skill version. |
delete(skill_id, version)
async
Deletes a specific version of a skill.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
skill_id
|
str
|
The skill identifier. |
required |
version
|
str
|
The version identifier to delete. |
required |
list(skill_id)
async
retrieve(skill_id, version)
async
Retrieves a specific version of a skill.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
skill_id
|
str
|
The skill identifier. |
required |
version
|
str
|
The version identifier. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Skill |
Skill
|
The retrieved skill version. |
VersionOperations(invoker)
Handles version operations for skill sub-namespace.
Examples:
- List versions:
versions = await lm_invoker.skill.version.list(skill_id)
- Create a version:
version = await lm_invoker.skill.version.create(skill_id, file)
- Retrieve a version:
version = await lm_invoker.skill.version.retrieve(skill_id, version)
- 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
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. |