// Note: This is typically configured server-side
let imageProcessor = ["type": "image_topic"]
let textProcessor = ["type": "text_topic"]
// Run image and text activity processors on any new activity
// Adds the topics found to the activity.interest_tags
let feedGroupConfig: [String: Any] = [
"id": "foryou",
"activity_processors": [imageProcessor, textProcessor]
]
Activity Feeds V3 is in closed alpha — do not use it in production (just yet).
Processors
Activity Processors
Activity processors enable you to do additional processing on activities after they are posted.
Activity Processors
The activity processors allow you to add data to an activity when it’s added. The most common use case for this is topic analysis using AI.
const response = await serverClient.feeds.createFeedGroup({
feed_group_id: "myid",
default_view_id: "<view id>",
activity_processors: [{ type: "image_topic" }, { type: "text_topic" }],
});
This interest tags data can now be used in ranking etc.
Topic Analyzer
The topic analyzer uses AI to set the topics based on the content of the text and images.
You can enable it like this:
// Note: This is typically configured server-side
let feedGroupConfig: [String: Any] = [
"id": "myid",
"activity_processors": [["type": "topic"]]
]
const response = await serverClient.feeds.createFeedGroup({
feed_group_id: "myid",
default_view_id: "<view id>",
activity_processors: [{ type: "topic" }],
});
Whenever a new activity is posted, it will automatically be enriched with topics:
let activity = try await feed.addActivity(
request: .init(
text: "check out my 10 fitness tips for reducing lower back pain",
type: "post"
)
)
// The activity will now have topics automatically added
print(activity.interestTags) // ["fitness", "health", "tips"]
const response = await client.feeds.addActivity({
fids: ["user:1"],
type: "post",
text: "check out my 10 fitness tips for reducing lower back pain",
user_id: "<user id>",
});
console.log(response.activity.interest_tags); // ["fitness", "health", "tips"]
On this page: