lollms-webui/docs/usage/Build_extensions.md

51 lines
2.1 KiB
Markdown
Raw Normal View History

2023-04-15 08:19:09 +00:00
# Extension building manual
## What is an extension
Extensions are little projects built by the community that can be plugged to the generation process to allow users to bring new ideas to the project without feature-creaping it.
There are many types of extensions:
1 - pipeline extensions
These extensions have no UI, they only intercept the communication between the user and the AI, perform some modifications or operations, then submit them to the discussion to enritch it. For example:
2023-08-26 01:07:31 +00:00
- Net enabled LoLLMs (under construction at https://github.com/ParisNeo/Net_enabled-LoLLMs-Extension) : An extension that offers a special personality that indicates to the chatbot that whenever the user is asking a question it has no answer to, it should invoke a search function. The extension intercepts this keyword, do the research on the net then mirror it back to the AI. The AI can then use those inputs to formulate an answer.
- Image enabled LoLLMs : An extension that uses Blip to convert an image into text that can be interpreted by the AI and used in the discussion.
2023-04-15 08:19:09 +00:00
The extension should offer a yaml file that describes it to allow the system to integrate it.
```yaml
2023-08-26 01:07:31 +00:00
# This is a lollms extension project
2023-04-15 08:19:09 +00:00
# Project name : Models tester
# Author : ParisNeo
# Description :
# This extension allows applying the model on a bunch of questions at once and recover answers in a text file
2023-08-26 01:07:31 +00:00
name: LoLLMs-Models-Tester-Extension
2023-04-15 08:19:09 +00:00
author: ParisNeo
description: |
This extension allows applying the model on a bunch of questions at once and recover answers in a text file
version: 1.0
# UI metadata
has_ui: true
2023-05-25 21:24:14 +00:00
# binding metadata
2023-04-15 08:19:09 +00:00
can_trigger_the_model :
# Conditionning override
override_current_personality: true
adds_conditionning: false
conditionning_text: "Respond to my questions."
prefix_text: "Q:"
suffix_text: "A:"
# Send commands to model
sends_commands_to_model: true
# Recover model output
uses_model_output : true
recover_word_by_word : false
recover_generated_text : true
```
The extension should have a extension.py file on its root that implements Extensions interface: