Docs for llm.ModelError, refs #96

This commit is contained in:
Simon Willison 2023-07-11 10:55:28 -07:00
parent 18a89d8bb8
commit f7364f406e

View file

@ -19,3 +19,14 @@ plugin_dir = data_path = user_dir / "my-plugin"
plugin_dir.mkdir(exist_ok=True)
data_path = plugin_dir / "plugin-data.db"
```
## llm.ModelError
If your model encounters an error that should be reported to the user you can raise this exception. For example:
```python
import llm
raise ModelError("MPT model not installed - try running 'llm mpt30b download'")
```
This will be caught by the CLI layer and displayed to the user as an error message.