Knowledge store items
Use these methods to add assets to a knowledge store as items, to tag moments and ranges of video items, and to organize items into named collections.
Knowledge store items
The KnowledgeStoreItemsClient class provides methods to add and manage the items in a knowledge store.
Create a knowledge store item
Description: This method adds an asset to a knowledge store for processing. The operation is asynchronous. The item is created immediately with the queued status and processed in the background.
Asset size limits:
- Video: Up to 10 GB
- Images: Up to 32 MB
Function signature and example:
Parameters
Return value
Returns a KnowledgeStoreItem object. The KnowledgeStoreItem class contains the following properties:
API Reference
Create a knowledge store item.
Related guide
Add assets to a knowledge store.
List knowledge store items
Description: This method returns a list of items in the specified knowledge store.
Function signature and example:
Parameters
Return value
Returns a SyncPager[KnowledgeStoreItem] object that allows you to iterate through the paginated list of items. For the properties of each KnowledgeStoreItem object, see Create a knowledge store item.
API Reference
Retrieve a knowledge store item
Description: This method retrieves the details of a specific knowledge store item.
Function signature and example:
Parameters
Return value
Returns a KnowledgeStoreItem object. For its properties, see Create a knowledge store item.
API Reference
Retrieve a knowledge store item.
Delete a knowledge store item
Description: This method deletes the specified knowledge store item.
Function signature and example:
Parameters
Return value
This method does not return a value.
API Reference
Delete a knowledge store item.
Update the item metadata
Description: This method updates the item_metadata of the specified knowledge store item and returns the item. The platform merges your changes with the existing metadata:
- A key with a value creates or replaces that key.
- A key set to
nulldeletes that key. - A key set to an empty string (
"") or an empty array ([]) is ignored. - A key you omit from the request keeps its current value.
The metadata field of the item does not change. If the merged result contains more than 50 pairs, the request fails.
To replace all item metadata in a single call, use the Replace the item metadata method instead.
Function signature and example:
Parameters
Return value
Returns a KnowledgeStoreItem object. For its properties, see Create a knowledge store item.
API Reference
Replace the item metadata
Description: This method replaces the entire item_metadata of the specified knowledge store item and returns the item. Unlike the Update the item metadata method, which merges your changes with the existing metadata, this method overwrites the stored value in full:
- A key with a value creates or replaces that key.
- A key you omit, or set to an empty string (
""), an empty array ([]), ornull, is removed.
To clear all item metadata, send an empty object ({}) in the item_metadata field. The metadata field of the item does not change.
Function signature and example:
Parameters
Return value
Returns a KnowledgeStoreItem object. For its properties, see Create a knowledge store item.
API Reference
Item tags
The KnowledgeStoreItemTagsClient class provides methods to tag moments and ranges of video items. A tag carries custom metadata.
Create an item tag
Description: This method tags a moment or a range of a video item and returns the tag. Set start_sec to tag a moment. Set start_sec and end_sec to tag a range. A video item holds up to 100 tags. The method returns a 422 error for an item that is not a video item, and when the item already holds 100 tags.
Function signature and example:
Parameters
Return value
Returns a KnowledgeStoreItemTag object. The KnowledgeStoreItemTag class contains the following properties:
API Reference
List item tags
Description: This method returns the tags of the specified knowledge store item. The platform sorts the tags by start_sec, earliest first. Tags with the same start_sec are sorted by id.
Function signature and example:
Parameters
Return value
Returns a SyncPager[KnowledgeStoreItemTag] object that allows you to iterate through the paginated list of item tags. For the properties of each KnowledgeStoreItemTag object, see Create an item tag.
API Reference
Retrieve an item tag
Description: This method retrieves the details of a specific tag of a knowledge store item.
Function signature and example:
Parameters
Return value
Returns a KnowledgeStoreItemTag object. For its properties, see Create an item tag.
API Reference
Update an item tag
Description: This method updates the range or the tag_metadata of the specified tag and returns the tag. Send at least one field. A field you omit keeps its current value. To clear the end of the range, send end_sec as None. The tag becomes a single moment. The platform merges your changes to tag_metadata with the existing metadata:
- A key with a value creates or replaces that key.
- A key set to
Nonedeletes that key. - A key set to an empty string (
"") or an empty array ([]) is ignored. - A key you omit from the request keeps its current value.
The tag must keep at least one key in tag_metadata, and it holds up to 50 pairs. If the merged result breaks either limit, the request fails.
Function signature and example:
Parameters
Return value
Returns a KnowledgeStoreItemTag object. For its properties, see Create an item tag.
API Reference
Delete an item tag
Description: This method deletes the specified tag of a knowledge store item.
Function signature and example:
Parameters
Return value
This method does not return a value.
API Reference
Item collections
The KnowledgeStoreItemCollectionsClient class provides methods to organize items into named collections that you can reference together.
Create an item collection
Description: This method creates an item collection in the specified knowledge store. An item collection is a named collection of items. Use item collections to organize and reference subsets of items together.
Function signature and example:
Parameters
Return value
Returns a KnowledgeStoreItemCollection object. The KnowledgeStoreItemCollection class contains the following properties:
API Reference
List item collections
Description: This method returns a list of the item collections in the specified knowledge store.
Function signature and example:
Parameters
Return value
Returns a SyncPager[KnowledgeStoreItemCollection] object that allows you to iterate through the paginated list of item collections. For the properties of each KnowledgeStoreItemCollection object, see Create an item collection.
API Reference
Retrieve an item collection
Description: This method retrieves the details of a specific item collection.
Function signature and example:
Parameters
Return value
Returns a KnowledgeStoreItemCollection object. For its properties, see Create an item collection.
API Reference
Update an item collection
Description: This method updates the name, description, and metadata fields of the specified item collection.
Function signature and example:
Parameters
Return value
Returns a KnowledgeStoreItemCollection object. For its properties, see Create an item collection.
API Reference
Delete an item collection
Description: This method deletes the specified item collection. The items themselves remain in the knowledge store.
Function signature and example:
Parameters
Return value
This method does not return a value.
API Reference
List items in an item collection
Description: This method returns a list of the items in the specified item collection.
Function signature and example:
Parameters
Return value
Returns a SyncPager[KnowledgeStoreItem] object that allows you to iterate through the paginated list of items in the collection. For the properties of each KnowledgeStoreItem object, see Create a knowledge store item.
API Reference
List items in an item collection.
Add items to an item collection
Description: This method adds one or more items to the specified item collection. This operation is idempotent — items already in the collection are skipped. Every identifier must reference an existing item in the knowledge store.
Function signature and example:
Parameters
Return value
Returns a KnowledgeStoreItemCollection object. For its properties, see Create an item collection.
API Reference
Add items to an item collection.
Remove items from an item collection
Description: This method removes one or more items from the specified item collection. This operation is idempotent — identifiers that do not match a member of the collection are ignored. The items themselves remain in the knowledge store.
Function signature and example:
Parameters
Return value
This method does not return a value.