kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
feat: add cli support for model
rodzic
0984504154
commit
e1d536e62f
|
@ -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'
|
||||
|
@ -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]
|
||||
|
|
Ładowanie…
Reference in New Issue