aicommits icon indicating copy to clipboard operation
aicommits copied to clipboard

Set path, hostname, auth

Open tgolsen opened this issue 11 months ago • 0 comments

This PR lets you set your hostname and path, as well as change your auth type. This was driven by necessity to connect to the Azure instance of ChatGPT I wanted to connect to. I'm using this version to write my commit messages now.

First, new configs:

./dist/cli.mjs config set OPENAI_KEY=****
./dist/cli.mjs config set authHeaderName=api-key
./dist/cli.mjs config set hostname=gpt4-resources.openai.azure.com
./dist/cli.mjs config set apipath='/openai/deployments/*****/chat/completions?api-version=2023-05-15'

OPENAI_KEY works with AuthHeaderName to create something like the below.

  headers: {
    'api-key': '***',
    ...
  },
# Or, by default
  headers: {
    'Authorization': 'Bearer sk-***',
    ...
  },

The fields hostname and apipath are probably self-explanatory.

I'm failing some tests, but so is develop 🤔 So I'm not sure if this is a step back or something up with my local set up. image image

Looking forward to feedback!

tgolsen avatar Feb 27 '24 14:02 tgolsen