feat: refactor extensions as npm packages (be brave 1)

This commit is contained in:
Mohamed Marrouchi
2024-10-22 11:01:44 +01:00
parent 4cf5c57053
commit 35cf78c523
87 changed files with 394 additions and 331 deletions

View File

@@ -1,3 +1,3 @@
{
"ollama": "Ollama"
"ollama_plugin": "Ollama Plugin"
}

View File

@@ -1,3 +1,3 @@
{
"ollama": "Ollama"
"ollama_plugin": "Ollama Plugin"
}

View File

@@ -14,14 +14,13 @@ import { HelperType } from '@/helper/types';
import { LoggerService } from '@/logger/logger.service';
import { BaseBlockPlugin } from '@/plugins/base-block-plugin';
import { PluginService } from '@/plugins/plugins.service';
import { PluginBlockTemplate } from '@/plugins/types';
import { OLLAMA_PLUGIN_SETTINGS } from './settings';
import SETTINGS from './settings';
@Injectable()
export class OllamaPlugin extends BaseBlockPlugin<
typeof OLLAMA_PLUGIN_SETTINGS
> {
public readonly settings = OLLAMA_PLUGIN_SETTINGS;
export class OllamaPlugin extends BaseBlockPlugin<typeof SETTINGS> {
template: PluginBlockTemplate = { name: 'Ollama Plugin' };
constructor(
pluginService: PluginService,
@@ -30,12 +29,11 @@ export class OllamaPlugin extends BaseBlockPlugin<
private contentService: ContentService,
private messageService: MessageService,
) {
super('ollama', OLLAMA_PLUGIN_SETTINGS, pluginService);
super('ollama-plugin', pluginService);
}
this.template = { name: 'Ollama Plugin' };
this.effects = {
onStoreContextData: () => {},
};
getPath(): string {
return __dirname;
}
async process(block: Block, context: Context, _convId: string) {

View File

@@ -1,11 +1,10 @@
{
"name": "hexabot-ollama",
"name": "hexabot-plugin-ollama",
"version": "2.0.0",
"description": "The Ollama Plugin Extension for Hexabot Chatbot / Agent Builder that provides a custom block for Generative AI + RAG",
"dependencies": {},
"extensions": {
"dependencies": {
"hexabot-helper-ollama": "2.0.0"
},
"author": "Hexastack",
"license": "AGPL-3.0-only"
}
}

View File

@@ -1,7 +1,7 @@
import { PluginSetting } from '@/plugins/types';
import { SettingType } from '@/setting/schemas/types';
export const OLLAMA_PLUGIN_SETTINGS = [
export default [
{
label: 'model',
group: 'default',