mirror of
https://github.com/Hopiu/llm.git
synced 2026-04-19 20:51:02 +00:00
Docs for llm.ModelError, refs #96
This commit is contained in:
parent
18a89d8bb8
commit
f7364f406e
1 changed files with 11 additions and 0 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue