- updateSummary - Generate video summary
- generateNamedEntities - Generate named entities
This endpoint allows you to generate the summary for an existing media.
- Send a
PATCHrequest to this endpoint, replacing<mediaId>with the ID of the media you want to summarize. - Include the
generateparameter in the request body. - Include the
summaryLengthparameter, specify the desired length of the summary in words (for example, 120 words), this determines how concise or detailed the summary will be. If no specific summary length is provided, the default length will be 100 words. - The response includes the updated media data and confirmation of the changes applied.
You can use the video.mediaAI.summary.ready webhook event to track and notify about the summary generation.
Use case: This is particularly useful when a user uploads a video and later chooses to generate a summary without needing to re-upload the video.
Related guide: Video summary
import { Fastpix } from "@fastpix/fastpix-node";
const fastpix = new Fastpix({
security: {
username: "your-access-token",
password: "your-secret-key",
},
});
async function run() {
const result = await fastpix.aiFeatures.updateSummary({
mediaId: "your-media-id",
body: {
generate: true,
},
});
console.log(result);
}
run();The standalone function version of this method:
import { FastpixCore } from "@fastpix/fastpix-node/core.js";
import { aiFeaturesUpdateSummary } from "@fastpix/fastpix-node/funcs/aiFeaturesUpdateSummary.js";
// Use `FastpixCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const fastpix = new FastpixCore({
security: {
username: "your-access-token",
password: "your-secret-key",
},
});
async function run() {
const res = await aiFeaturesUpdateSummary(fastpix, {
mediaId: "your-media-id",
body: {
generate: true,
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("aiFeaturesUpdateSummary failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.UpdateMediaSummaryRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.UpdateMediaSummaryResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.FastpixDefaultError | 4XX, 5XX | */* |
This endpoint allows you to extract named entities from an existing media. Named Entity Recognition (NER) is a fundamental natural language processing (NLP) technique that identifies and classifies key information (entities) in text into predefined categories. For instance:
- Organizations (for example, "Microsoft", "United Nations")
- Locations (for example, "Paris", "Mount Everest")
- Product names (for example, "iPhone", "Coca-Cola")
- Make a PATCH request to this endpoint, replacing
<mediaId>with the ID of the media you want to extract named-entities. - Include the
namedEntitiesparameter in the request body to enable. - Receive a response containing the updated media data, confirming the changes made.
You can use the video.mediaAI.named-entities.ready webhook event to track and notify about the named entities extraction.
Use case: If a user uploads a video and later decides to enable named entity extraction without re-uploading the entire video.
Related guide: Named entities
import { Fastpix } from "@fastpix/fastpix-node";
const fastpix = new Fastpix({
security: {
username: "your-access-token",
password: "your-secret-key",
},
});
async function run() {
const result = await fastpix.aiFeatures.generateNamedEntities({
mediaId: "your-media-id",
body: {
namedEntities: true,
},
});
console.log(result);
}
run();The standalone function version of this method:
import { FastpixCore } from "@fastpix/fastpix-node/core.js";
import { aiFeaturesGenerateNamedEntities } from "@fastpix/fastpix-node/funcs/aiFeaturesGenerateNamedEntities.js";
// Use `FastpixCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const fastpix = new FastpixCore({
security: {
username: "your-access-token",
password: "your-secret-key",
},
});
async function run() {
const res = await aiFeaturesGenerateNamedEntities(fastpix, {
mediaId: "your-media-id",
body: {
namedEntities: true,
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("aiFeaturesGenerateNamedEntities failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.UpdateMediaNamedEntitiesRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.UpdateMediaNamedEntitiesResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.FastpixDefaultError | 4XX, 5XX | */* |