mirror of
https://github.com/open-webui/pipelines
synced 2025-05-14 09:30:46 +00:00
enh: current time fc
This commit is contained in:
parent
a248b96dba
commit
871348049f
@ -1,6 +1,9 @@
|
|||||||
import os
|
import os
|
||||||
import requests
|
import requests
|
||||||
from typing import Literal, List, Optional
|
from typing import Literal, List, Optional
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
|
|
||||||
from blueprints.function_calling_blueprint import Pipeline as FunctionCallingBlueprint
|
from blueprints.function_calling_blueprint import Pipeline as FunctionCallingBlueprint
|
||||||
|
|
||||||
|
|
||||||
@ -14,6 +17,19 @@ class Pipeline(FunctionCallingBlueprint):
|
|||||||
def __init__(self, pipeline) -> None:
|
def __init__(self, pipeline) -> None:
|
||||||
self.pipeline = pipeline
|
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(
|
def get_current_weather(
|
||||||
self,
|
self,
|
||||||
location: str,
|
location: str,
|
||||||
|
Loading…
Reference in New Issue
Block a user