From dddd2977b9cde023366d6e1710f8b7e13e56fe7b Mon Sep 17 00:00:00 2001 From: Joshua Smith Date: Sun, 13 Apr 2025 17:03:50 -0400 Subject: [PATCH] adding ecommerce to .env.example and some error handling in track_package --- .env.example | 2 +- tools/ecommerce/track_package.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index ead99c0..844fd27 100644 --- a/.env.example +++ b/.env.example @@ -43,7 +43,7 @@ AGENT_GOAL=goal_choose_agent_type # for multi-goal start #Choose which category(ies) of goals you want to be listed by the Agent Goal picker if enabled above # - options are system (always included), hr, travel, or all. -GOAL_CATEGORIES=hr,travel-flights,travel-trains,fin # default is all +GOAL_CATEGORIES=hr,travel-flights,travel-trains,fin,ecommerce # default is all #GOAL_CATEGORIES=travel-flights # Set if the workflow should wait for the user to click a confirm button (and if the UI should show the confirm button and tool args) diff --git a/tools/ecommerce/track_package.py b/tools/ecommerce/track_package.py index 971eb11..55b14fd 100644 --- a/tools/ecommerce/track_package.py +++ b/tools/ecommerce/track_package.py @@ -92,7 +92,8 @@ def track_package(args: dict) -> dict: carrier = json_data["Carrier"] status_summary = json_data["StatusSummary"] tracking_details = json_data.get("TrackingDetails", []) - if tracking_details is not None and tracking_details[0] is not None: + last_tracking_update = "" + if tracking_details and tracking_details is not None and tracking_details[0] is not None: last_tracking_update = tracking_details[0]["EventDateTimeInDateTimeFormat"] tracking_link = "" if carrier == "USPS":