Skip to content

Commit

Permalink
Merge pull request #641 from xiaodong2008/feat/base-url-option
Browse files Browse the repository at this point in the history
  • Loading branch information
transitive-bullshit authored Jun 7, 2024
2 parents 73fb30b + 9593159 commit 7bc821d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,15 @@ async function main() {
.option('-m, --model <model>', 'Model (gpt-3.5-turbo, gpt-4)', {
default: 'gpt-3.5-turbo'
})
.option('--host <host>', 'API host base')
.option(
'-n, --conversationName <conversationName>',
'Unique name for the conversation'
)
.action(async (prompt, options) => {
const apiOrg = options.apiOrg || process.env.OPENAI_API_ORG
const apiKey = options.apiKey || process.env.OPENAI_API_KEY
const apiBaseUrl = options.host || process.env.OPENAI_API_BASE_URL
if (!apiKey) {
console.error('error: either set OPENAI_API_KEY or use --apiKey\n')
cli.outputHelp()
Expand Down Expand Up @@ -74,6 +76,7 @@ async function main() {
const api = new ChatGPTAPI({
apiKey,
apiOrg,
apiBaseUrl,
debug: options.debug,
completionParams: {
model
Expand Down

0 comments on commit 7bc821d

Please sign in to comment.