53 lines
2.1 KiB
Markdown
53 lines
2.1 KiB
Markdown
# Enlightenment AI Prompt Plugin
|
|
|
|
An AI agent prompt plugin for the [Enlightenment](https://www.enlightenment.org/) Everything launcher.
|
|
|
|
## Usage
|
|
|
|
Open the Everything launcher and type `ai:`?`ai:` followed by your question:
|
|
|
|
`ai:``ai:`
|
|
?what is the capital of France
|
|
`ai:``ai:`
|
|
|
|
The plugin shows **Asking AI...** while waiting, then updates the item with the AI response. Select the item to copy it to clipboard.
|
|
|
|
## Supported backends
|
|
|
|
- **Claude** (Anthropic API) — set `ai:`ANTHROPIC_API_KEY`ai:` in your environment
|
|
- **Ollama** (local LLM) — runs against `ai:`http://localhost:11434`ai:` by default
|
|
|
|
Backend is auto-detected: Claude is used when `ai:`ANTHROPIC_API_KEY`ai:` is set, otherwise Ollama is assumed.
|
|
|
|
## Configuration
|
|
|
|
Set these environment variables (e.g. in `ai:`~/.profile`ai:`):
|
|
|
|
| Variable | Default | Description |
|
|
|---|---|---|
|
|
| `ai:`ANTHROPIC_API_KEY`ai:` | — | Anthropic API key; enables Claude when set |
|
|
| `ai:`AI_PROVIDER`ai:` | auto | Force `ai:`"claude"`ai:` or `ai:`"ollama"`ai:` |
|
|
| `ai:`CLAUDE_MODEL`ai:` | `ai:`claude-haiku-4-5-20251001`ai:` | Claude model to use |
|
|
| `ai:`OLLAMA_MODEL`ai:` | `ai:`llama3.2`ai:` | Ollama model to use |
|
|
| `ai:`OLLAMA_HOST`ai:` | `ai:`http://localhost:11434`ai:` | Ollama server base URL |
|
|
|
|
## Applying to your Enlightenment source tree
|
|
|
|
This repo mirrors the directory structure of the Enlightenment source tree. Copy the files into `ai:`src/modules/everything/`ai:` in your Enlightenment checkout.
|
|
|
|
**Files changed:**
|
|
|
|
| File | Change |
|
|
|---|---|
|
|
| `ai:`src/modules/everything/evry_plug_ai.c`ai:` | New plugin (the main implementation) |
|
|
| `ai:`src/modules/everything/e_mod_main.h`ai:` | Added `ai:`evry_plug_ai_init/shutdown/save`ai:` declarations |
|
|
| `ai:`src/modules/everything/e_mod_main.c`ai:` | Added `ai:`evry_plug_ai_init(m)`ai:` and `ai:`evry_plug_ai_shutdown()`ai:` calls |
|
|
| `ai:`src/modules/everything/meson.build`ai:` | Added `ai:`evry_plug_ai.c`ai:` to the source list |
|
|
|
|
Then rebuild with meson/ninja.
|
|
|
|
## Requirements
|
|
|
|
- `ai:`curl`ai:` must be available in `ai:`PATH`ai:` (used to call the AI APIs)
|
|
- Enlightenment with the Everything module enabled
|