mirror of
https://github.com/hexastack/hexabot
synced 2025-06-04 03:26:22 +00:00
feat: minor changes
This commit is contained in:
parent
648912fcc7
commit
8ef7e2abef
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "hexabot-ollama",
|
"name": "hexabot-helper-ollama",
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"description": "The Ollama Helper Extension for Hexabot Chatbot / Agent Builder to enable the LLM Capability",
|
"description": "The Ollama Helper Extension for Hexabot Chatbot / Agent Builder to enable the LLM Capability",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -7,4 +7,4 @@
|
|||||||
},
|
},
|
||||||
"author": "Hexastack",
|
"author": "Hexastack",
|
||||||
"license": "AGPL-3.0-only"
|
"license": "AGPL-3.0-only"
|
||||||
}
|
}
|
@ -16,7 +16,7 @@ export const OLLAMA_HELPER_SETTINGS = [
|
|||||||
label: 'model',
|
label: 'model',
|
||||||
group: OLLAMA_HELPER_GROUP,
|
group: OLLAMA_HELPER_GROUP,
|
||||||
type: SettingType.text,
|
type: SettingType.text,
|
||||||
value: 'tinyllama', // Default model
|
value: 'llama3.2', // Default model
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'keep_alive',
|
label: 'keep_alive',
|
||||||
|
@ -67,6 +67,29 @@ export class HelperService {
|
|||||||
return Array.from(helpers.values());
|
return Array.from(helpers.values());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a helper by class.
|
||||||
|
*
|
||||||
|
* @param type - The type of helper.
|
||||||
|
* @param name - The helper's name.
|
||||||
|
*
|
||||||
|
* @returns - The helper
|
||||||
|
*/
|
||||||
|
public use<
|
||||||
|
T extends HelperType,
|
||||||
|
C extends new (...args: any[]) => TypeOfHelper<T>,
|
||||||
|
>(type: T, cls: C) {
|
||||||
|
const helpers = this.getAllByType(type);
|
||||||
|
|
||||||
|
const helper = helpers.find((h) => h instanceof cls);
|
||||||
|
|
||||||
|
if (!helper) {
|
||||||
|
throw new Error(`Unable to find the requested helper`);
|
||||||
|
}
|
||||||
|
|
||||||
|
return helper as InstanceType<C>;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get default NLU helper.
|
* Get default NLU helper.
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user