Adds LLM config capabilities
This commit is contained in:
parent
499a5954f5
commit
b06e772d2e
|
|
@ -1,9 +1,17 @@
|
||||||
|
const fs = require('fs');
|
||||||
|
const path = require('path');
|
||||||
const { LLM } = require('@themaximalist/llm.js'); // or wherever your LLM package lives
|
const { LLM } = require('@themaximalist/llm.js'); // or wherever your LLM package lives
|
||||||
|
|
||||||
|
// read optional config file
|
||||||
|
const configPath = path.join(__dirname, '..', 'llm_config.json');
|
||||||
|
const llmOptions = fs.existsSync(configPath)
|
||||||
|
? JSON.parse(fs.readFileSync(configPath, 'utf8'))
|
||||||
|
: {};
|
||||||
|
|
||||||
class LLMBot {
|
class LLMBot {
|
||||||
constructor() {
|
constructor() {
|
||||||
// One instance keeps the whole conversation in memory
|
// One instance keeps the whole conversation in memory
|
||||||
this.llm = new LLM();
|
this.llm = new LLM(llmOptions);
|
||||||
|
|
||||||
// Prompt fragments we’ll reuse
|
// Prompt fragments we’ll reuse
|
||||||
this.writePrompt =
|
this.writePrompt =
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue