mirror of
https://github.com/bendtherules/ask262.git
synced 2026-08-18 13:21:55 +00:00
feat: Add env support + small fixes
This commit is contained in:
@@ -38,7 +38,7 @@ export function createEmbeddings(provider?: EmbeddingProvider): Embeddings {
|
||||
|
||||
switch (selectedProvider) {
|
||||
case "ollama": {
|
||||
console.log("[Embeddings] Using Ollama provider");
|
||||
console.error("[Embeddings] Using Ollama provider");
|
||||
return new OllamaEmbeddings({
|
||||
model: OLLAMA_EMBEDDING_MODEL,
|
||||
baseUrl: process.env.OLLAMA_HOST,
|
||||
@@ -50,7 +50,7 @@ export function createEmbeddings(provider?: EmbeddingProvider): Embeddings {
|
||||
if (!apiKey) {
|
||||
throw new Error("FIREWORKS_API_KEY environment variable is required");
|
||||
}
|
||||
console.log("[Embeddings] Using Fireworks provider");
|
||||
console.error("[Embeddings] Using Fireworks provider");
|
||||
return new FireworksEmbeddings({
|
||||
apiKey,
|
||||
modelName: FIREWORKS_EMBEDDING_MODEL,
|
||||
|
||||
@@ -43,8 +43,8 @@ const STORAGE_DIR = path.resolve(__dirname, "..", STORAGE_DIR_REL);
|
||||
// Initialize embeddings based on ASK262_EMBEDDING_PROVIDER env var
|
||||
const embeddings = createEmbeddings();
|
||||
|
||||
// Server port (default: 3000)
|
||||
const PORT = Number(process.env.ASK262_PORT) || 3000;
|
||||
// Server port (default: 8081)
|
||||
const PORT = Number(process.env.ASK262_PORT) || 8081;
|
||||
|
||||
/**
|
||||
* Factory function to create a fresh MCP server instance.
|
||||
|
||||
@@ -9,7 +9,7 @@ import type {
|
||||
EvaluateToolMCPOutput,
|
||||
GetSectionContentMCPOutput,
|
||||
SearchSpecMCPOutput,
|
||||
} from "../../mcp-server.js";
|
||||
} from "../../mcp-server-stdio.js";
|
||||
|
||||
async function testMCPServer() {
|
||||
console.log("Starting MCP Server tests...\n");
|
||||
@@ -17,7 +17,7 @@ async function testMCPServer() {
|
||||
// Create transport connecting to the server
|
||||
const transport = new StdioClientTransport({
|
||||
command: "bun",
|
||||
args: ["run", "src/mcp-server.ts"],
|
||||
args: ["run", "src/mcp-server-stdio.ts"],
|
||||
});
|
||||
|
||||
// Create client
|
||||
|
||||
Reference in New Issue
Block a user