avatarLaxfed Paulacy

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

2069

Abstract

dard for how providers and partners expose their services to the whole GenAI ecosystem. Moreover, LangChain Expression Language, a composable runtime, has been added to compose arbitrary sequences together, providing multiple benefits when building LLM applications.</p><div id="1410"><pre><span class="hljs-keyword">from</span> langchain_core.messages <span class="hljs-keyword">import</span> AIMessage, HumanMessage <span class="hljs-keyword">from</span> langchain_core.prompts <span class="hljs-keyword">import</span> ChatPromptTemplate, MessagesPlaceholder <span class="hljs-keyword">from</span> langchain_core.tools <span class="hljs-keyword">import</span> tool</pre></div><h2 id="87ed">LangChain Community</h2><p id="c830">The <code>langchain-community</code> package contains all third-party integrations, now separated from the core package. Over the next few weeks, LangChain will work on splitting out integrations with large audiences and critical functionalities into standalone packages, such as <code>langchain-openai</code> and <code>langchain-anthropic</code>. This separation aims to version these packages independently and simplify the testing process.</p><div id="52d8"><pre><span class="hljs-title">from</span> langchain_community.chat_models <span class="hljs-keyword">import</span> ChatOpenAI <span class="hljs-title">from</span> langchain_community.tools.gmail <span class="hljs-keyword">import</span> ( <span class="hljs-type">GmailCreateDraft</span>, <span class="hljs-type">GmailGetMessage</span>, <span class="hljs-type">GmailGetThread</span>, <span class="hljs-type">GmailSearch</span>, <span class="hljs-type">GmailSendMessage</span>, )</pre></div><h2 id="6222">LangChain</h2><p id="999a">The <code>langchain</code> package contains higher-level chains, agents, retrieval algorithms, and generalizable orchestration pieces that constitute an application’s cognitive architecture. While some legacy chains will remain, LangChain is moving towards constructing chains with LangChain Expression Language, allowing for ease

Options

of creating new chains, transparency of steps involved, and more.</p><div id="2e2c"><pre><span class="hljs-keyword">from</span> langchain.agents <span class="hljs-keyword">import</span> AgentExecutor <span class="hljs-keyword">from</span> langchain.agents.format_scratchpad <span class="hljs-keyword">import</span> format_to_openai_function_messages <span class="hljs-keyword">from</span> langchain.agents.output_parsers <span class="hljs-keyword">import</span> OpenAIFunctionsAgentOutputParser <span class="hljs-keyword">from</span> langchain.tools.render <span class="hljs-keyword">import</span> format_tool_to_openai_function</pre></div><h2 id="85b6">Conclusion</h2><p id="c767">The re-architecture of LangChain into multiple packages sets a solid foundation for a flourishing GenAI ecosystem. It enables the development of applications, libraries, and frameworks on top of or integrated with LangChain. With stability, scalability, and improved developer experience, LangChain is poised for further growth and innovation.</p><p id="3f9e">LangChain’s new architecture has opened up a world of possibilities for developers and integration partners, laying the groundwork for a vibrant and evolving GenAI space.</p><div id="3347" class="link-block"> <a href="https://readmedium.com/langchain-benchmarking-question-answering-over-csv-data-7c0b4c2cca1f"> <div> <div> <h2>LANGCHAIN — Benchmarking Question Answering over CSV Data</h2> <div><h3>Computers are good at following instructions, but not at reading your mind. — Donald Knuth</h3></div> <div><p>medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/1*nu7ZXSdSXeo6aCLEJYoZpg.jpeg)"></div> </div> </div> </a> </div><p id="824e">The future of technology is in constant evolution, and LangChain is at the forefront, shaping the landscape of GenAI applications.</p></article></body>

LANGCHAIN — What Is the New Langchain Architecture and Community Path to Langchain v0.1?

Technology’s future is in the hands of the dreamers, not the regulators. — Robin Chase

LangChain has undergone significant growth and is now re-architecting its package into multiple packages to improve the developer experience and support a thriving ecosystem. The new LangChain architecture consists of three separate packages: langchain-core, langchain-community, and langchain. By splitting the old langchain package, LangChain aims to introduce stability, scalability, and a path towards a stable 0.1 release for langchain. Let's delve into the details of the new LangChain architecture and the community path to LangChain v0.1.

LangChain Core

The langchain-core package encapsulates simple, core abstractions and a runtime to join these components together. It includes modular abstractions for language models, document loaders, embedding models, vectorstores, and retrievers. These abstractions have become the standard for how providers and partners expose their services to the whole GenAI ecosystem. Moreover, LangChain Expression Language, a composable runtime, has been added to compose arbitrary sequences together, providing multiple benefits when building LLM applications.

from langchain_core.messages import AIMessage, HumanMessage
from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder
from langchain_core.tools import tool

LangChain Community

The langchain-community package contains all third-party integrations, now separated from the core package. Over the next few weeks, LangChain will work on splitting out integrations with large audiences and critical functionalities into standalone packages, such as langchain-openai and langchain-anthropic. This separation aims to version these packages independently and simplify the testing process.

from langchain_community.chat_models import ChatOpenAI
from langchain_community.tools.gmail import (
    GmailCreateDraft,
    GmailGetMessage,
    GmailGetThread,
    GmailSearch,
    GmailSendMessage,
)

LangChain

The langchain package contains higher-level chains, agents, retrieval algorithms, and generalizable orchestration pieces that constitute an application’s cognitive architecture. While some legacy chains will remain, LangChain is moving towards constructing chains with LangChain Expression Language, allowing for ease of creating new chains, transparency of steps involved, and more.

from langchain.agents import AgentExecutor
from langchain.agents.format_scratchpad import format_to_openai_function_messages
from langchain.agents.output_parsers import OpenAIFunctionsAgentOutputParser
from langchain.tools.render import format_tool_to_openai_function

Conclusion

The re-architecture of LangChain into multiple packages sets a solid foundation for a flourishing GenAI ecosystem. It enables the development of applications, libraries, and frameworks on top of or integrated with LangChain. With stability, scalability, and improved developer experience, LangChain is poised for further growth and innovation.

LangChain’s new architecture has opened up a world of possibilities for developers and integration partners, laying the groundwork for a vibrant and evolving GenAI space.

The future of technology is in constant evolution, and LangChain is at the forefront, shaping the landscape of GenAI applications.

Langchain
Path
New
ChatGPT
Community
Recommended from ReadMedium