Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add directions around language handling for custom feeds #195

Merged
merged 2 commits into from
Oct 1, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion docs/starter-templates/custom-feeds.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ We strongly encourage that the cursor be _unique per feed item_ to prevent unexp
We recommend, for instance, a compound cursor with a timestamp + a CID:
`1683654690921::bafyreia3tbsfxe3cc75xrxyyn6qc42oupi73fxiox76prlyi5bpx7hr72u`

#### Language handling

Implemented correctly, requests to `getFeedSkeleton` should populate the `Accept-Language` header with comma-separated BCP-47 language codes e.g. `en,fr`. You should use this to return only posts that match those languages where possible. If language filtering is applied, you should in-turn populate the `Content-Language` header with the languages you used to filter.
estrattonbailey marked this conversation as resolved.
Show resolved Hide resolved

#### Suggestions and Examples

How a feed generator fulfills the `getFeedSkeleton` request is completely at their discretion. At the simplest end, a Feed Generator could supply a "feed" that only contains some hardcoded posts.
Expand All @@ -89,4 +93,4 @@ Depending on your algorithm, you likely do not need to keep posts around for lon

Some examples:
- A community feed: Compile a list of DIDs within that community and filtering the firehose for all posts from users within that list.
- A topical feed: Filter the algorithm for posts and pass the post text through some filtering mechanism (an LLM, a keyword matcher, etc.) that filters for the topic of your choice.
- A topical feed: Filter the algorithm for posts and pass the post text through some filtering mechanism (an LLM, a keyword matcher, etc.) that filters for the topic of your choice.