# Multi pdf chat with LLM model

**URL:** <https://discuss.huggingface.co/t/multi-pdf-chat-with-llm-model/48988>\
**Category:** Models\
**Created:** [August 1, 2023, 2:43pm UTC](https://discuss.huggingface.co/t/multi-pdf-chat-with-llm-model/48988 "2023-08-01T14:43:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![richasinha12](https://avatars.discourse-cdn.com/v4/letter/r/ed655f/32.png) [@richasinha12](https://discuss.huggingface.co/u/richasinha12)\
**Post date:** [August 1, 2023, 2:43pm UTC](https://discuss.huggingface.co/t/multi-pdf-chat-with-llm-model/48988/1 "2023-08-01T14:43:46Z")

</div>

```auto
2023-08-01 13:26:20.183 Uncaught app exception
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script
exec(code, module. __dict__ )
File "/content/ask-multiple-pdfs/app.py", line 104, in <module>
main()
File "/content/ask-multiple-pdfs/app.py", line 96, in main
vectorstore = get_vectorstore(text_chunks)
File "/content/ask-multiple-pdfs/app.py", line 34, in get_vectorstore
embeddings = OpenAIEmbeddings()
File "pydantic/main.py", line 341, in pydantic.main.BaseModel. __init__
pydantic.error_wrappers.ValidationError: 1 validation error for OpenAIEmbeddings
__root__
Did not find openai_api_key, please add an environment variable `OPENAI_API_KEY` which contains it, or pass `openai_api_key` as a named parameter. (type=value_error)

```

hello everyone , i already given open api key , still i am getting error kindly solve the error(edited)

---

<div class="post-metadata">

**Author:** ![shqqq](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@shqqq](https://discuss.huggingface.co/u/shqqq)\
**Post date:** [August 28, 2023, 1:19pm UTC](https://discuss.huggingface.co/t/multi-pdf-chat-with-llm-model/48988/2 "2023-08-28T13:19:46Z")

</div>

How have you added your API key? You should preferably add it as an environment variable in your virtual environment
