-
Notifications
You must be signed in to change notification settings - Fork 5
feat: LLM Gateway V2 integration with publication system #256
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
Open
damienlaine
wants to merge
24
commits into
next
Choose a base branch
from
llm-gateway-v2-integration
base: next
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
dac3992
feat(api): LLM Gateway V2 integration
damienlaine 52722aa
feat(api): export versioning and document generation
damienlaine 55fa378
feat(websocket): real-time LLM job updates with authorization
damienlaine 6f0e684
feat(frontend): publish page with LLM job management
damienlaine c2245dc
feat(api): add publication endpoints for document generation
damienlaine cf20b61
feat(api): add generation history tracking
damienlaine 4151272
feat(ui): add publication and template management components
damienlaine 4b5c6e1
feat(ui): add AI service menu and generation timeline
damienlaine 62b2230
fix(i18n): add missing translation keys for publication feature
damienlaine d399722
chore: add tests and update dependencies
damienlaine 0ebc389
fix(ui): hide regenerate button when document is up to date
damienlaine 5ec3759
Fix timeline not refreshing after new generation completes
damienlaine 2a7ae6e
Replace emojis with CSS icons for visual consistency
damienlaine c388527
feat(api): Remove local LLM Gateway result caching
damienlaine dec6d26
feat(frontend): Fetch LLM content from gateway instead of cache
damienlaine aba1206
test(api): Add tests for export content endpoint and auto-regeneration
damienlaine 810b12a
feat: add WhisperX JSON export format
damienlaine e99acf7
refactor: deduplicate socket organization access checks
damienlaine 5c71cfe
refactor: clean up migration with schema helper
damienlaine 65af07f
refactor: remove unused generateDocxFromMarkdown function
damienlaine a7116e0
fix: add organizationId to public session tokens
damienlaine 94a16ec
chore: remove proxy pattern comments
damienlaine c908ec9
refactor: use custom error classes in publication controller
damienlaine 0376b6d
refactor: extend custom error classes to export and generations contr…
damienlaine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
36 changes: 36 additions & 0 deletions
36
studio-api/components/MongoMigration/controllers/schema/conversationGenerations.js
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| const debug = require("debug")( | ||
| `linto:components:MongoMigration:controllers:schema:conversationGenerations`, | ||
| ) | ||
|
|
||
| module.exports = async function (db, collectionName) { | ||
| try { | ||
| if (!collectionName) return | ||
|
|
||
| const collection = db.collection(collectionName) | ||
|
|
||
| // Compound index for listing generations by conversation and service | ||
| await collection.createIndex( | ||
| { conversationId: 1, serviceId: 1, createdAt: -1 }, | ||
| { name: "conversationId_serviceId_createdAt" }, | ||
| ) | ||
|
|
||
| // Unique index on generationId | ||
| await collection.createIndex( | ||
| { generationId: 1 }, | ||
| { name: "generationId_unique", unique: true, sparse: true }, | ||
| ) | ||
|
|
||
| // Index on jobId for lookups | ||
| await collection.createIndex({ jobId: 1 }, { name: "jobId", sparse: true }) | ||
|
|
||
| // Index for finding current generation | ||
| await collection.createIndex( | ||
| { conversationId: 1, serviceId: 1, isCurrent: 1 }, | ||
| { name: "conversationId_serviceId_isCurrent" }, | ||
| ) | ||
|
|
||
| console.log(`Collection "${collectionName}" indexes created successfully.`) | ||
| } catch (error) { | ||
| console.error("Error creating indexes:", error) | ||
| } | ||
| } |
35 changes: 35 additions & 0 deletions
35
studio-api/components/MongoMigration/version/1.6.2/conversationGenerations.js
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| /** | ||
| * Migration: Create conversationGenerations collection | ||
| * | ||
| * This collection tracks generation history per conversation + service combination. | ||
| * Each generation maps to a jobId in LLM Gateway. | ||
| */ | ||
| const initConversationGenerations = require( | ||
| `${process.cwd()}/components/MongoMigration/controllers/schema/conversationGenerations`, | ||
| ) | ||
|
|
||
| const COLLECTION_NAME = "conversationGenerations" | ||
|
|
||
| module.exports = { | ||
| async up(db) { | ||
| // Check if collection exists | ||
| const collections = await db | ||
| .listCollections({ name: COLLECTION_NAME }) | ||
| .toArray() | ||
| if (collections.length === 0) { | ||
| await db.createCollection(COLLECTION_NAME) | ||
| } | ||
|
|
||
| // Create indexes using schema helper | ||
| await initConversationGenerations(db, COLLECTION_NAME) | ||
| }, | ||
|
|
||
| async down(db) { | ||
| const collections = await db | ||
| .listCollections({ name: COLLECTION_NAME }) | ||
| .toArray() | ||
| if (collections.length > 0) { | ||
| await db.collection(COLLECTION_NAME).drop() | ||
| } | ||
| }, | ||
| } |
20 changes: 20 additions & 0 deletions
20
studio-api/components/MongoMigration/version/1.6.2/version.js
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| const debug = require("debug")( | ||
| `linto:components:MongoMigration:controllers:version:1.6.2:version`, | ||
| ) | ||
|
|
||
| const previous_version = "1.6.1" | ||
| const version = "1.6.2" | ||
|
|
||
| module.exports = { | ||
| async up(db) { | ||
| return db | ||
| .collection("version") | ||
| .updateMany({}, { $set: { version: version } }) | ||
| }, | ||
|
|
||
| async down(db) { | ||
| return db | ||
| .collection("version") | ||
| .updateMany({}, { $set: { version: previous_version } }) | ||
| }, | ||
| } |
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
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
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.