Skip to content

Commit

Permalink
Feat: added timezone to current time
Browse files Browse the repository at this point in the history
  • Loading branch information
EldarAlvik committed Nov 7, 2024
1 parent b9613b4 commit b0f2b49
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Binary file modified core/requirements.txt
Binary file not shown.
8 changes: 4 additions & 4 deletions core/tools/current_time_iso.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
from langchain_core.tools import tool
from pydantic import BaseModel, Field
from langchain_core.tools.structured import StructuredTool
from datetime import datetime


from datetime import datetime, timezone
import pytz


#Dormamu I've come to bargain
Expand All @@ -17,7 +16,8 @@ def current_time_iso_format(basetool):
Returns:
str: The current time in ISO format.
"""
time = datetime.now().replace(microsecond=0).strftime('%Y-%m-%dT%H:%M:%S')
timezone = pytz.timezone('Europe/Stockholm')
time = datetime.now(timezone).replace(microsecond=0).strftime('%Y-%m-%dT%H:%M:%S')
return time

def get_tool() -> StructuredTool:
Expand Down

0 comments on commit b0f2b49

Please sign in to comment.