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

Using Gemini API key still program uses openai api url to build resume #1032

Open
RizwanSiDdiqu1 opened this issue Jan 11, 2025 · 4 comments

Comments

@RizwanSiDdiqu1
Copy link

Config.py

LLM_MODEL_TYPE = 'gemini'
LLM_MODEL = 'gemini-pro'

Comand: python3 main.py

Error

Unexpected error occurred: Error code: 401 - {'error': {'message': 'Incorrect API key provided: AIzaSyCN***************************TL4k. You can find your API key at https://platform.openai.com/account/api-keys.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_api_key'}}, retrying in 20 seconds... (Attempt 2/15)
  • It is compulsory to use openAI API key in secrets.yaml file
  • Do I need to change the code in somewhere?
@AElga
Copy link

AElga commented Jan 12, 2025

I have the same issue above.

Error message from console: raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Client error '401 Unauthorized' for url 'https://api.openai.com/v1/chat/completions'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/401

Error message from link:
{
"error": {
"message": "You didn't provide an API key. You need to provide your API key in an Authorization header using Bearer auth (i.e. Authorization: Bearer YOUR_KEY), or as the password field (with blank username) if you're accessing the API from your browser and are prompted for a username and password. You can obtain an API key from https://platform.openai.com/account/api-keys.",
"type": "invalid_request_error",
"param": null,
"code": null
}
}

I have Gemini set in config.py for LLM_MODEL_TYPE, LLM_MODEL, and LLM_API_URL as well as my gemini key in secrets.yaml.

Your help is appreciated.

@alex-shvachko
Copy link

Have the same issue. Noticed that at config.py there is import only for OpenAI lib, what about other options?

@hamada147
Copy link

According to the source code, the instance that uses the values in the config.py file is the AIAdapter class, which is used in the GPTAnswerer class, which is not used in the project. The implementation goes directly to use LangChain with OpenAPI only. Please note that the repo doesn't provide automation for job applications, it only generates the CV.

@AElga
Copy link

AElga commented Jan 16, 2025

Thank you @hamada147 for the reply. I may have forgotten to mention that this error occurs when I attempt to generate a resume/cv using the tool. I will look into both the AIAdapter and GPTAnswerer classes to understand further.

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

No branches or pull requests

4 participants