File size: 501 Bytes
1e732dd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
696f787
 
1e732dd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
"""
MediGuard AI — Out-of-Scope Node

Returns a polite rejection for non-medical queries.
"""

from __future__ import annotations

from typing import Any

from src.services.agents.prompts import OUT_OF_SCOPE_RESPONSE


def out_of_scope_node(state: dict, *, context: Any) -> dict:
    """Return polite out-of-scope message."""
    if context.tracer:
        context.tracer.trace(name="out_of_scope_node", metadata={"query": state.get("query", "")})
    return {"final_answer": OUT_OF_SCOPE_RESPONSE}