langchain/docs/use_cases
Quentin Pleplé 126d7f11dd
Fix notebook example (#3142)
The following calls were throwing an exception:


575b717d10/docs/use_cases/evaluation/agent_vectordb_sota_pg.ipynb (L192)


575b717d10/docs/use_cases/evaluation/agent_vectordb_sota_pg.ipynb (L239)

Exception:

```
---------------------------------------------------------------------------
ValidationError                           Traceback (most recent call last)
Cell In[14], line 1
----> 1 chain_sota = RetrievalQA.from_chain_type(llm=OpenAI(temperature=0), chain_type="stuff", retriever=vectorstore_sota, input_key="question")

File ~/github/langchain/venv/lib/python3.9/site-packages/langchain/chains/retrieval_qa/base.py:89, in BaseRetrievalQA.from_chain_type(cls, llm, chain_type, chain_type_kwargs, **kwargs)
     85 _chain_type_kwargs = chain_type_kwargs or {}
     86 combine_documents_chain = load_qa_chain(
     87     llm, chain_type=chain_type, **_chain_type_kwargs
     88 )
---> 89 return cls(combine_documents_chain=combine_documents_chain, **kwargs)

File ~/github/langchain/venv/lib/python3.9/site-packages/pydantic/main.py:341, in pydantic.main.BaseModel.__init__()

ValidationError: 1 validation error for RetrievalQA
retriever
  instance of BaseRetriever expected (type=type_error.arbitrary_type; expected_arbitrary_type=BaseRetriever)
```

The vectorstores had to be converted to retrievers:
`vectorstore_sota.as_retriever()` and `vectorstore_pg.as_retriever()`.

The PR also:
- adds the file `paul_graham_essay.txt` referenced by this notebook
- adds to gitignore *.pkl and *.bin files that are generated by this
notebook

Interestingly enough, the performance of the prediction greatly
increased (new version of langchain or ne version of OpenAI models since
the last run of the notebook): from 19/33 correct to 28/33 correct!
2023-04-19 08:55:06 -07:00
..
agent_simulations Agents 4 18 (#3122) 2023-04-18 21:41:03 -07:00
agents Update Characters notebook (#3019) 2023-04-17 07:48:48 -07:00
autonomous_agents agent docs fixes (#3128) 2023-04-18 21:54:30 -07:00
code [minor] Deep Lake auth improvements in docs, kwargs pass, faster tests (#2927) 2023-04-15 10:49:16 -07:00
evaluation Fix notebook example (#3142) 2023-04-19 08:55:06 -07:00
question_answering Harrison/output error (#3094) 2023-04-18 08:59:56 -07:00
agent_simulations.md Agents 4 18 (#3122) 2023-04-18 21:41:03 -07:00
apis.md Update apis.md (#2278) 2023-04-01 12:48:16 -07:00
autonomous_agents.md fix links 2023-04-18 22:44:53 -07:00
chatbots.md Minor doc typo (#2492) 2023-04-06 12:41:40 -07:00
code.md bump ver to 140 (#2895) 2023-04-15 09:23:19 -07:00
evaluation.rst [Docs] minor fixes to loaders links and rst warnings (#2846) 2023-04-13 10:54:40 -07:00
extraction.md fix doc tags (#2019) 2023-03-26 21:43:51 -07:00
personal_assistants.md Agents 4 18 (#3122) 2023-04-18 21:41:03 -07:00
question_answering.md Harrison/qa eg (#3052) 2023-04-17 20:56:42 -07:00
summarization.md fix doc tags (#2019) 2023-03-26 21:43:51 -07:00
tabular.md fix doc tags (#2019) 2023-03-26 21:43:51 -07:00