llama-index llms langchain integration
Project description
LlamaIndex Llms Integration: Langchain
Installation
-
Install the required Python packages:
%pip install llama-index-llms-langchain
Usage
Import Required Libraries
from langchain.llms import OpenAI
from llama_index.llms.langchain import LangChainLLM
Initialize LangChain LLM
To create an instance of LangChainLLM with OpenAI:
llm = LangChainLLM(llm=OpenAI())
Generate Streaming Response
To generate a streaming response, use the following code:
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/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llama_index_llms_langchain-0.7.1.tar.gz.
File metadata
- Download URL: llama_index_llms_langchain-0.7.1.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b28ff406f2538ee833d7dee2d64973741895e5d092f6adc08ec5b77c6429e993
|
|
| MD5 |
2e304e418311e56279e8a8d076ab5802
|
|
| BLAKE2b-256 |
54592125b4efd3b92e81994f27071c4cd4c85a59b0dfc22fdd8547f01a08ff31
|
File details
Details for the file llama_index_llms_langchain-0.7.1-py3-none-any.whl.
File metadata
- Download URL: llama_index_llms_langchain-0.7.1-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eaf9b465d98d30d5a0fa1355d2538cd8d31d37ff78d59109997ad0905cb34ce5
|
|
| MD5 |
c93f02befcb687c7f942509c4eb2e6d3
|
|
| BLAKE2b-256 |
55c7783fd5d09fca9b292c02508d989373d0baf01f204687bbd0a50f01510a3a
|