Skip to content

Commit

Permalink
Initial setup
Browse files Browse the repository at this point in the history
  • Loading branch information
zAlweNy26 committed Aug 4, 2023
1 parent 299f315 commit dd35cb9
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 2 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Create Release

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
push:
branches:
- main
tags:
- "v*.*.*"

jobs:
test:

strategy:
matrix:
python-version: ["3.10"]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install pip dependencies
run: |
python -m pip install --upgrade pip
if [ -f my_plugin/requirements.txt ]; then pip install -r my_plugin/requirements.txt; fi
- name: Publish GitHub release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
draft: false
prerelease: false

5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# plugin-template
A generic template to create a plugin for the Cheshire Cat AI.
# My Plugin

Write here all the useful informations about your plugin.
16 changes: 16 additions & 0 deletions my_plugin/my_plugin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from cat.mad_hatter.decorators import tool, hook
from datetime import datetime

@tool
def get_the_time(tool_input, cat):
"""Retrieves current time and clock. Input is always None."""

return str(datetime.now())

@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
10 changes: 10 additions & 0 deletions my_plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "My plugin",
"version": "0.0.1",
"description": "Description of my plugin.",
"author_name": "Me",
"author_url": "https://myportfolio.me",
"plugin_url": "https://github.com/link_to_my_plugin_repository",
"tags": "cat, template, example",
"thumb": "my_plugin_logo.png"
}
Empty file added my_plugin/requirements.txt
Empty file.

0 comments on commit dd35cb9

Please sign in to comment.