import random
from datetime import time, datetime
# Define a custom function
def is_my_cat_sleep(current_time: datetime) -> bool:
r"""Simulate a random check to determine whether your
cat is sleeping, based on the current time.
Args:
current_time (datetime): The current datetime
to base the cat's behavior on.
Returns:
bool: True if the cat is likely sleeping, False otherwise.
"""
return random.choice([True, False])
# Import the FunctionTool class
from camel.toolkits import FunctionTool
# Create a SocialAgent instance
agent_2 = SocialAgent(
agent_id=1,
user_info=user_info,
tools=[FunctionTool(is_my_cat_sleep)], # allow agent to use custom function tool
agent_graph=agent_graph,
model=openai_model,
available_actions=[ActionType.CREATE_COMMENT],
single_iteration=False
)