Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update client.go - allow to skip Authorization header #658

Merged
merged 3 commits into from
Feb 16, 2024

Conversation

7flash
Copy link
Contributor

@7flash 7flash commented Feb 12, 2024

Currently I am hosting my LiteLLM proxy with no Authorization and trying to connect with go-openai like this:

	config := openai.DefaultConfig("")
	config.BaseURL = "https://my-service/v1"
	aiClient := openai.NewClientWithConfig(config)

It shows an error because I am passing empty token but it still appends Bearer header

2024/02/12 12:51:54 Failed to create chat stream: error, status code: 401, message: Authentication Error,
^Csignal: interrupt

While not passing any authorization header works for my proxy server

@sashabaranov
Copy link
Owner

@7flash please rebase your PR, I've just fixed all the linter warnings

@sashabaranov
Copy link
Owner

@7flash okay, there's still some linter issue to be fixed

Copy link

codecov bot commented Feb 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (11ad4b6) 98.44% compared to head (48c4fd1) 98.44%.
Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #658   +/-   ##
=======================================
  Coverage   98.44%   98.44%           
=======================================
  Files          24       24           
  Lines        1347     1347           
=======================================
  Hits         1326     1326           
  Misses         15       15           
  Partials        6        6           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sashabaranov sashabaranov merged commit 69e3bbb into sashabaranov:master Feb 16, 2024
3 checks passed
grulex pushed a commit to grulex/go-openai that referenced this pull request Mar 15, 2024
* Update client.go - allow to skip Authorization header

* Update client.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants