server-personification/pers/langchain/tools/terminate.py

12 lines
264 B
Python

import sys
from langchain_core.tools import tool
from termcolor import colored
@tool
def terminate_chat():
"""Terminate the chat connection to the user"""
print(colored('The agent has terminated the connection.', 'red', attrs=['bold']))
sys.exit(1)