eli64s / readme-ai

README file generator, powered by large language model APIs 👾

Home Page:https://readme-ai.streamlit.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Client error '404 Not Found' for url 'https://api.openai.com/v1/chat/completions'

opened this issue · comments

i get an 404 error

readmeai --api-key "xxxxx" -o readme-ai.md -r /home/ben/REPO/fv-deploiement-applicatif

INFO README-AI is now executing.
INFO Successfully validated OpenAI API key.
INFO Model: {'endpoint': 'https://api.openai.com/v1/chat/completions', 'engine': 'gpt-4', 'encoding': 'cl100k_base', 'rate_limit': 5, 'tokens': 699, 'tokens_max': 3999, 'temperature': 0.9, 'api_key': '****************'}
INFO Repository: GitConfig(repository='/home/ben/REPO/fv-deploiement-applicatif', name='fv-deploiement-applicatif')
INFO Successfully cloned /home/ben/REPO/fv-deploiement-applicatif to /tmp/tmpl2vq0tfd.
INFO Dependencies: ['', 'xxxxxx']
INFO Total files: 42
WARNING Ignoring file: README.md
WARNING Ignoring file: ansible.cfg
ERROR HTTPStatus Exception:
Client error '404 Not Found' for url 'https://api.openai.com/v1/chat/completions'
For more information check: https://httpstatuses.com/404
ERROR HTTPStatus Exception:
Client error '404 Not Found' for url 'https://api.openai.com/v1/chat/completions'

requet to test the endpoint: (works)

(base) conf|main ⇒ curl --location 'https://api.openai.com/v1/chat/completions'
--header 'Content-Type: application/json'
--header 'Authorization: Bearer sk-xxxxx'
--data '{
"model": "gpt-3.5-turbo",
"messages": [{"role": "user", "content": "What is the OpenAI mission?Put the result in JSON format"}]
}'

{
"id": "chatcmpl-80sisBYMJVhyvN40gpAGE9E7JPTHB",
"object": "chat.completion",
"created": 1695221046,
"model": "gpt-3.5-turbo-0613",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "{\n "mission": "The mission of OpenAI is to ensure that artificial general intelligence (AGI) benefits all of humanity. They aim to build safe and beneficial AGI or to aid others in achieving this outcome. OpenAI commits to long-term safety, conducting research to make AGI safe, and driving the broad adoption of safety measures across the AI community. Additionally, they strive to cooperate with other institutions to address AGI's global challenges and distribute its benefits equitably."\n}"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 20,
"completion_tokens": 98,
"total_tokens": 118
}
}

conf file:

OpenAI API Settings

[api]
endpoint = "https://api.openai.com/v1/chat/completions"
engine = "gpt-3.5-turbo"
encoding = "cl100k_base"
rate_limit = 5
tokens = 669
tokens_max = 3899
temperature = 1.2

Repository

[git]
repository = "https://github.com/eli64s/readme-ai"
name = "readme-ai"

Hey @benherve! Have you tried exporting your API Key as an environment variable?

export OPENAI_API_KEY="my-key"

Also get the latest version using the command below

pip install --upgrade readmeai

Let me know if you're still facing issues, thanks!

Hey @benherve! Have you tried exporting your API Key as an environment variable?

export OPENAI_API_KEY="my-key"

Also get the latest version using the command below

pip install --upgrade readmeai

Let me know if you're still facing issues, thanks!

Hello,
thanks with the last update and export api ley before, it works, thx

i get exception, do you know why ?

Processing prompt: group_vars/all.yml
Response: This code defines variables that store sensitive information like usernames and passwords from a vault. It also sets various paths and configurations for a server, SFTP, Nexus, localhost, and email. This configuration is used for managing deployments and interacting with different systems in a distributed environment.
ERROR Exception:

INFO
Processing prompt: 1
Response: Deploy, Innovate, Simplify!
INFO
Processing prompt: 2
Response: The project is focused on automating the installation and deployment of various applications using Ansible playbooks. It includes tasks such as updating logs, pre-checks, retrieving and pushing packages, extracting files, configuring applications, starting and stopping services, and sending log files via email. The core value proposition of the project is to streamline the installation and deployment process, reducing manual effort and ensuring consistency across different components in a distributed system.
ERROR Exception:

INFO YAML setup guide: []
INFO README file generated at: readme-ai.md
INFO README-AI execution complete.

Awesome! There was probably an issue with one of the OpenAI API requests, which can happen due to a variety of factors.

Are you using a free account on OpenAI or did you setup a payment?

Cool, thanks for trying out the tool! Reach back out if you come across anymore issues.

Eli