Skip to content

Latest commit

 

History

History
124 lines (113 loc) · 3.78 KB

File metadata and controls

124 lines (113 loc) · 3.78 KB

⚙️ Configuration Guide

📋 Overview

System używa hierarchicznej konfiguracji z nadpisaniami per-środowisko.

🗂️ Pliki konfiguracyjne

  • src/RAGAdminPanel/appsettings.json — bazowy
  • src/RAGAdminPanel/appsettings.Development.json — dev
  • src/RAGAdminPanel/appsettings.Production.json — prod (opcjonalny)

🔧 Sekcja RAG

RAG to główna sekcja ustawień aplikacji.

Przykład (Development)

{
  "Logging": {
    "LogLevel": { "Default": "Debug", "Microsoft.AspNetCore": "Information", "Microsoft.SemanticKernel": "Debug" }
  },
  "RAG": {
    "EmbeddingProvider": "Local", // Local | OpenAI | AzureOpenAI | GoogleGemini | Ollama
    "RerankingProvider": "Semantic", // Semantic | LLM | Cohere
    "PostgreSQL": {
      "ConnectionString": "Host=localhost;Port=5432;Database=rag;Username=postgres;Password=HasloHaslo122@@@;Trust Server Certificate=true",
      "UseHalfPrecisionIndex": false,
      "HnswM": 16,
      "HnswEfConstruction": 64,
      "HnswEfSearch": 100
    },
    "OpenAI": {
      "ApiKey": "",
      "BaseUrl": "https://api.openai.com/v1",
      "EmbeddingModel": "text-embedding-3-small", // lub text-embedding-3-large
      "ChatModel": "gpt-4o"
    },
    "Ollama": {
      "BaseUrl": "http://localhost:11434/v1",
      "EmbeddingModel": "nomic-embed-text",
      "ChatModel": "llama3.1"
    },
    "OpenRouter": {
      "ApiKey": "",
      "BaseUrl": "https://openrouter.ai/api/v1",
      "ChatModel": "openai/gpt-4o"
    },
    "CustomOpenAI": {
      "ApiKey": "",
      "BaseUrl": "https://api.example.com/v1",
      "ChatModel": "gpt-4o",
      "EmbeddingModel": "text-embedding-3-small"
    },
    "GoogleGemini": {
      "ApiKey": "",
      "BaseUrl": "https://generativelanguage.googleapis.com",
      "EmbeddingModel": "gemini-embedding-001"
    },
    "AzureOpenAI": {
      "Endpoint": "",
      "ApiKey": "",
      "EmbeddingDeployment": "",
      "ChatDeployment": ""
    },
    "Anthropic": {
      "ApiKey": "",
      "BaseUrl": "https://api.anthropic.com",
      "ChatModel": "claude-3.7-sonnet"
    },
    "xAI": {
      "ApiKey": "",
      "BaseUrl": "https://api.x.ai",
      "ChatModel": "grok-4"
    },
    "Cohere": {
      "ApiKey": "",
      "BaseUrl": "https://api.cohere.ai",
      "RerankModel": "rerank-v3.5"
    },
    "GraphDatabase": {
      "Provider": "Neo4j",
      "ConnectionString": "bolt://localhost:7687",
      "Username": "neo4j",
      "Password": "password"
    }
  }
}

🔍 Kluczowe opcje

  • EmbeddingProvider: Local, OpenAI, AzureOpenAI, GoogleGemini
  • RerankingProvider: Semantic, LLM (GPT/Claude/Grok), Cohere
  • PostgreSQL.ConnectionString: connection string do DB z pgvector
  • PostgreSQL.HNSW: UseHalfPrecisionIndex, HnswM, HnswEfConstruction, HnswEfSearch
  • GraphDatabase: konfiguracja Neo4j

🔑 Klucze i modele

  • OpenAI: text-embedding-3-small/3-large, LLM gpt-4o
  • Google: gemini-embedding-001
  • Anthropic: claude-3.7-sonnet
  • xAI: grok-4
  • Cohere: rerank-v3.5

🌐 Zmienne środowiskowe (przykłady)

# Database
RAG__PostgreSQL__ConnectionString="Host=localhost;Port=5432;Database=ragdb_dev;Username=postgres;Password=postgres"

# Providers
RAG__EmbeddingProvider="OpenAI"
RAG__OpenAI__ApiKey="sk-..."
RAG__GoogleGemini__ApiKey="..."
RAG__AzureOpenAI__Endpoint="https://..."
RAG__AzureOpenAI__ApiKey="..."

# Reranking
RAG__RerankingProvider="Cohere"
RAG__Cohere__ApiKey="..."

# Graph
RAG__GraphDatabase__ConnectionString="bolt://localhost:7687"
RAG__GraphDatabase__Username="neo4j"
RAG__GraphDatabase__Password="password"

Uwaga: w UI (Settings.razor) można zapisać preferencje UI (klucze, modele, parametry HNSW) w LocalStorage; wartości efektywne dla backendu pochodzą z konfiguracji aplikacji (lub można dodać ich synchronizację).