pluto90 commited on
Commit
711c69f
·
verified ·
1 Parent(s): a6b176d

Update app/core/prompts/evaluator_prompt.py

Browse files
Files changed (1) hide show
  1. app/core/prompts/evaluator_prompt.py +37 -31
app/core/prompts/evaluator_prompt.py CHANGED
@@ -1,31 +1,37 @@
1
- # evaluator_prompt.py
2
-
3
- from langchain_core.prompts import PromptTemplate
4
-
5
- evaluator_prompt = PromptTemplate(
6
- input_variables=["query", "answer", "context"],
7
- template="""
8
- Evaluate the AI response.
9
-
10
- Rules:
11
- - Be strict
12
- - Output ONLY valid JSON
13
- - No explanation
14
-
15
- Query:
16
- {query}
17
-
18
- Answer:
19
- {answer}
20
-
21
- Context:
22
- {context}
23
-
24
- Return:
25
- {
26
- "relevance_score": number (0 to 1),
27
- "context_usage": number (0 to 1),
28
- "hallucination": true/false
29
- }
30
- """
31
- )
 
 
 
 
 
 
 
1
+ # evaluator_prompt.py# # evaluator_prompt.py
2
+
3
+
4
+ from langchain_core.prompts import PromptTemplate
5
+
6
+ evaluator_prompt = PromptTemplate(
7
+ input_variables=["query", "answer", "context"],
8
+ template="""
9
+ You are an evaluation system.
10
+
11
+ Evaluate the AI response strictly based on the given context.
12
+
13
+ Rules:
14
+ - Be strict
15
+ - Output ONLY valid JSON
16
+ - No explanation
17
+ - No markdown
18
+ - No text before or after JSON
19
+
20
+ Query:
21
+ {query}
22
+
23
+ Answer:
24
+ {answer}
25
+
26
+ Context:
27
+ {context}
28
+
29
+ Return ONLY this JSON:
30
+
31
+ {{
32
+ "relevance_score": 0.0,
33
+ "context_usage": 0.0,
34
+ "hallucination": false
35
+ }}
36
+ """
37
+ )