refactoring and clean up

This commit is contained in:
Storme-bit
2026-04-07 01:30:35 -07:00
parent 0aea052311
commit 2b75f75733
18 changed files with 191 additions and 115 deletions

View File

@@ -1,16 +1,13 @@
require ('dotenv').config();
const express = require('express');
const {getEnv} = require('@nexusai/shared');
const {getEnv, OLLAMA, PORTS} = require('@nexusai/shared');
const app = express();
app.use(express.json());
const PORT = getEnv('PORT', '3003'); // Default to 3003 if PORT is not set
const OLLAMA_URL = getEnv('OLLAMA_URL', 'http://localhost:11434'); // URL for Ollama API
const EMBED_MODEL = getEnv('EMBEDDING_MODEL', 'nomic-embed-text'); // Ollama model for embeddings
console.log('OLLAMA_URL:', OLLAMA_URL);
console.log('EMBED_MODEL:', EMBED_MODEL);
const PORT = getEnv('PORT', PORTS.EMBEDDING); // Default to 3003 if PORT is not set
const OLLAMA_URL = getEnv('OLLAMA_URL', OLLAMA.DEFAULT_URL); // URL for Ollama API
const EMBED_MODEL = getEnv('EMBEDDING_MODEL', OLLAMA.EMBED_MODEL); // Ollama model for embeddings
//OLLAMA embedding helper function
async function embedText(text) {