Metadata-Version: 2.4
Name: llama-index-llms-langchain
Version: 0.7.1
Summary: llama-index llms langchain integration
Author-email: Your Name <you@example.com>
License-Expression: MIT
License-File: LICENSE
Requires-Python: <4.0,>=3.9
Requires-Dist: langchain>=0.1.7
Requires-Dist: llama-index-core<0.15,>=0.13.0
Description-Content-Type: text/markdown

# LlamaIndex Llms Integration: Langchain

## Installation

1. Install the required Python packages:

   ```bash
   %pip install llama-index-llms-langchain
   ```

## Usage

### Import Required Libraries

```python
from langchain.llms import OpenAI
from llama_index.llms.langchain import LangChainLLM
```

### Initialize LangChain LLM

To create an instance of `LangChainLLM` with OpenAI:

```python
llm = LangChainLLM(llm=OpenAI())
```

### Generate Streaming Response

To generate a streaming response, use the following code:

```python
response_gen = llm.stream_complete("Hi this is")
for delta in response_gen:
    print(delta.delta, end="")
```

### LLM Implementation example

https://docs.llamaindex.ai/en/stable/examples/llm/langchain/
