Skip to content

Support for Azure Open AI endpoints #695

@glconti

Description

@glconti

Problem on commit message AI generation

We use in the company a few Azure Open AI endpoints, the rest api should be 1:1 with the OpenAi apis.

These endpoints use api key authentication and use the api-key request header instead of the Authorization header I see used in code.

In fact, I can correctly configure the endpoints in sourcegit

image

But when generating a commit message, I get a 401 error:

image

Solution

Now I went ahead and simply added also a api-key to the http request, as you can see in this PR https://github.com/glconti/sourcegit/pull/1/files

And the message generation works perfectly.

image

Since it is my first issue here, I would not propose such a "work-aroundy" solution, without getting your opinion, what would be the preferred approach in this case?

  • quick and dirty solution in proposed PR looks good enough
  • add a field to the UI configuration section to choose the authorization header?
  • ...

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions