File size: 1,350 Bytes
fd1472e
 
627c291
fd1472e
 
 
 
 
 
627c291
fd1472e
 
627c291
 
 
 
fd1472e
 
 
 
627c291
fd1472e
 
 
627c291
 
fd1472e
 
627c291
 
 
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
"""Tests for judge prompt domain support."""

from src.config.domain import SEXUAL_HEALTH_CONFIG, ResearchDomain
from src.prompts.judge import format_user_prompt, get_scoring_prompt, get_system_prompt


class TestJudgePromptDomain:
    def test_get_system_prompt_default(self):
        prompt = get_system_prompt()
        assert SEXUAL_HEALTH_CONFIG.judge_system_prompt in prompt
        assert "Your task is to SCORE evidence" in prompt

    def test_get_system_prompt_sexual_health(self):
        prompt = get_system_prompt(ResearchDomain.SEXUAL_HEALTH)
        assert SEXUAL_HEALTH_CONFIG.judge_system_prompt in prompt
        assert "sexual health" in prompt.lower()
        assert "Your task is to SCORE evidence" in prompt

    def test_get_scoring_prompt_default(self):
        prompt = get_scoring_prompt()
        assert SEXUAL_HEALTH_CONFIG.judge_scoring_prompt == prompt

    def test_format_user_prompt_default(self):
        prompt = format_user_prompt("query", [])
        assert SEXUAL_HEALTH_CONFIG.judge_scoring_prompt in prompt
        assert "sexual health" in prompt.lower()

    def test_format_user_prompt_with_domain(self):
        prompt = format_user_prompt("query", [], domain=ResearchDomain.SEXUAL_HEALTH)
        assert SEXUAL_HEALTH_CONFIG.judge_scoring_prompt in prompt
        assert "sexual health" in prompt.lower()