mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +00:00
feat: refactor extensions as npm packages (be brave 1)
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"ollama": "Ollama"
|
||||
"ollama_plugin": "Ollama Plugin"
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"ollama": "Ollama"
|
||||
"ollama_plugin": "Ollama Plugin"
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user