File size: 585 Bytes
2a51e7d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from pydantic import BaseModel
from typing_extensions import TypedDict
from langgraph.graph.message import add_messages, AnyMessage
from typing import Annotated, List

class State(TypedDict):
    messages: Annotated[List[AnyMessage], add_messages]
    ask_human: bool

class RequestAssistance(BaseModel):
    """
    Escalate the conversation to an expert. Use this if you are unable to assist directly or if the user requires support beyond your permissions.
    To use this function, relay the user's 'request' so the expert can provide the right guidance.
    """
    request: str