fix: model saving
This commit is contained in:
parent
57acb09a18
commit
79fd0a93eb
1 changed files with 5 additions and 3 deletions
8
index.ts
8
index.ts
|
|
@ -24,15 +24,17 @@ const { values: args, positionals } = parseArgs({
|
||||||
});
|
});
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
|
const config = await loadConfig();
|
||||||
|
|
||||||
const newConvo = args.new ?? args.n;
|
const newConvo = args.new ?? args.n;
|
||||||
const plainOut = args.plainOut ?? args.plain ?? !process.stdout.isTTY;
|
const plainOut = args.plainOut ?? args.plain ?? !process.stdout.isTTY;
|
||||||
const plainErr = args.plainErr ?? args.plain ?? !process.stderr.isTTY;
|
const plainErr = args.plainErr ?? args.plain ?? !process.stderr.isTTY;
|
||||||
const modelFlag = args.model ?? args.m;
|
const modelFlag = args.model ?? args.m;
|
||||||
const saveConfigFlag = args.save ?? args.s;
|
const saveConfigFlag = args.save ?? args.s;
|
||||||
|
|
||||||
const config = await loadConfig();
|
const model = modelFlag ?? config.model;
|
||||||
|
|
||||||
if (!config.model) {
|
if (!model) {
|
||||||
console.error(
|
console.error(
|
||||||
"Please run 'lmc --model <model> --save' to set a default model.",
|
"Please run 'lmc --model <model> --save' to set a default model.",
|
||||||
);
|
);
|
||||||
|
|
@ -54,7 +56,7 @@ async function main() {
|
||||||
includeUsage: true, // Include usage information in streaming responses
|
includeUsage: true, // Include usage information in streaming responses
|
||||||
});
|
});
|
||||||
|
|
||||||
const convo = new Conversation(modelFlag ?? config.model);
|
const convo = new Conversation(model);
|
||||||
|
|
||||||
if (!newConvo) {
|
if (!newConvo) {
|
||||||
await convo.load();
|
await convo.load();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue