Skip to content

Commit 70fb7fb

Browse files
scotty595claude
andcommitted
feat: add demo endpoints with drift processing for driftos-core
- Separated LLM routes into /llm and /demo prefixes (matching embed-enterprise) - Created /demo/stream endpoint for simple streaming (uses server-side Groq API key) - Created /demo/chat endpoint with full drift processing: - Creates temporary conversation in database - Processes messages through LLM-based drift orchestrator - Streams response and returns final state (branches, messages, actions) - Cleans up demo conversation after completion - Updated auth plugin to allow /demo routes publicly (rate limited) - Maintains same API surface as embed-enterprise for consistent testing Note: Core uses LLM-based routing (classify-route) vs embed's semantic similarity, but returns similar drift decisions (BRANCH/STAY/ROUTE) and state structure. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent fb0f315 commit 70fb7fb

4 files changed

Lines changed: 538 additions & 209 deletions

File tree

src/app.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import driftRoutes from './routes/drift/index';
1717
import factsRoutes from './routes/facts/index';
1818
import contextRoutes from './routes/context/index';
1919
import llmRoutes from './routes/llm/index';
20+
import demoRoutes from './routes/demo/index';
2021
import conversationsRoutes from './routes/conversations/index';
2122

2223
export async function buildApp() {
@@ -61,6 +62,7 @@ export async function buildApp() {
6162
await fastify.register(factsRoutes, { prefix: '/facts' });
6263
await fastify.register(contextRoutes, { prefix: '/context' });
6364
await fastify.register(llmRoutes, { prefix: '/llm' });
65+
await fastify.register(demoRoutes, { prefix: '/demo' });
6466
await fastify.register(conversationsRoutes, { prefix: '/conversations' });
6567
},
6668
{ prefix: `${app.config.API_PREFIX}/${app.config.API_VERSION}` }

src/plugins/auth.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import type { FastifyRequest, FastifyReply } from 'fastify';
44

55
// Routes that don't require authentication
66
const PUBLIC_ROUTES = [
7-
'/api/v1/llm/demo/stream', // Demo endpoint - rate limited by IP
8-
'/api/v1/llm/demo/chat', // Demo chat with drift - rate limited by IP
7+
'/api/v1/demo/stream', // Demo streaming endpoint - rate limited by IP
8+
'/api/v1/demo/chat', // Demo chat with drift - rate limited by IP
99
'/api/v1/health', // Health checks for infrastructure
1010
'/health', // Root health check
1111
'/', // Root route

0 commit comments

Comments
 (0)