[업무 자동화]/챗GPT

[오류 해결] this is no longer supported in openai>=1.0.0 / You exceeded your current quota, please check your plan and billing details. For more information on this error

시간 확보러 2024. 3. 17. 06:05
728x90

건설현장에서 안전관리를 하기 위해서는 많은 것들을 알고 있어야 한다.

예를 들어 산업안전보건법, 중대재해처벌법, 건설기술진흥법, 소방법 등

 

사람이 어떻게 그런 많은 것들을 알 수 있을까?

요즘 AI도 발전하고 있는데, 궁금한 부분을 물어봤을 때 바로 알 수 있으면 모든 안전관리자에게 도움이 되지 않을까?

그래서 GPT를 활용한 챗봇 등을 제작하고 싶은 마음이 생겼다.

 

괜찮은 도서를 찾던 중 "진짜 챗GPT API 활용법"이라는 책을 발견하게 되었다.

이 책은 ChatGPT API 기반의 음성 비서부터 카카오톡/텔레그램 챗봇 제작, 랭체인 활용, 파인튜닝까지 학습 할 수 있다.

이거 괜찮은데!?

 

 

초기 세팅

 

초기 세팅은 아래의 사항 등을 책에 따라 진행하면 된다.

- API Key 발급

- 파이썬 설치

- 비주얼 스튜디오 코드 설치

- 구글 코랩 설치

 

[오류 해결]
1. this is no longer supported in openai>=1.0.0 
2. You exceeded your current quota, please check your plan and billing details. For more information on this error

 

아직 시작도 하지 않았는데, 오류 투성이다.

아... 포기할까.. 라는 마음이 잠시나만 나의 머리를 스쳤다.

 

첫번째 오류 내용은

You tried to access openai.ChatCompletion, but this is no longer supported in openai>=1.0.0 - see the README at https://github.com/openai/openai-python for the API. You can run `openai migrate` to automatically upgrade your codebase to use the 1.0.0 interface. Alternatively, you can pin your installation to the old version, e.g. `pip install

openai==0.28` A detailed migration guide is available here: https://github.com/openai/openai-python/discussions/742

 

v1.0.0 Migration Guide · openai openai-python · Discussion #742

We have released a new major version of our SDK, and we recommend upgrading promptly. It's a total rewrite of the library, so many things have changed, but we've made upgrading easy with a code mig...

github.com

 

버젼이 잘못된거라고 해서 사이트에 따라 Migration도 진행하고, 버젼도 0.28로 하고 다시 재부팅을 했지만

해결되지 않았다.

 

이것저것 하다보니 두번째 오류가 발생했다.

두번째 오류내용은

RateLimitError: Error code: 429 - {'error': {'message': 'You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors.', 'type': 'insufficient_quota', 'param': None, 'code': 'insufficient_quota'}}

 

 

여기서 해결방안이 보였다.

billing details를 체크하라는 것이였다.

그렇다면 지불방법 및 결제가 되어 있지 않아서 그런가?

 

책에서 말하길, 처음에 가입하면 $5 크레딧이 주어진다고 했는데

나는 이전에 가입을 해서 그런지 $5를 받을수 없었다. (ㅠㅠ)

 

그래서 바로 카드 등록을 하고 결제를 진행했다.

openai의 settings에 들어가 billing에 들어가서 결제수단 이미지를 클릭하고,

address line 1 은 번지,길이름,동,도시, 나라 순으로 기입, adress line은 이제 아파트나 빌라 동, 호수 작성하면 끝!

 

​마지막으로 등록되면 처음 결제를 해야하는데 최소금액 5달러 작성해주시고 등록하시며 된다.

(실제로는 5.5달러가 결제되었다. 수수료인가..?)

 

결제를 하자마자 삼성카드에서 전화가 왔다. (새벽 5시경)

전화를 받아보니, 결제된 사항이 본인이 맞는지 확인하는 것이다. (삼성카드 짱!)

 

설레는 마음으로 다시 해보니... 문제 해결!

이제 준비는 끝났으니 음성비서부터 만들어보자!

728x90