You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
692 B
26 lines
692 B
from langchain.tools import tool
|
|
|
|
from swarms.tools.base import BaseToolSet, SessionGetter, ToolScope
|
|
from swarms.utils.logger import logger
|
|
|
|
|
|
class ExitConversation(BaseToolSet):
|
|
@tool(
|
|
name="Exit Conversation",
|
|
description="A tool to exit the conversation. "
|
|
"Use this when you want to exit the conversation. "
|
|
"The input should be a message that the conversation is over.",
|
|
scope=ToolScope.SESSION,
|
|
)
|
|
def exit(self, message: str, get_session: SessionGetter) -> str:
|
|
"""Run the tool."""
|
|
_, executor = get_session()
|
|
del executor
|
|
|
|
logger.debug("\nProcessed ExitConversation.")
|
|
|
|
return message
|
|
|
|
|
|
|