generated from cheshire-cat-ai/plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
45 additions
and
30 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,27 @@ | ||
# Cranker | ||
|
||
[![awesome plugin](https://custom-icon-badges.demolab.com/static/v1?label=&message=awesome+plugin&color=383938&style=for-the-badge&logo=cheshire_cat_ai)](https://) | ||
[![Awesome plugin](https://custom-icon-badges.demolab.com/static/v1?label=&message=Awesome+plugin&color=000000&style=for-the-badge&logo=cheshire_cat_ai)](https://) | ||
# Cheshire Cat ReRanker | ||
|
||
[![awesome plugin](https://custom-icon-badges.demolab.com/static/v1?label=&message=awesome+plugin&color=F4F4F5&style=for-the-badge&logo=cheshire_cat_black)](https://) | ||
|
||
Write here all the useful information about your plugin. | ||
Cheshire Cat ReRanker apply a rearrangement at each memory with different criteria: | ||
* the [*episodic memory*](https://cheshire-cat-ai.github.io/docs/conceptual/memory/episodic_memory/) is reordered according to a temporal criteria, from the newest to the oldest. | ||
* the [*declarative memory*](https://cheshire-cat-ai.github.io/docs/conceptual/memory/declarative_memory/) is reordered according the [**lost in the middle** paper](https://arxiv.org/abs/2307.03172) method | ||
* the [*procedural memory*](https://cheshire-cat-ai.github.io/docs/conceptual/memory/procedural_memory/) isn't reordered but filtered using a threshold, the default value is 0.5 but you can set it. | ||
|
||
This repository is the template to automate the release of official Cheshire Cat AI plugins. | ||
The ReRanker can be enabled and disabled for each memory independently using the "Settings". | ||
|
||
## Usage | ||
## Installation | ||
|
||
1. Create a new repository clicking on the `Use this template` button. | ||
2. Clone your new repo directly in the Cat's `plugins` folder. | ||
3. Run the `setup.py` script: | ||
```bash | ||
python setup.py | ||
``` | ||
The script will prompt you to write the name of your plugin and make an initial setup setting the name in the files. | ||
1. Navigate to the `Plugins` page; | ||
2. Scroll until you find the "Cheshire Cat ReRanker" plugin; | ||
3. Click on `Install | ||
|
||
4. Start developing! | ||
## Usage | ||
|
||
> **Important** | ||
> A new release of your plugin is triggered every time you set a new `version` in the `plugin.json` file. | ||
> Please, remember to set it correctly every time to want to release an update. | ||
1. Navigate to the `Plugins` page; | ||
2. Scroll until you find the "Cheshire Cat ReRanker" plugin; | ||
3. Click on the "Settings" icon on the bottom right of the plugin card; | ||
4. Edit the available settings and save. | ||
|
||
> **Important** | ||
> ReRankers (in particular Lost In The Middle) are very useful if you get at least more than 10 documents returned from the memories. | ||
> Before using it download and enable the [C.A.T. plugin](https://github.com/Furrmidable-Crew/cat_advanced_tools) from the Plugins store, [follow the instructions](https://github.com/Furrmidable-Crew/cat_advanced_tools#usage) to increase the k parameter of the memories. |
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 |
---|---|---|
@@ -1,10 +1,9 @@ | ||
{ | ||
"name": "Cheshire Cat Reranker", | ||
"version": "0.0.1", | ||
"description": "Description of cranker.", | ||
"version": "0.1.0", | ||
"description": "This plugin apply a reranking to each memory. It rearranges: the episodic memory from the most recent to the oldest, the declarative using lost in the middle and the procedural using a filter.", | ||
"author_name": "nickprock", | ||
"author_url": "https://mywebsite.me", | ||
"plugin_url": "https://github.com/my_name/cranker", | ||
"tags": "cat, template, example", | ||
"thumb": "https://raw.githubusercontent.com/my_repo_path/cranker.png" | ||
"plugin_url": "https://github.com/nickprock/ccat_reranker", | ||
"tags": "cat, memory, advanced, reranker", | ||
"thumb": "https://raw.githubusercontent.com/nickprock/ccat_reranker/main/img.jpg" | ||
} |
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,13 @@ | ||
from cat.mad_hatter.decorators import plugin | ||
from pydantic import BaseModel, Field | ||
|
||
|
||
class MySettings(BaseModel): | ||
LITM: bool = True, | ||
RECENTNESS: bool = True, | ||
FILTER: bool = True, | ||
tool_threshold: float = 0.5 | ||
|
||
@plugin | ||
def settings_schema(): | ||
return MySettings.schema() |