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.
description: Learn how to build AI Agents with Apify and LangGraph 🦜🔘➡️.
5
+
sidebar_position: 1
6
+
slug: /integrations/langgraph
7
+
---
8
+
9
+
**Learn how to build AI Agents with Apify and LangGraph.**
10
+
11
+
---
12
+
13
+
## What is LangGraph
14
+
15
+
[LangGraph](https://www.langchain.com/langgraph) is a framework designed for constructing stateful, multi-agent applications with Large Language Models (LLMs), allowing developers to build complex AI agent workflows that can leverage tools, APIs, and databases.
16
+
17
+
:::note Explore LangGraph
18
+
19
+
For more in-depth details on LangGraph, check out its [official documentation](https://langchain-ai.github.io/langgraph/).
20
+
21
+
:::
22
+
23
+
## How to use Apify with LangGraph
24
+
25
+
This guide will demonstrate how to use Apify Actors with LangGraph by building a ReAct agent that will use the [RAG Web Browser](https://apify.com/apify/rag-web-browser) Actor to search Google for TikTok profiles and [TikTok Data Extractor](https://apify.com/clockworks/free-tiktok-scraper) Actor to extract data from the TikTok profiles to analyze the profiles.
26
+
27
+
### Prerequisites
28
+
29
+
-**Apify API token**: To use Apify Actors in LangGraph, you need an Apify API token. If you don't have one, you can learn how to obtain it in the [Apify documentation](https://docs.apify.com/platform/integrations/api).
30
+
31
+
-**OpenAI API key**: In order to work with agents in LangGraph, you need an OpenAI API key. If you don't have one, you can get it from the [OpenAI platform](https://platform.openai.com/account/api-keys).
32
+
33
+
-**Python packages**: You need to install the following Python packages:
================================== AI Message ==================================
110
+
111
+
The OpenAI TikTok profile is titled "OpenAI (@openai) Official." Here are some key details about the profile:
112
+
113
+
- **Followers**: 592.3K
114
+
- **Likes**: 3.3M
115
+
- **Description**: The profile features "low key research previews" and includes videos that showcase their various projects and research developments.
0 commit comments