From 871348049f3071f260496d04b89b539642493079 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Sat, 1 Jun 2024 14:38:01 -0700 Subject: [PATCH] enh: current time fc --- .../function_calling_filter_pipeline.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/examples/function_calling/function_calling_filter_pipeline.py b/examples/function_calling/function_calling_filter_pipeline.py index 8db3da5..a0f5298 100644 --- a/examples/function_calling/function_calling_filter_pipeline.py +++ b/examples/function_calling/function_calling_filter_pipeline.py @@ -1,6 +1,9 @@ import os import requests from typing import Literal, List, Optional +from datetime import datetime + + from blueprints.function_calling_blueprint import Pipeline as FunctionCallingBlueprint @@ -14,6 +17,19 @@ class Pipeline(FunctionCallingBlueprint): def __init__(self, pipeline) -> None: self.pipeline = pipeline + def get_current_time( + self, + ) -> str: + """ + Get the current time. + + :return: The current time. + """ + + now = datetime.now() + current_time = now.strftime("%H:%M:%S") + return f"Current Time = {current_time}" + def get_current_weather( self, location: str,