Skip to content

Commit

Permalink
Added LangChain section to README
Browse files Browse the repository at this point in the history
Updated TODO list
  • Loading branch information
Daethyra committed Oct 7, 2023
1 parent 5ca9bb6 commit e0112e5
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,48 @@ Please also see the [OUT-prompt-cheatsheet](GPT-Prompt-Examples/OUT-prompt-cheat

---

#### 3. **[LangChain: Pluggable Components](./LangChain/)**

This section describes the pre-built Python modules in the `LangChain` directory that can be side-loaded for various functionalities.

`langchain_conv_agent.py`

This module offers a set of functionalities for conversational agents in LangChain. Specifically, it provides:

- Argument parsing for configuring the agent
- Document loading via `PyPDFDirectoryLoader`
- Text splitting using `RecursiveCharacterTextSplitter`
- Various embeddings options like `OpenAIEmbeddings`, `CacheBackedEmbeddings`, and `HuggingFaceEmbeddings`

**Usage:**
To use this module, simply import the functionalities you need and configure them accordingly.

```python
from langchain_conv_agent import YOUR_FUNCTION
```

---

`query_local_docs.py`

This module focuses on querying local documents and employs the following features:

- Environment variable loading via `dotenv`
- Document loading via `PyPDFLoader`
- Text splitting through `RecursiveCharacterTextSplitter`
- Vector storage options like `Chroma`
- Embedding options via `OpenAIEmbeddings`

**Usage:**
Similar to `langchain_conv_agent.py`, you can import the functionalities you require.

```python
from query_local_docs import YOUR_FUNCTION
```

These modules are designed to be extensible and can be easily integrated into your LangChain projects.


<!--
<div align="center">
<img src=".github/mindmap.png" alt="Mindmap from 8-30-23" width="500"/>
Expand Down
18 changes: 18 additions & 0 deletions todo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,21 @@
- [Thoughts] : "By creating a codebase of repurposable Python modules, \
we can use LangChain to query the top_k results for functions to serve \
contextual needs."


- langchain_conv_agent.py
- Lacks single execution runnability
- Fix by removing argparsing and implement default settings, \
with a configuration file
- Config file settings:
- Embedding Engine: [OpenAI, HuggingFace, etc.]
-
- Lacks .env var loading(API keys, model names[OpenAI, HuggingFace])
- Ambiguity regarding (EmbeddingManager and DocumentRetriever)
- Needs comments and to load via .env file
- Differentiate EmbeddingManager and DocumentRetriever by explaining how they're \
implemented into the pipeline stream created by the module.
- One generates embeddings
- `DocumentRetriever` queries them locally \
(HF model is cached after first download. Therefore, all runs after the first, \
are entirely local since we're using ChromaDB)

0 comments on commit e0112e5

Please sign in to comment.