Updating of Type LLMCache to BaseCache and renaming vars for clarity

This commit is contained in:
vinodkiran
2023-10-08 22:59:43 +05:30
parent 12159f6730
commit 7d4337724d
19 changed files with 63 additions and 54 deletions
@@ -27,8 +27,8 @@ class Bittensor_LLMs implements INode {
this.inputs = [
{
label: 'Cache',
name: 'llmCache',
type: 'LLMCache',
name: 'cache',
type: 'BaseCache',
optional: true
},
{
@@ -52,13 +52,13 @@ class Bittensor_LLMs implements INode {
async init(nodeData: INodeData, _: string): Promise<any> {
const system_prompt = nodeData.inputs?.system_prompt as string
const topResponses = Number(nodeData.inputs?.topResponses as number)
const llmCache = nodeData.inputs?.llmCache as BaseCache
const cache = nodeData.inputs?.cache as BaseCache
const obj: Partial<BittensorInput> & BaseLLMParams = {
systemPrompt: system_prompt,
topResponses: topResponses
}
if (llmCache) obj.cache = llmCache
if (cache) obj.cache = cache
const model = new NIBittensorLLM(obj)
return model