-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: prometheus working integration. prompt WIP
- Loading branch information
Showing
5 changed files
with
335 additions
and
222 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from holmes.core.tools import ToolsetTag | ||
from typing import Dict | ||
from holmes.core.tools import Tool, Toolset | ||
from datetime import datetime | ||
|
||
class CurrentTime(Tool): | ||
def __init__(self): | ||
super().__init__( | ||
name="get_current_time", | ||
description="Return current time information. Useful to build queries that require a time information", | ||
parameters={ | ||
}, | ||
) | ||
|
||
def invoke(self, params: Dict) -> str: | ||
now = datetime.utcnow() | ||
return f"The current UTC date and time are {now}. The current UTC timestamp in seconds is {int(now.timestamp())}." | ||
|
||
def get_parameterized_one_liner(self, params) -> str: | ||
return "fetched current time" | ||
|
||
|
||
class DatetimeToolset(Toolset): | ||
def __init__(self): | ||
super().__init__( | ||
name="datetime", | ||
description="Current date and time information", | ||
icon_url="https://platform.robusta.dev/demos/internet-access.svg", | ||
prerequisites=[ | ||
], | ||
tools=[CurrentTime()], | ||
tags=[ToolsetTag.CORE] | ||
) |
Oops, something went wrong.