You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
index = VectorstoreIndexCreator(embedding=OpenAIEmbeddings()).from_loaders([loader])
114
+
index = VectorstoreIndexCreator(
115
+
vectorstore_cls=InMemoryVectorStore,
116
+
embedding=OpenAIEmbeddings()
117
+
).from_loaders([loader])
108
118
query ="What is LangChain?"
109
-
result = index.query_with_sources(query, llm=OpenAI())
119
+
result = index.query_with_sources(query, llm=llm)
110
120
111
121
print("answer:", result["answer"])
112
122
print("source:", result["sources"])
@@ -117,9 +127,11 @@ To run it, you can use the following command: `python langchain_integration.py`
117
127
After running the code, you should see the following output:
118
128
119
129
```text
120
-
answer: LangChain is a framework for developing applications powered by language models. It provides standard, extendable interfaces, external integrations, and end-to-end implementations for off-the-shelf use. It also integrates with other LLMs, systems, and products to create a vibrant and thriving ecosystem.
130
+
answer: LangChain is a framework designed for developing applications powered by large language models (LLMs). It simplifies the
131
+
entire application lifecycle, from development to productionization and deployment. LangChain provides open-source components a
132
+
nd integrates with various third-party tools, making it easier to build and optimize applications using language models.
0 commit comments