HomeAI News
LangChainAI introduces two features: PY and JS.
11

LangChainAI introduces two features: PY and JS.

Hayo News
Hayo News
August 2nd, 2023

Exciting news! LangChainAI has launched two features: PY and JS.

⚙️ PY introduces a new standard interface for all LangChain objects with built-in batch, async, and streaming support. 🔗 JS introduces a new syntax for creating chains with composition called the LangChain Expression Language.

⚙️ They're adding two often-requested methods:

.stream() is an iterator of tokens / message chunks, available on LLMs and Chat Models .batch() parallelizes outputs for a list of inputs, available on LLMs, Chat Models, Prompts, Output Parsers, Tools, Retrievers, Chains

🔗 LangChain Expression Language

LangChain was born from the idea of composing LLMs, be it constructing inputs to LLMs, parsing LLM outputs, or chaining multiple LLMs in sequence.

We've offered pre-built chains like LLMChain, SQLQueryChain, ConversationRetrievalChain that package up the most common combinations.

Here's an example chaining together a ChatOpenAI model, prompt template and output parser. You chain them together with the | operator, and then call it with .invoke(). You can also call .batch() or .stream() on it.

All chains you create integrate seamlessly with LangSmith, see the trace for the chain above, and inspect it here

https://smith.langchain.com/public/779f432a-fa8c-4b85-bf7d-3dca9a8c569c/r

Comments

no dataCoffee time! Feel free to comment