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

StopIteration Error #4

Open
b1tw0rker opened this issue Mar 23, 2023 · 2 comments
Open

StopIteration Error #4

b1tw0rker opened this issue Mar 23, 2023 · 2 comments

Comments

@b1tw0rker
Copy link

b1tw0rker commented Mar 23, 2023

Hi Tom,
I just implemented the API Key in ~/.config/openaiapirc
with the folowing content:

[openai]
organization_id=org-MY_ORGANIZATION_KEY
secret_key=sk-MY_API_KEY

The module openai is installed fine.
I am running Python3 on Windows.

After starting the program with:

python ./codex-readme.py

I get these output error:

...
You should have received a copy of the GNU General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.


Traceback (most recent call last):
  File "C:\dev\codex-readme\codex_readme.py", line 196, in <module>
    generate_until_accepted(input_prompt, args.tokens)
  File "C:\dev\codex-readme\codex_readme.py", line 169, in generate_until_accepted
    generated_readme = clear_screen_and_display_generated_readme(response)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\dev\codex-readme\codex_readme.py", line 116, in clear_screen_and_display_generated_readme
    next_response = next(response)
                    ^^^^^^^^^^^^^^
StopIteration

Any help would be appreciated.

@b1tw0rker
Copy link
Author

b1tw0rker commented Mar 23, 2023

On linux system (Rocky8 , Python 3.6) I get kind of an equal error:
But secret key and organizaion id is present on the wanted place.

Once you have your organization ID and secret key, create a file called
~/.config/openaiapirc with the following contents:

[openai]
organization_id=YOUR_ORG_ID
secret_key=YOUR_SECRET_KEY


Traceback (most recent call last):
  File "./codex_readme.py", line 196, in <module>
    generate_until_accepted(input_prompt, args.tokens)
  File "./codex_readme.py", line 169, in generate_until_accepted
    generated_readme = clear_screen_and_display_generated_readme(response)
  File "./codex_readme.py", line 116, in clear_screen_and_display_generated_readme
    next_response = next(response)
StopIteration

I guess the secret_key is the api_key, right ?!?

@b1tw0rker
Copy link
Author

b1tw0rker commented Mar 23, 2023

I could figure the following out:
The script seems to work, when the README.md file is not present (e.g. deleted) in the folder where executing the script.

This script looks to me extremly buggy till now :-( But the idea is very good !

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

1 participant