automatically copy config + edit readme
This commit is contained in:
parent
d2f0270896
commit
ff2dd5247d
2 changed files with 14 additions and 1 deletions
|
|
@ -4,8 +4,10 @@ your friendly ai assistant. frontend for ollama.
|
||||||
> fair warning: lydia is very stupid
|
> fair warning: lydia is very stupid
|
||||||
|
|
||||||
# Installation
|
# Installation
|
||||||
|
- git clone repository
|
||||||
- install ollama from `https://ollama.ai/download`
|
- install ollama from `https://ollama.ai/download`
|
||||||
- pull a model from ollama
|
- pull a model from ollama
|
||||||
- copy config.example.toml to config.toml and edit it to have your model
|
- copy config.example.toml to config.toml and edit it to have your model
|
||||||
|
- npm i
|
||||||
- node index.js
|
- node index.js
|
||||||
- enjoy
|
- enjoy
|
||||||
|
|
|
||||||
13
lydia.js
13
lydia.js
|
|
@ -4,6 +4,17 @@ import { execSync } from "child_process";
|
||||||
import toml from "toml";
|
import toml from "toml";
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
|
|
||||||
|
if (!fs.existsSync("./config.toml")) {
|
||||||
|
if (fs.existsSync("./config.example.toml")) {
|
||||||
|
fs.copyFileSync("./config.example.toml", "./config.toml");
|
||||||
|
} else {
|
||||||
|
console.error(
|
||||||
|
"error: config.example.toml not found. git pull from repository",
|
||||||
|
);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const config = toml.parse(fs.readFileSync("./config.toml", "utf-8"));
|
const config = toml.parse(fs.readFileSync("./config.toml", "utf-8"));
|
||||||
|
|
||||||
const assistantname = config.assistant.name;
|
const assistantname = config.assistant.name;
|
||||||
|
|
@ -238,7 +249,7 @@ inputBox.on("submit", async (text) => {
|
||||||
case "help":
|
case "help":
|
||||||
addMessage(
|
addMessage(
|
||||||
assistantname,
|
assistantname,
|
||||||
"available commands:\nl!help - if you wanna know what i can do, run this\nl!clear - clear chat history, if you want me to forget everything, just run this!\nl!face <text> - if you want to force my expression, here you go! not sure i'll be too happy about it though.",
|
"available commands:\nl!help - if you wanna know what i can do, run this!\nl!clear - clear chat history, if you want me to forget everything, just run this!\nl!face <text> - if you want to force my expression, here you go! not sure i'll be too happy about it though.",
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case "clear":
|
case "clear":
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue