Condividi tramite


BetaSkillsOperations Class

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through

AIProjectClient's

<xref:skills> attribute.

Constructor

BetaSkillsOperations(*args, **kwargs)

Methods

create

Creates a skill.

create_from_package

Creates a skill from a zip package.

delete

Deletes a skill.

download

Downloads a skill package.

get

Retrieves a skill.

list

Returns the list of all skills.

update

Updates an existing skill.

create

Creates a skill.

async create(*, name: str, content_type: str = 'application/json', description: str | None = None, instructions: str | None = None, metadata: dict[str, str] | None = None, **kwargs: Any) -> _models.SkillObject

Parameters

Name Description
body
<xref:JSON> or IO[bytes]

Is either a JSON type or a IO[bytes] type. Required.

Keyword-Only Parameters

Name Description
name
str

The unique name of the skill. Required.

Default value: <object object at 0x00000210BA37F9C0>
description
str

A human-readable description of the skill. Default value is None.

Default value: None
instructions
str

Instructions that define the behavior of the skill. Default value is None.

Default value: None
metadata

Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.

Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters. Default value is None.

Default value: None

Returns

Type Description

SkillObject. The SkillObject is compatible with MutableMapping

Exceptions

Type Description

create_from_package

Creates a skill from a zip package.

async create_from_package(body: bytes, **kwargs: Any) -> SkillObject

Parameters

Name Description
body
Required

The zip package used to create the skill. Required.

Returns

Type Description

SkillObject. The SkillObject is compatible with MutableMapping

Exceptions

Type Description

delete

Deletes a skill.

async delete(name: str, **kwargs: Any) -> DeleteSkillResponse

Parameters

Name Description
name
Required
str

The unique name of the skill. Required.

Returns

Type Description

DeleteSkillResponse. The DeleteSkillResponse is compatible with MutableMapping

Exceptions

Type Description

download

Downloads a skill package.

async download(name: str, **kwargs: Any) -> AsyncIterator[bytes]

Parameters

Name Description
name
Required
str

The unique name of the skill. Required.

Returns

Type Description

AsyncIterator[bytes]

Exceptions

Type Description

get

Retrieves a skill.

async get(name: str, **kwargs: Any) -> SkillObject

Parameters

Name Description
name
Required
str

The unique name of the skill. Required.

Returns

Type Description

SkillObject. The SkillObject is compatible with MutableMapping

Exceptions

Type Description

list

Returns the list of all skills.

list(*, limit: int | None = None, order: str | PageOrder | None = None, before: str | None = None, **kwargs: Any) -> AsyncItemPaged[SkillObject]

Keyword-Only Parameters

Name Description
limit
int

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. Default value is None.

Default value: None
order

Sort order by the created_at timestamp of the objects. asc for ascending order anddesc for descending order. Known values are: "asc" and "desc". Default value is None.

Default value: None
before
str

A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. Default value is None.

Default value: None

Returns

Type Description

An iterator like instance of SkillObject

Exceptions

Type Description

update

Updates an existing skill.

async update(name: str, *, content_type: str = 'application/json', description: str | None = None, instructions: str | None = None, metadata: dict[str, str] | None = None, **kwargs: Any) -> _models.SkillObject

Parameters

Name Description
name
Required
str

The unique name of the skill. Required.

body
<xref:JSON> or IO[bytes]

Is either a JSON type or a IO[bytes] type. Required.

Keyword-Only Parameters

Name Description
description
str

A human-readable description of the skill. Default value is None.

Default value: None
instructions
str

Instructions that define the behavior of the skill. Default value is None.

Default value: None
metadata

Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.

Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters. Default value is None.

Default value: None

Returns

Type Description

SkillObject. The SkillObject is compatible with MutableMapping

Exceptions

Type Description