# Notebook L2-lcel-student. Validation error DocArray, pydantic

**URL:** <https://community.deeplearning.ai/t/notebook-l2-lcel-student-validation-error-docarray-pydantic/479273>\
**Category:** Functions, Tools and Agents with LangChain\
**Created:** [October 28, 2023, 9:04am UTC](https://community.deeplearning.ai/t/notebook-l2-lcel-student-validation-error-docarray-pydantic/479273 "2023-10-28T09:04:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adam\_Hjerpe](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@Adam\_Hjerpe](https://community.deeplearning.ai/u/Adam_Hjerpe)\
**Post date:** [October 28, 2023, 9:04am UTC](https://community.deeplearning.ai/t/notebook-l2-lcel-student-validation-error-docarray-pydantic/479273/1 "2023-10-28T09:04:09Z")

</div>

When executing the notebook L2-lcel-student locally I got an error at the following step,

```auto
vectorstore = DocArrayInMemorySearch.from_texts(
    ["harrison worked at kensho", "bears like to eat honey"],
    embedding=OpenAIEmbeddings()
)
vectorstore
retriever = vectorstore.as_retriever()
retriever.get_relevant_documents("where did harrison work?")

```

The `get_relevant_documents` throws an error: `langchain vector store retriever validation errors for DocArrayDoc`.

The following version work without error:  
pydantic==1.10.10  
langchain==0.0.325

Could you share the versions that are used in the notebook on the course page?  
I’ve tried running `!pip list` in the notebook hosted at the course, but it says that pip is not installed.

---

<div class="post-metadata">

**Author:** ![taekyo\_lee](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/taekyo_lee/32/64691_2.png) [@taekyo\_lee](https://community.deeplearning.ai/u/taekyo_lee)\
**Post date:** [October 29, 2023, 6:04am UTC](https://community.deeplearning.ai/t/notebook-l2-lcel-student-validation-error-docarray-pydantic/479273/2 "2023-10-29T06:04:26Z")

</div>

Hello Adam,

I’ve downloaded and successfully run the notebook file on my local machine without any issues. My package versions for `pydantic` and `langchain` are 1.10.12 and 0.0.314, respectively.

If you’re still encountering problems, how about considering downloading and running it on your local machine?

---

<div class="post-metadata">

**Author:** ![Adam\_Hjerpe](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@Adam\_Hjerpe](https://community.deeplearning.ai/u/Adam_Hjerpe)\
**Post date:** [October 30, 2023, 6:20am UTC](https://community.deeplearning.ai/t/notebook-l2-lcel-student-validation-error-docarray-pydantic/479273/3 "2023-10-30T06:20:21Z")

</div>

> [@Adam\_Hjerpe](#):
>
> The following version work without error:  
> pydantic==1.10.10  
> langchain==0.0.325

Hi Taekyo, yes it works for me too on local machine with the following versions

pydantic==1.10.10  
langchain==0.0.325

My question was which versions that are run on the hosted notebook.

---

<div class="post-metadata">

**Author:** ![taekyo\_lee](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/taekyo_lee/32/64691_2.png) [@taekyo\_lee](https://community.deeplearning.ai/u/taekyo_lee)\
**Post date:** [October 30, 2023, 11:47am UTC](https://community.deeplearning.ai/t/notebook-l2-lcel-student-validation-error-docarray-pydantic/479273/4 "2023-10-30T11:47:23Z")

</div>

Hi Adam,  
Oh I got it. You can check it on the hosted notebook by executing the following command.

**import langchain**  
**import pydantic**  
**print(langchain.\_\_version\_\_)**  
**print(pydantic.\_\_version\_\_)**

My result is

**0.0.312**  
**1.10.8**

I hope it will be helpful.  
Keep it up~

---

<div class="post-metadata">

**Author:** ![stephane35](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@stephane35](https://community.deeplearning.ai/u/stephane35)\
**Post date:** [November 13, 2023, 8:43pm UTC](https://community.deeplearning.ai/t/notebook-l2-lcel-student-validation-error-docarray-pydantic/479273/5 "2023-11-13T20:43:31Z")

</div>

Hi all  
Thank you.  
What about openai version ?  
Thank you.  
I am having trouble making openai 1.2.3, langchain 0.0.335 and pydantic 2.5.0 nicely working together  
Cheers

---

<div class="post-metadata">

**Author:** ![stephane35](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@stephane35](https://community.deeplearning.ai/u/stephane35)\
**Post date:** [November 13, 2023, 9:05pm UTC](https://community.deeplearning.ai/t/notebook-l2-lcel-student-validation-error-docarray-pydantic/479273/6 "2023-11-13T21:05:27Z")

</div>

I am answering to myself 🙂  
I had sucess using versions mentioned in Adam’s post and downgrading openai to 0.28.1. It seems there are breaking changes in openai v1+ & pydantic v2+
