Forum in maintenance, we will back soon 🙂
Error while running blog_summarization.py
I am getting error wile running the blog_summarization.pyÂ
"Traceback (most recent call last):
File "d:\PromptEngineering\Hasan_Code\PE-Course-codes-main\blog_summarization.py", line 15, in <module>
response = llm.llm_generate_text(prompt, "OpenAI", selected_model)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "d:\PromptEngineering\Hasan_Code\PE-Course-codes-main\llm.py", line 36, in llm_generate_text
generated_text = openai_generate(prompt, model)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "d:\PromptEngineering\Hasan_Code\PE-Course-codes-main\llm.py", line 50, in openai_generate
completion = openai.chat.completions.create(
^^^^^^^^^^^
AttributeError: module 'openai' has no attribute 'chat'
Issue is due to missing API Keys - LLM.py had missing API keys - Open API, NLP Cloud and CohereÂ
@google-shuvchowdhury you should be putting API keys into a file named .env.
Regards,
Earnie Boyd, CEO
Seasoned Solutions Advisor LLC
Schedule 1-on-1 help
Join me on Slack
Thanks @admin Hasan and @ssadvisor Earnie As I have mentioned - I have fixed the error.Â