mirror of
https://github.com/Hopiu/llm.git
synced 2026-03-30 19:30:24 +00:00
- Moved a whole bunch of things from llm/cli.py into llm/__init__.py - Switched plugin listings to use importlib.metadata to avoid deprecation warning - iter_prompt() is now a method on Model, not on Response
17 lines
419 B
Python
17 lines
419 B
Python
import importlib
|
|
import pluggy
|
|
import sys
|
|
from . import hookspecs
|
|
|
|
DEFAULT_PLUGINS = ("llm.default_plugins.openai_models",)
|
|
|
|
pm = pluggy.PluginManager("llm")
|
|
pm.add_hookspecs(hookspecs)
|
|
|
|
if not hasattr(sys, "_called_from_test"):
|
|
# Only load plugins if not running tests
|
|
pm.load_setuptools_entrypoints("llm")
|
|
|
|
for plugin in DEFAULT_PLUGINS:
|
|
mod = importlib.import_module(plugin)
|
|
pm.register(mod, plugin)
|