changess
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import OpenAI from 'openai';
|
||||
import * as dotenv from 'dotenv';
|
||||
dotenv.config();
|
||||
dotenv.config({ path: ['.env.local', '.env'] });
|
||||
|
||||
export const openai = new OpenAI({
|
||||
apiKey: process.env.OPENAI_API_KEY,
|
||||
|
||||
@@ -2,7 +2,7 @@ import { drizzle } from 'drizzle-orm/postgres-js';
|
||||
import postgres from 'postgres';
|
||||
import * as dotenv from 'dotenv';
|
||||
|
||||
dotenv.config();
|
||||
dotenv.config({ path: ['.env.local', '.env'] });
|
||||
|
||||
const connectionString = process.env.DATABASE_URL || 'postgres://user:password@iris.haven:5432/recommender';
|
||||
export const client = postgres(connectionString);
|
||||
|
||||
@@ -3,10 +3,10 @@ import * as dotenv from 'dotenv';
|
||||
import recommendationsRoute from './routes/recommendations.js';
|
||||
import feedbackRoute from './routes/feedback.js';
|
||||
|
||||
// Load .env first, then .env.local
|
||||
// env vars set on the container take precedence over both files
|
||||
dotenv.config();
|
||||
dotenv.config({ path: '.env.local', override: true });
|
||||
// Load .env.local first, then .env.
|
||||
// dotenv 17+ supports array of paths, where the first path has the highest priority.
|
||||
// Env vars set on the container (system) will take precedence over both.
|
||||
dotenv.config({ path: ['.env.local', '.env'] });
|
||||
|
||||
const fastify = Fastify({ logger: true });
|
||||
|
||||
|
||||
@@ -7,6 +7,13 @@ import { runRanking } from '../agents/ranking.js';
|
||||
import { runCurator } from '../agents/curator.js';
|
||||
import type { CuratorOutput, SSEEvent } from '../types/agents.js';
|
||||
|
||||
/* -- Agent pipeline --
|
||||
[1] Interpreter -> gets user input, transforms into structured data
|
||||
[2] Retrieval -> gets shows from OpenAI (high temperature)
|
||||
[3] Ranking -> ranks shows based on user input
|
||||
[4] Curator -> curates shows based on user input
|
||||
*/
|
||||
|
||||
type RecommendationRecord = typeof recommendations.$inferSelect;
|
||||
|
||||
function log(recId: string, msg: string, data?: unknown) {
|
||||
|
||||
Reference in New Issue
Block a user