Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions plugins/examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Plugin Examples

Example plugins demonstrating integration with the Plugins Adapter

## Available Examples

### nemo
Internal plugin that wraps NeMo Guardrails for PII detection using an Ollama model
- **Type**: Internal (same deployment)
- See [nemo/README.md](./nemo/README.md) for details

### nemocheck
External plugin adapter for NeMo Guardrails check server
- **Type**: External (separate service)
- Requires separate NeMo check server deployment
- See [nemocheck/README.md](./nemocheck/README.md) for details

## Usage

Reference plugins in the plugin adapter config (default at `resources/config/config.yaml`):

**Internal plugin:**
```yaml
plugins:
- name: nemo
kind: "plugins.examples.nemo.nemo_wrapper_plugin.NemoWrapperPlugin"
```

**External plugin:**
```yaml
plugins:
- name: nemocheck
kind: external
mcp:
proto: STREAMABLEHTTP
url: http://nemocheck-plugin-service:8000/mcp
```
2 changes: 1 addition & 1 deletion plugins/examples/nemo/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Nemo guardrails plugin example
# Nemo guardrails internal plugin example

The `NemoWrapperPlugin` in `nemo_wrapper_plugin.py` currently invokes the simple flow in `pii_detect_config` which leverages an ollama model through `host.docker.internal`. The model can be easily replaced in the `config.yml`.

Expand Down
22 changes: 18 additions & 4 deletions resources/config/config.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# plugins/config.yaml - Main plugin configuration file
plugins:
# Self-contained Search Replace Plugin
# Self-contained Search Replace Plugin - depends on plugin availability
- name: "ReplaceBadWordsPlugin"
kind: "plugins.regex_filter.search_replace.SearchReplacePlugin"
# From https://github.com/contextforge-org/contextforge-plugins-python
kind: "contextforge-plugins-python.regex_filter.search_replace.SearchReplacePlugin"
description: "A plugin for finding and replacing words."
version: "0.1.0"
author: "Teryl Taylor"
Expand All @@ -21,12 +22,25 @@ plugins:
replace: crud
- search: crud
replace: yikes
# Nemo example
- name: "NemoWrapperPlugin"
kind: "plugins.examples.nemo.nemo_wrapper_plugin.NemoWrapperPlugin"
description: "A simple Nemo PII detector"
version: "0.1.0"
author: "Evaline Ju"
hooks: ["tool_pre_invoke", "tool_post_invoke"]
tags: ["plugin", "pre-post"]
mode: "enforce" # enforce | permissive | disabled
priority: 150
config:
foo: bar

# Plugin directories to scan
plugin_dirs:
- "plugins/native" # Built-in plugins
- "plugins/custom" # Custom organization plugins
- "plugins/native" # Built-in plugins
- "plugins/custom" # Custom organization plugins
- "/etc/mcpgateway/plugins" # System-wide plugins
- "plugins/examples/nemo" # Example Nemo guardrails plugins

# Global plugin settings
plugin_settings:
Expand Down