Skip to content

Commit

Permalink
feat: add cli support for model
Browse files Browse the repository at this point in the history
  • Loading branch information
transitive-bullshit committed Apr 1, 2023
1 parent 0984504 commit e1d536e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -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>', 'Timeout in milliseconds')
.option('-k, --apiKey <apiKey>', 'OpenAI API key')
.option('-m, --model <model>', 'Model (gpt-3.5-turbo, gpt-4)', {
default: 'gpt-3.5-turbo'
})
.option(
'-n, --conversationName <conversationName>',
'Unique name for the conversation'
Expand All @@ -50,6 +53,7 @@ async function main() {
options.continue && options.store
? config.get(conversationKey, {}) || {}
: {}
const model = options.model
let conversationId = undefined
let parentMessageId = undefined

Expand All @@ -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]
Expand Down

0 comments on commit e1d536e

Please sign in to comment.