From e1d536e62f861d53d5e814aac18e52bb6765022a Mon Sep 17 00:00:00 2001 From: Travis Fischer Date: Sat, 1 Apr 2023 14:39:39 -0500 Subject: [PATCH] feat: add cli support for model --- bin/cli.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bin/cli.js b/bin/cli.js index 35593733c..6589a7e8c 100755 --- a/bin/cli.js +++ b/bin/cli.js @@ -29,8 +29,11 @@ async function main() { .option('-s, --store', 'Enables the local message cache', { default: true }) - .option('-t, --timeout', 'Timeout in milliseconds') + .option('-t, --timeout ', 'Timeout in milliseconds') .option('-k, --apiKey ', 'OpenAI API key') + .option('-m, --model ', 'Model (gpt-3.5-turbo, gpt-4)', { + default: 'gpt-3.5-turbo' + }) .option( '-n, --conversationName ', 'Unique name for the conversation' @@ -50,6 +53,7 @@ async function main() { options.continue && options.store ? config.get(conversationKey, {}) || {} : {} + const model = options.model let conversationId = undefined let parentMessageId = undefined @@ -68,6 +72,9 @@ async function main() { const api = new ChatGPTAPI({ apiKey, debug: options.debug, + completionParams: { + model + }, getMessageById: async (id) => { if (options.store) { return conversation[id]