add llm interface#5
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
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.txtand/llms-full.txtroutes to advertise the product/API for LLM and tool discovery. - Added
?format=textsupport to/json/{slug}to return a compact, speaker-labeled plain-text transcript. - Added
slim=1mode to/api/videosand moved speaker segmentation logic intolib/transcript-formatting.tsfor 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. |
| @@ -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; | ||
|
|
| "title": "...", | ||
| "clean_title": "...", | ||
| "url": "https://webtv.un.org/...", | ||
| "date": "YYYY-MM-DDT00:00:00.000Z", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.