Skip to content

add llm interface#5

Merged
kleinlennart merged 1 commit into
mainfrom
feature/llms.txt
Jun 17, 2026
Merged

add llm interface#5
kleinlennart merged 1 commit into
mainfrom
feature/llms.txt

Conversation

@kleinlennart

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings June 17, 2026 18:21
@vercel

vercel Bot commented Jun 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
webtv-unfck-org Ready Ready Preview, Comment Jun 17, 2026 6:21pm

Request Review

@kleinlennart kleinlennart merged commit d134f08 into main Jun 17, 2026
4 checks passed
@kleinlennart kleinlennart deleted the feature/llms.txt branch June 17, 2026 18:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds an LLM-friendly interface to the UN Transcripts app by introducing discovery endpoints and a plain-text transcript format, while refactoring speaker segmentation into a shared utility for both client and server use.

Changes:

  • Added /llms.txt and /llms-full.txt routes to advertise the product/API for LLM and tool discovery.
  • Added ?format=text support to /json/{slug} to return a compact, speaker-labeled plain-text transcript.
  • Added slim=1 mode to /api/videos and moved speaker segmentation logic into lib/transcript-formatting.ts for reuse.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
lib/transcript-formatting.ts Adds shared buildSpeakerSegments helper and extends plain-text statement typing.
components/transcription-panel.tsx Refactors the panel to use the shared speaker segmentation helper.
app/json/[...meeting]/route.ts Adds ?format=text plain-text transcript output to the JSON meeting endpoint.
app/api/videos/route.ts Adds slim=1 compact response option intended for machine/LLM consumers.
app/llms.txt/route.ts Introduces an llms.txt discovery endpoint with short usage guidance.
app/llms-full.txt/route.ts Introduces a long-form LLM-oriented API reference endpoint.
docs/api.md Updates public API documentation and adds LLM discovery references.

Comment thread docs/api.md
@@ -1,5 +1,7 @@
# Public API

All endpoints are public with no authentication required.
Comment on lines +44 to +55
"videos": [
{
"title": "...",
"date": "YYYY-MM-DDT00:00:00.000Z",
"body": "Security Council",
"category": "...",
"slug": "sc/{n}",
"duration": "HH:MM:SS",
"hasTranscript": true,
"jsonUrl": "/json/sc/{n}"
}
],
Comment on lines +112 to +120
"video": {
"id": "...",
"kaltura_id": "...",
"title": "...",
"clean_title": "...",
"url": "https://webtv.un.org/en/asset/...",
"date": "YYYY-MM-DDT00:00:00.000Z",
"duration": "HH:MM:SS",
"category": "...",
Comment on lines +114 to +120
const date = video.date
? new Date(video.date).toLocaleDateString("en-GB", {
day: "numeric",
month: "long",
year: "numeric",
})
: "";
Comment on lines +44 to +58
export function buildSpeakerSegments(
statements: PlainTextStatement[],
speakerMappings: SpeakerMapping,
): PlainTextSegment[] {
const segs: PlainTextSegment[] = [];
if (statements.length === 0) return segs;

let currentSegment: PlainTextSegment | null = null;
statements.forEach((stmt, index) => {
const speakerInfo = speakerMappings[index.toString()];
const speakerId = JSON.stringify(speakerInfo || {});
const firstSentence = stmt.paragraphs[0]?.sentences[0];
const timestamp =
firstSentence?.start != null ? firstSentence.start / 1000 : null;

Comment thread docs/api.md
"title": "...",
"clean_title": "...",
"url": "https://webtv.un.org/...",
"date": "YYYY-MM-DDT00:00:00.000Z",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants