kotaemon/libs/ktem/ktem/extension_protocol.py
Duc Nguyen (john) 2dd531114f Make ktem official (#134)
* Move kotaemon and ktem into same folder

* Update docs

* Update CI

* Resolve mypy, isorts

* Re-allow test pdf files
2024-01-23 10:54:18 +07:00

40 lines
1.1 KiB
Python

import pluggy
hookspec = pluggy.HookspecMarker("ktem")
hookimpl = pluggy.HookimplMarker("ktem")
@hookspec
def ktem_declare_extensions() -> dict: # type: ignore
"""Called before the run() function is executed.
This hook is called without any arguments, and should return a dictionary.
The dictionary has the following structure:
```
{
"id": str, # cannot contain . or /
"name": str, # human-friendly name of the plugin
"version": str,
"support_host": str,
"functionality": {
"reasoning": {
id: { # cannot contain . or /
"name": str,
"callbacks": {},
"settings": {},
},
},
"index": {
"name": str,
"callbacks": {
"get_index_pipeline": callable,
"get_retrievers": {name: callable}
},
"settings": {},
},
},
}
```
"""