diff --git a/plugins/action_items_todo.yaml b/plugins/action_items_todo.yaml new file mode 100644 index 0000000..b0483fb --- /dev/null +++ b/plugins/action_items_todo.yaml @@ -0,0 +1,11 @@ +name: action_items_todo +description: Extract action items and todos from the transcript +model: llama2 # Optional, falls back to OLLAMA_MODEL from .env +type: or # or, and, all +prompt: | + Extract action items and todos from the following transcript. + Format each item as a markdown checkbox. + If there are no action items or todos, output "No action items or todos found." + + Transcript: + {transcript} \ No newline at end of file diff --git a/plugins/summary.all.yaml b/plugins/summary.all.yaml new file mode 100644 index 0000000..2787a85 --- /dev/null +++ b/plugins/summary.all.yaml @@ -0,0 +1,10 @@ +name: summary +description: Generate a concise summary of the transcript +model: llama2 # Optional, falls back to OLLAMA_MODEL from .env +type: all # or, and, all +prompt: | + Please provide a concise summary of the following transcript. + Focus on the main points and key takeaways. + + Transcript: + {transcript} \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 11fe964..4560d2f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,6 +4,7 @@ python-dotenv>=1.0.0 ollama>=0.1.17 watchdog>=3.0.0 inflect>=7.5.0 +pyyaml>=6.0.1 # Development dependencies pytest>=7.4.0 diff --git a/src/plugin_manager.py b/src/plugin_manager.py new file mode 100644 index 0000000..719959e --- /dev/null +++ b/src/plugin_manager.py @@ -0,0 +1,56 @@ +#!/usr/bin/env python3 + +from pathlib import Path +import yaml +from typing import Dict, Optional +from dataclasses import dataclass + +@dataclass +class Plugin: + name: str + description: str + model: Optional[str] + type: str # or, and, all + prompt: str + +class PluginManager: + def __init__(self, plugin_dir: Path): + self.plugin_dir = plugin_dir + self.plugins: Dict[str, Plugin] = {} + self.load_plugins() + + def load_plugins(self) -> None: + """Load all YAML plugins from the plugin directory.""" + for plugin_file in self.plugin_dir.glob("*.yaml"): + with open(plugin_file, 'r', encoding='utf-8') as f: + data = yaml.safe_load(f) + + # Validate required fields + required_fields = ['name', 'description', 'type', 'prompt'] + for field in required_fields: + if field not in data: + raise ValueError(f"Plugin {plugin_file} is missing required field: {field}") + + # Create Plugin instance + plugin = Plugin( + name=data['name'], + description=data['description'], + model=data.get('model'), # Optional + type=data['type'], + prompt=data['prompt'] + ) + + self.plugins[plugin.name] = plugin + + def get_plugin(self, name: str) -> Optional[Plugin]: + """Get a plugin by name.""" + return self.plugins.get(name) + + def get_all_plugins(self) -> Dict[str, Plugin]: + """Get all loaded plugins.""" + return self.plugins + + def get_plugins_by_type(self, plugin_type: str) -> Dict[str, Plugin]: + """Get all plugins of a specific type.""" + return {name: plugin for name, plugin in self.plugins.items() + if plugin.type == plugin_type} \ No newline at end of file