From 632d87c195ed52da45d4150c8d6eb64bbc96f243 Mon Sep 17 00:00:00 2001 From: Andres Caicedo Date: Tue, 4 Apr 2023 11:28:15 +0200 Subject: [PATCH] Update commands.py Just import datetime from datetime library. --- scripts/commands.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/commands.py b/scripts/commands.py index 42fe1ebb..7873c048 100644 --- a/scripts/commands.py +++ b/scripts/commands.py @@ -1,7 +1,7 @@ import browse import json import memory as mem -import datetime +from datetime import datetime import agent_manager as agents import speak from config import Config @@ -110,7 +110,7 @@ def execute_command(command_name, arguments): def get_datetime(): """Return the current date and time""" return "Current date and time: " + \ - datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") + datetime.now().strftime("%Y-%m-%d %H:%M:%S") def google_search(query, num_results=8): @@ -122,6 +122,7 @@ def google_search(query, num_results=8): return json.dumps(search_results, ensure_ascii=False, indent=4) def google_official_search(query, num_results=8): + """Return the results of a google search using the official Google API""" from googleapiclient.discovery import build from googleapiclient.errors import HttpError import json