-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathproxy.yaml
More file actions
78 lines (65 loc) · 2.5 KB
/
proxy.yaml
File metadata and controls
78 lines (65 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
port: ":9092"
target_url: "http://localhost:11434"
# Configurazione Embedder (usa il tuo modello locale)
embedder_type: "ollama_api"
embedder_url: "http://localhost:11434/api/embeddings"
embedder_model: "nomic-embed-text-v2-moe:latest"
embedder_timeout: 60s
# RAG Automatico
rag_enabled: true
rag_index: "knowledge_base" # Deve coincidere con l'indice popolato dai Vectorizer!
rag_top_k: 8
# RAG usa SIMILARITÀ (Higher is Better, 0.0-1.0)
rag_threshold: 0.6 # Ignore chunks with similarity score < 0.6
rag_use_hybrid: true # Cerca anche per parole chiave
rag_hybrid_alpha: 0.7 # 70% Vettore, 30% Keywords
rag_use_graph: true # Recupera automaticamente contesto prev/next
rag_use_hyde: true
# System Prompt Template
# Usa {{context}} per iniettare i dati trovati e {{query}} per la domanda originale.
# Il simbolo '|' permette stringhe multilinea in YAML.
# Firewall (Prompt Guard)
firewall_enabled: true
firewall_deny_list: # regex firewall
- "ignore previous instructions"
- "system prompt"
- "password"
- "scemo"
firewall_index: "prompt_guard" #semantic firewall
# Firewall usa DISTANZA (Lower is Better)
firewall_threshold: 0.25 # Block if distance < 0.25
block_message: "I cannot fulfill this request as it violates safety policies."
# Semantic Cache
cache_enabled: true
cache_index: "semantic_cache_test"
# Cache usano DISTANZA (Lower is Better)
cache_threshold: 0.1 # Cache hit if distance < 0.1
cache_ttl: "5s"
max_cache_items: 100
cache_vacuum_interval: "2s"
cache_delete_threshold: 0.0 # 0.0 = Pulisci sempre se c'è anche solo 1 cancellazione
# rewriter
fast_llm:
base_url: "http://localhost:11434/v1"
model: "gemma3:4b"
# HyDe
llm:
base_url: "http://localhost:11434/v1"
model: "gemma3:4b"
rag_system_prompt: |
Sei un assistente tecnico esperto.
Il tuo compito è rispondere alla domanda dell'utente usando ESCLUSIVAMENTE le informazioni fornite nel contesto sottostante.
LINEE GUIDA:
1. Sii DETTAGLIATO ed ESAUSTIVO.
2. CITAZIONI: Usa [Fonte: nomefile].
3. LINGUA: Rispondi nella stessa lingua della domanda.
REGOLE RIGIDE:
1. Se nel testo vedi un link immagine che inizia con http://.../assets/..., devi mostrarlo.
2. Per mostrarlo, usa ESATTAMENTE questa sintassi Markdown col punto esclamativo davanti:

3. Non usare mai la sintassi [Testo](Link) per le immagini, usa sempre .
Se il contesto non contiene la risposta, dì chiaramente: "Non ho informazioni sufficienti nei documenti".
Contesto:
{{context}}
Domanda:
{{query}}