AI4Finance-Foundation / FinGPT

FinGPT: Open-Source Financial Large Language Models! Revolutionize 🔥 We release the trained model on HuggingFace.
https://ai4finance.org
MIT License
12.75k stars 1.81k forks source link

Update prepare_data.ipynb to update openai client connection #128

Closed pschofield2 closed 8 months ago

pschofield2 commented 8 months ago

I was getting the error: "TypeError: 'ChatCompletion' object is not subscriptable" when running the query_gpt4 function and it looks like some code associated with the openai client connection and response object needed to be updated per:

https://platform.openai.com/docs/guides/text-generation/chat-completions-api