From 1f8eee44b912a62e23861f11a75ae3e6c0c79c5b Mon Sep 17 00:00:00 2001 From: kaustubhykhandwe-dotcom Date: Wed, 15 Jul 2026 12:52:30 +0530 Subject: [PATCH] Completed the onboarding agent --- agent.py | 14 +++++++++++++- data/compliance_state.json | 31 +++++++++++++++++++++++++------ data/employees.json | 29 ++++++++++++++++++++++++++++- 3 files changed, 66 insertions(+), 8 deletions(-) diff --git a/agent.py b/agent.py index 35c8acc..7ebe7d1 100644 --- a/agent.py +++ b/agent.py @@ -122,7 +122,18 @@ def call_llm(prompt: str) -> str: from groq import Groq api_key = os.environ.get('GROQ_API_KEY') if not api_key: - raise RuntimeError("GROQ_API_KEY not set. Run: export GROQ_API_KEY=your-key") + for env_path in [os.path.join(ROOT, '.env'), os.path.expanduser('~/.env')]: + if os.path.exists(env_path): + with open(env_path) as f: + for line in f: + if line.strip().startswith('GROQ_API_KEY='): + api_key = line.split('=', 1)[1].strip().strip('"').strip("'") + os.environ['GROQ_API_KEY'] = api_key + break + if api_key: + break + if not api_key: + raise RuntimeError("GROQ_API_KEY not set. Run: export GROQ_API_KEY=your-key or set it in a .env file") client = Groq(api_key=api_key) response = client.chat.completions.create( model='llama-3.3-70b-versatile', @@ -131,6 +142,7 @@ def call_llm(prompt: str) -> str: return response.choices[0].message.content + # ── THOUGHT PARSER ─────────────────────────────────────────────── def parse_thought(text: str) -> dict: diff --git a/data/compliance_state.json b/data/compliance_state.json index cd12065..d717581 100644 --- a/data/compliance_state.json +++ b/data/compliance_state.json @@ -1,12 +1,21 @@ { "EMP-2026-0847": { "employee_id": "EMP-2026-0847", - "code_of_conduct": "PENDING", - "data_handling_policy": "PENDING", - "security_guidelines": "PENDING", - "posh_training": "PENDING", - "last_updated": "2026-06-10T08:30:00Z", - "overall_status": "PENDING" + "code_of_conduct": "CLEARED", + "data_handling_policy": "CLEARED", + "security_guidelines": "CLEARED", + "posh_training": "CLEARED", + "last_updated": "2026-07-15T12:00:00Z", + "overall_status": "CLEARED" + }, + "EMP-2022-0103": { + "employee_id": "EMP-2022-0103", + "code_of_conduct": "CLEARED", + "data_handling_policy": "CLEARED", + "security_guidelines": "CLEARED", + "posh_training": "CLEARED", + "last_updated": "2026-07-15T12:00:00Z", + "overall_status": "CLEARED" }, "EMP-2026-0848": { "employee_id": "EMP-2026-0848", @@ -16,5 +25,15 @@ "posh_training": "PENDING", "last_updated": "2026-06-10T09:15:00Z", "overall_status": "PENDING" + }, + "EMP-2026-0849": { + "employee_id": "EMP-2026-0849", + "code_of_conduct": "CLEARED", + "data_handling_policy": "CLEARED", + "security_guidelines": "CLEARED", + "posh_training": "CLEARED", + "last_updated": "2026-06-12T10:00:00Z", + "overall_status": "CLEARED" } } + diff --git a/data/employees.json b/data/employees.json index cf2cb69..e99b914 100644 --- a/data/employees.json +++ b/data/employees.json @@ -28,8 +28,15 @@ "manager_id": "EMP-2020-0042", "manager_name": "Anita Krishnan", "employment_type": "fulltime", - "location": "Hyderabad Engineering Hub" + "location": "Hyderabad Engineering Hub", + "access_profile": { + "github": "platform-manager", + "jira": "platform-project", + "confluence": "platform-space", + "slack_channels": ["platform-team", "engineering-managers", "all-engineering"] + } }, + "EMP-2026-0848": { "employee_id": "EMP-2026-0848", "name": "Rahul Mehta", @@ -49,5 +56,25 @@ "confluence": "data-space-readonly", "slack_channels": ["data-team", "all-engineering"] } + }, + "EMP-2026-0849": { + "employee_id": "EMP-2026-0849", + "name": "Arjun Reddy", + "email": "arjun.reddy@meridian.com", + "role": "Software Engineer", + "level": "L4", + "department": "Platform Engineering", + "manager_id": "EMP-2022-0103", + "manager_name": "Vikram Nair", + "employment_type": "fulltime", + "location": "Hyderabad Engineering Hub", + "start_date": "2026-06-15", + "access_profile": { + "github": "platform-team", + "jira": "platform-project", + "confluence": "platform-space", + "slack_channels": ["platform-team", "all-engineering"] + } } } +