mirror of
https://github.com/hwchase17/langchain.git
synced 2025-05-16 04:21:52 +00:00
203 lines
8.9 KiB
Plaintext
203 lines
8.9 KiB
Plaintext
{
|
||
"cells": [
|
||
{
|
||
"cell_type": "markdown",
|
||
"id": "77b854df",
|
||
"metadata": {},
|
||
"source": [
|
||
"# 2Markdown\n",
|
||
"\n",
|
||
">[2markdown](https://2markdown.com/) service transforms website content into structured markdown files.\n"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 2,
|
||
"id": "497736aa",
|
||
"metadata": {},
|
||
"outputs": [],
|
||
"source": [
|
||
"# You will need to get your own API key. See https://2markdown.com/login\n",
|
||
"\n",
|
||
"api_key = \"\""
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 3,
|
||
"id": "009e0036",
|
||
"metadata": {},
|
||
"outputs": [],
|
||
"source": [
|
||
"from langchain_community.document_loaders import ToMarkdownLoader"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 8,
|
||
"id": "910fb6ee",
|
||
"metadata": {},
|
||
"outputs": [],
|
||
"source": [
|
||
"loader = ToMarkdownLoader(url=\"/docs/get_started/introduction\", api_key=api_key)"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 9,
|
||
"id": "ac8db139",
|
||
"metadata": {},
|
||
"outputs": [],
|
||
"source": [
|
||
"docs = loader.load()"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 10,
|
||
"id": "706304e9",
|
||
"metadata": {},
|
||
"outputs": [
|
||
{
|
||
"name": "stdout",
|
||
"output_type": "stream",
|
||
"text": [
|
||
"**LangChain** is a framework for developing applications powered by language models. It enables applications that:\n",
|
||
"\n",
|
||
"- **Are context-aware**: connect a language model to sources of context (prompt instructions, few shot examples, content to ground its response in, etc.)\n",
|
||
"- **Reason**: rely on a language model to reason (about how to answer based on provided context, what actions to take, etc.)\n",
|
||
"\n",
|
||
"This framework consists of several parts.\n",
|
||
"\n",
|
||
"- **LangChain Libraries**: The Python and JavaScript libraries. Contains interfaces and integrations for a myriad of components, a basic run time for combining these components into chains and agents, and off-the-shelf implementations of chains and agents.\n",
|
||
"- **[LangChain Templates](/docs/templates)**: A collection of easily deployable reference architectures for a wide variety of tasks.\n",
|
||
"- **[LangServe](/docs/langserve)**: A library for deploying LangChain chains as a REST API.\n",
|
||
"- **[LangSmith](https://docs.smith.langchain.com)**: A developer platform that lets you debug, test, evaluate, and monitor chains built on any LLM framework and seamlessly integrates with LangChain.\n",
|
||
"\n",
|
||
"\n",
|
||
"\n",
|
||
"Together, these products simplify the entire application lifecycle:\n",
|
||
"\n",
|
||
"- **Develop**: Write your applications in LangChain/LangChain.js. Hit the ground running using Templates for reference.\n",
|
||
"- **Productionize**: Use LangSmith to inspect, test and monitor your chains, so that you can constantly improve and deploy with confidence.\n",
|
||
"- **Deploy**: Turn any chain into an API with LangServe.\n",
|
||
"\n",
|
||
"## LangChain Libraries [](\\#langchain-libraries \"Direct link to LangChain Libraries\")\n",
|
||
"\n",
|
||
"The main value props of the LangChain packages are:\n",
|
||
"\n",
|
||
"1. **Components**: composable tools and integrations for working with language models. Components are modular and easy-to-use, whether you are using the rest of the LangChain framework or not\n",
|
||
"2. **Off-the-shelf chains**: built-in assemblages of components for accomplishing higher-level tasks\n",
|
||
"\n",
|
||
"Off-the-shelf chains make it easy to get started. Components make it easy to customize existing chains and build new ones.\n",
|
||
"\n",
|
||
"The LangChain libraries themselves are made up of several different packages.\n",
|
||
"\n",
|
||
"- **`langchain-core`**: Base abstractions and LangChain Expression Language.\n",
|
||
"- **`langchain-community`**: Third party integrations.\n",
|
||
"- **`langchain`**: Chains, agents, and retrieval strategies that make up an application's cognitive architecture.\n",
|
||
"\n",
|
||
"## Get started [](\\#get-started \"Direct link to Get started\")\n",
|
||
"\n",
|
||
"[Here’s](/docs/installation) how to install LangChain, set up your environment, and start building.\n",
|
||
"\n",
|
||
"We recommend following our [Quickstart](/docs/tutorials/llm_chain) guide to familiarize yourself with the framework by building your first LangChain application.\n",
|
||
"\n",
|
||
"Read up on our [Security](/docs/security) best practices to make sure you're developing safely with LangChain.\n",
|
||
"\n",
|
||
"note\n",
|
||
"\n",
|
||
"These docs focus on the Python LangChain library. [Head here](https://js.langchain.com) for docs on the JavaScript LangChain library.\n",
|
||
"\n",
|
||
"## LangChain Expression Language (LCEL) [](\\#langchain-expression-language-lcel \"Direct link to LangChain Expression Language (LCEL)\")\n",
|
||
"\n",
|
||
"LCEL is a declarative way to compose chains. LCEL was designed from day 1 to support putting prototypes in production, with no code changes, from the simplest “prompt + LLM” chain to the most complex chains.\n",
|
||
"\n",
|
||
"- **[Overview](/docs/concepts#langchain-expression-language)**: LCEL and its benefits\n",
|
||
"- **[Interface](/docs/concepts#interface)**: The standard interface for LCEL objects\n",
|
||
"- **[How-to](/docs/expression_language/how_to)**: Key features of LCEL\n",
|
||
"- **[Cookbook](/docs/expression_language/cookbook)**: Example code for accomplishing common tasks\n",
|
||
"\n",
|
||
"## Modules [](\\#modules \"Direct link to Modules\")\n",
|
||
"\n",
|
||
"LangChain provides standard, extendable interfaces and integrations for the following modules:\n",
|
||
"\n",
|
||
"#### [Model I/O](/docs/modules/model_io/) [](\\#model-io \"Direct link to model-io\")\n",
|
||
"\n",
|
||
"Interface with language models\n",
|
||
"\n",
|
||
"#### [Retrieval](/docs/modules/data_connection/) [](\\#retrieval \"Direct link to retrieval\")\n",
|
||
"\n",
|
||
"Interface with application-specific data\n",
|
||
"\n",
|
||
"#### [Agents](/docs/tutorials/agents) [](\\#agents \"Direct link to agents\")\n",
|
||
"\n",
|
||
"Let models choose which tools to use given high-level directives\n",
|
||
"\n",
|
||
"## Examples, ecosystem, and resources [](\\#examples-ecosystem-and-resources \"Direct link to Examples, ecosystem, and resources\")\n",
|
||
"\n",
|
||
"### [Use cases](/docs/how_to#qa-with-rag) [](\\#use-cases \"Direct link to use-cases\")\n",
|
||
"\n",
|
||
"Walkthroughs and techniques for common end-to-end use cases, like:\n",
|
||
"\n",
|
||
"- [Document question answering](/docs/how_to#qa-with-rag)\n",
|
||
"- [Chatbots](/docs/use_cases/chatbots/)\n",
|
||
"- [Analyzing structured data](/docs/how_to#qa-over-sql--csv)\n",
|
||
"- and much more...\n",
|
||
"\n",
|
||
"### [Integrations](/docs/integrations/providers/) [](\\#integrations \"Direct link to integrations\")\n",
|
||
"\n",
|
||
"LangChain is part of a rich ecosystem of tools that integrate with our framework and build on top of it. Check out our growing list of [integrations](/docs/integrations/providers/).\n",
|
||
"\n",
|
||
"### [Guides](/docs/how_to/debugging) [](\\#guides \"Direct link to guides\")\n",
|
||
"\n",
|
||
"Best practices for developing with LangChain.\n",
|
||
"\n",
|
||
"### [API reference](https://api.python.langchain.com) [](\\#api-reference \"Direct link to api-reference\")\n",
|
||
"\n",
|
||
"Head to the reference section for full documentation of all classes and methods in the LangChain and LangChain Experimental Python packages.\n",
|
||
"\n",
|
||
"### [Developer's guide](/docs/contributing) [](\\#developers-guide \"Direct link to developers-guide\")\n",
|
||
"\n",
|
||
"Check out the developer's guide for guidelines on contributing and help getting your dev environment set up.\n",
|
||
"\n",
|
||
"Head to the [Community navigator](/docs/community) to find places to ask questions, share feedback, meet other developers, and dream about the future of LLM’s.\n"
|
||
]
|
||
}
|
||
],
|
||
"source": [
|
||
"print(docs[0].page_content)"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": null,
|
||
"id": "7c89b313-adb6-4aa2-9cd8-952a5724a2ce",
|
||
"metadata": {},
|
||
"outputs": [],
|
||
"source": []
|
||
}
|
||
],
|
||
"metadata": {
|
||
"kernelspec": {
|
||
"display_name": "Python 3 (ipykernel)",
|
||
"language": "python",
|
||
"name": "python3"
|
||
},
|
||
"language_info": {
|
||
"codemirror_mode": {
|
||
"name": "ipython",
|
||
"version": 3
|
||
},
|
||
"file_extension": ".py",
|
||
"mimetype": "text/x-python",
|
||
"name": "python",
|
||
"nbconvert_exporter": "python",
|
||
"pygments_lexer": "ipython3",
|
||
"version": "3.11.6"
|
||
}
|
||
},
|
||
"nbformat": 4,
|
||
"nbformat_minor": 5
|
||
}
|