Skip to content

fix: Incorrect API Key Error with OpenAI Proxy #387

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

Merged
merged 4 commits into from
Jun 17, 2024

Conversation

shubihu
Copy link
Contributor

@shubihu shubihu commented Jun 17, 2024

Related to #330.

This bug is caused by the OpenAI embedding model does not set the base URL address of the proxy.
The easiest way is to use os to set the overall environment, as follows:

os.environ['OPENAI_API_KEY'] = 'sk-*****'
os.environ['OPENAI_API_BASE'] = 'https://api.*****'

or edit the source code in #301 line in scrapegraphai/graphs/abstract_graph.py

# return OpenAIEmbeddings(api_key=self.llm_model.openai_api_key)
return OpenAIEmbeddings(api_key=self.llm_model.openai_api_key,  base_url=self.llm_model.openai_api_base)

VinciGit00 and others added 4 commits June 15, 2024 19:51
## [1.6.1](ScrapeGraphAI/Scrapegraph-ai@v1.6.0...v1.6.1) (2024-06-15)

### Bug Fixes

* removed duplicate from ollama dictionary ([dcd216e](ScrapeGraphAI@dcd216e))
fix: Incorrect API Key Error with OpenAI Proxy
@VinciGit00 VinciGit00 merged commit d7cd1df into ScrapeGraphAI:pre/beta Jun 17, 2024
Copy link

🎉 This PR is included in version 1.7.0-beta.10 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

3 participants