diff --git a/tools/__init__.py b/tools/__init__.py index b37b867..70dd16d 100644 --- a/tools/__init__.py +++ b/tools/__init__.py @@ -8,9 +8,9 @@ from .list_agents import list_agents from .change_goal import change_goal from .transfer_control import transfer_control -from .current_pto import current_pto -from .book_pto import book_pto -from .future_pto_calc import future_pto_calc +from .hr.current_pto import current_pto +from .hr.book_pto import book_pto +from .hr.future_pto_calc import future_pto_calc def get_handler(tool_name: str): diff --git a/tools/data/employee_pto_data.json b/tools/data/employee_pto_data.json index 1f31a26..38a6329 100644 --- a/tools/data/employee_pto_data.json +++ b/tools/data/employee_pto_data.json @@ -8,7 +8,7 @@ "hrsAddedPerMonth": 8 }, { - "email": "laine.smith@awesome.com", + "email": "lainecaseysmith@gmail.com", "currentPTOHrs": 40, "hrsAddedPerMonth": 12 } diff --git a/tools/goal_registry.py b/tools/goal_registry.py index 055fee3..369f10c 100644 --- a/tools/goal_registry.py +++ b/tools/goal_registry.py @@ -2,7 +2,22 @@ from typing import List from models.tool_definitions import AgentGoal import tools.tool_registry as tool_registry -starter_prompt_generic = "Welcome me, give me a description of what you can do, then ask me for the details you need to do your job. " +# Turn on Silly Mode - this should be a description of the persona you'd like the bot to have and can be a single word or a phrase. +# Example if you want the bot to be a specific person, like Mario or Christopher Walken, or to describe a specific tone: +#SILLY_MODE="Christopher Walken" +#SILLY_MODE="belligerent" +# +# Example if you want it to take on a persona (include 'a'): +#SILLY_MODE="a pirate" +# Note - this only works with certain LLMs. Grok for sure will stay in character, while OpenAI will not. +SILLY_MODE="off" +if SILLY_MODE is not None and SILLY_MODE != "off": + silly_prompt = "You are " + SILLY_MODE +", stay in character at all times. " + print("Silly mode is on: " + SILLY_MODE) +else: + silly_prompt = "" + +starter_prompt_generic = silly_prompt + "Welcome me, give me a description of what you can do, then ask me for the details you need to do your job." goal_choose_agent_type = AgentGoal( id = "goal_choose_agent_type", @@ -18,13 +33,13 @@ goal_choose_agent_type = AgentGoal( "1. ListAgents: List agents available to interact with. Do not ask for user confirmation for this tool. " "2. ChangeGoal: Change goal of agent " "After these tools are complete, change your goal to the new goal as chosen by the user. ", - starter_prompt=starter_prompt_generic + "Begin by providing the output for the first tool included in this goal. ", + starter_prompt=starter_prompt_generic + "Begin by listing all details of all agents as provided by the output of the first tool included in this goal. ", example_conversation_history="\n ".join( [ "agent: Here are the currently available agents.", "user_confirmed_tool_run: ", "tool_result: { 'agent_name': 'Event Flight Finder', 'goal_id': 'goal_event_flight_invoice', 'agent_description': 'Helps users find interesting events and arrange travel to them' }", - "agent: The available agents are: 1. Event Flight Finder. Which agent would you like to speak to?", + "agent: The available agents are: 1. Event Flight Finder. \n Which agent would you like to speak to?", "user: 1", "user_confirmed_tool_run: ", "tool_result: { 'new_goal': 'goal_event_flight_invoice' }", diff --git a/tools/book_pto.py b/tools/hr/book_pto.py similarity index 59% rename from tools/book_pto.py rename to tools/hr/book_pto.py index 4d4b821..457709a 100644 --- a/tools/book_pto.py +++ b/tools/hr/book_pto.py @@ -4,6 +4,8 @@ def book_pto(args: dict) -> dict: start_date = args.get("start_date") end_date = args.get("end_date") + print(f"[BookPTO] Totally would send an email confirmation of PTO from {start_date} to {end_date} to {email} here!") + return { "status": "success" - } + } \ No newline at end of file diff --git a/tools/current_pto.py b/tools/hr/current_pto.py similarity index 88% rename from tools/current_pto.py rename to tools/hr/current_pto.py index 9e56248..0675e7a 100644 --- a/tools/current_pto.py +++ b/tools/hr/current_pto.py @@ -6,7 +6,7 @@ def current_pto(args: dict) -> dict: email = args.get("email") - file_path = Path(__file__).resolve().parent / "data" / "employee_pto_data.json" + file_path = Path(__file__).resolve().parent.parent / "data" / "employee_pto_data.json" if not file_path.exists(): return {"error": "Data file not found."} diff --git a/tools/future_pto_calc.py b/tools/hr/future_pto_calc.py similarity index 89% rename from tools/future_pto_calc.py rename to tools/hr/future_pto_calc.py index b4e557b..66eebba 100644 --- a/tools/future_pto_calc.py +++ b/tools/hr/future_pto_calc.py @@ -7,7 +7,7 @@ from dateutil.relativedelta import relativedelta def future_pto_calc(args: dict) -> dict: - file_path = Path(__file__).resolve().parent / "data" / "employee_pto_data.json" + file_path = Path(__file__).resolve().parent.parent / "data" / "employee_pto_data.json" if not file_path.exists(): return {"error": "Data file not found."} @@ -28,6 +28,9 @@ def future_pto_calc(args: dict) -> dict: #Get the number of business days, and then business hours (assume 8 hr biz day), included in the PTO request biz_days_of_request = len(pandas.bdate_range(start=start_date, end=end_date, inclusive="both")) + if biz_days_of_request == 0: + return_msg = "There are no business days between " + args.get("start_date") + " and " + args.get("end_date") + return {"error": return_msg} biz_hours_of_request = biz_days_of_request * 8 #Assume PTO is added on the first of every month - month math compares rolling dates, so compare the PTO request with the first day of the current month.