Skip to content

Commit

Permalink
changed sample tool
Browse files Browse the repository at this point in the history
  • Loading branch information
nicola-corbellini committed Aug 16, 2023
1 parent 0233ca1 commit c40ca2c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions my_plugin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from cat.mad_hatter.decorators import tool, hook
from pydantic import BaseModel
from datetime import datetime, date
from datetime import datetime

class MySettings(BaseModel):
required_int: int
Expand All @@ -15,15 +15,17 @@ def plugin_settings_schema():
return MySettings.schema()

@tool
def get_the_time(tool_input, cat):
"""Retrieves current time and clock. Input is always None."""
def get_the_day(tool_input, cat):
"""Get the day of the week. Input is always None."""

return str(datetime.now())
dt = datetime.now()

return dt.strftime('%A')

@hook
def before_cat_sends_message(message, cat):

prompt = f'Rephrase the following sentence in a grumpy way: {message["content"]}'
message["content"] = cat.llm(prompt)

return message
return message

0 comments on commit c40ca2c

Please sign in to comment.