File size: 2,411 Bytes
df55c32
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
from typing import Optional, Dict, Any, List
from core.ports import LLMProvider, LLM1Output, LLM2Output, LLM3Output, STTProvider, VectorStore

class MockLLMProvider:
    def generate_opening_context(self, profile_recap: Optional[str]) -> list:
        return [{"role": "system", "content": "Mocked opening context"}]

    def psychiatrist_response(
        self, context: list, patient_info: dict = None, medium_term_memory: str | None = None
    ) -> LLM1Output:
        return LLM1Output(
            assistant_message="Mocked response from LLM1",
            intent="CONTINUE",
            risk_flag=False,
            clinical_summary=None,
            search_query=None
        )

    def internal_reasoning(
        self, context: list, stable_prefix: str | None = None
    ) -> LLM2Output:
        return LLM2Output(
            assistant_message="Mocked response from LLM2",
            emotional_themes=["theme1"],
            thinking_patterns=["pattern1"],
            behavioral_patterns=["behavior1"],
            interpersonal_dynamics=["dynamic1"],
            stressors=["stressor1"],
            unclear_areas=["unclear1"],
            risk_assessment="No safety concerns identified",
            protective_factors=["factor1"]
        )
        
    def psychiatrist_query_response(self, context: list, retrieved_context: str) -> str:
        return "Mocked query response"
        
    def generate_end_of_session_profile(self, old_profile: dict, session_history: list, patient_info: dict = None) -> LLM3Output:
        return LLM3Output(
            session_summary="Mocked session summary",
            update_profile=True,
            emotional_themes=["theme1"],
            thinking_patterns=["pattern1"],
            behavioral_patterns=["behavior1"],
            interpersonal_dynamics=["dynamic1"],
            stressors=["stressor1"],
            unclear_areas=["unclear1"],
            risk_assessment="No safety concerns identified",
            protective_factors=["factor1"],
            updated_primary_concern=None
        )

class MockSTTProvider:
    def transcribe(self, audio_bytes: bytes) -> Dict[str, Any]:
        return {
            "text": "Mocked transcribed text",
            "emotion": "neutral",
            "event": None
        }

class MockVectorStore:
    def retrieve(self, query: str, k: int = 8) -> str:
        return "Mocked retrieved clinical context"