docs[patch]: Update quickstart tutorial (#22504)

Mentions LCEL more, hopefully flags it to more people as a simple
entrypoint

@baskaryan @hwchase17
This commit is contained in:
Jacob Lee 2024-06-04 13:04:56 -07:00 committed by GitHub
parent ad502e8d50
commit 64dbc52cae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 24 additions and 19 deletions

View File

@ -7,7 +7,7 @@ sidebar_class_name: hidden
New to LangChain or to LLM app development in general? Read this material to quickly get up and running.
### Basics
- [Build a Simple LLM Application](/docs/tutorials/llm_chain)
- [Build a Simple LLM Application with LCEL](/docs/tutorials/llm_chain)
- [Build a Chatbot](/docs/tutorials/chatbot)
- [Build vector stores and retrievers](/docs/tutorials/retrievers)
- [Build an Agent](/docs/tutorials/agents)

View File

@ -15,25 +15,23 @@
"id": "9316da0d",
"metadata": {},
"source": [
"# Build a Simple LLM Application\n",
"# Build a Simple LLM Application with LCEL\n",
"\n",
"In this quickstart we'll show you how to build a simple LLM application. This application will translate text from English into another language. This is a relatively simple LLM application - it's just a single LLM call plus some prompting. Still, this is a great way to get started with LangChain - a lot of features can be built with just some prompting and an LLM call!\n",
"In this quickstart we'll show you how to build a simple LLM application with LangChain. This application will translate text from English into another language. This is a relatively simple LLM application - it's just a single LLM call plus some prompting. Still, this is a great way to get started with LangChain - a lot of features can be built with just some prompting and an LLM call!\n",
"\n",
"## Concepts\n",
"\n",
"Concepts we will cover are:\n",
"After reading this tutorial, you'll have a high level overview of:\n",
"\n",
"- Using [language models](/docs/concepts/#chat-models)\n",
"\n",
"- Using [PromptTemplates](/docs/concepts/#prompt-templates) and [OutputParsers](/docs/concepts/#output-parsers)\n",
"\n",
"- [Chaining](/docs/concepts/#langchain-expression-language) a PromptTemplate + LLM + OutputParser using LangChain\n",
"- Using [LangChain Expression Language (LCEL)](/docs/concepts/#langchain-expression-language-lcel) to chain components together\n",
"\n",
"- Debugging and tracing your application using [LangSmith](/docs/concepts/#langsmith)\n",
"\n",
"- Deploying your application with [LangServe](/docs/concepts/#langserve)\n",
"\n",
"That's a fair amount to cover! Let's dive in.\n",
"Let's dive in!\n",
"\n",
"## Setup\n",
"\n",
@ -95,11 +93,6 @@
"id": "e5558ca9",
"metadata": {},
"source": [
"## Detailed walkthrough\n",
"\n",
"In this guide we will build an application to translate user input from one language to another.\n",
"\n",
"\n",
"## Using Language Models\n",
"\n",
"First up, let's learn how to use a language model by itself. LangChain supports many different language models that you can use interchangably - select the one you want to use below!\n",
@ -413,7 +406,9 @@
"id": "5a4267a8",
"metadata": {},
"source": [
"We can now combine this with the model and the output parser from above. This will chain all three components together."
"## Chaining together components with LCEL\n",
"\n",
"We can now combine this with the model and the output parser from above using the pipe (`|`) operator:"
]
},
{
@ -452,7 +447,9 @@
"id": "0b19cecb",
"metadata": {},
"source": [
"If we take a look at the LangSmith trace, we can see all three components show up in the [LangSmith trace](https://smith.langchain.com/public/bc49bec0-6b13-4726-967f-dbd3448b786d/r)"
"This is a simple example of using [LangChain Expression Language (LCEL)](/docs/concepts/#langchain-expression-language-lcel) to chain together LangChain modules. There are several benefits to this approach, including optimized streaming and tracing support.\n",
"\n",
"If we take a look at the LangSmith trace, we can see all three components show up in the [LangSmith trace](https://smith.langchain.com/public/bc49bec0-6b13-4726-967f-dbd3448b786d/r)."
]
},
{
@ -584,15 +581,23 @@
"source": [
"## Conclusion\n",
"\n",
"That's it! In this tutorial we've walked through creating our first simple LLM application. We've learned how to work with language models, how to parse their outputs, how to create a prompt template, how to get great observability into chains you create with LangSmith, and how to deploy them with LangServe.\n",
"That's it! In this tutorial you've learned how to create your first simple LLM application. You've learned how to work with language models, how to parse their outputs, how to create a prompt template, chaining them with LCEL, how to get great observability into chains you create with LangSmith, and how to deploy them with LangServe.\n",
"\n",
"This just scratches the surface of what you will want to learn to become a proficient AI Engineer. Luckily - we've got a lot of other resources!\n",
"\n",
"For more in-depth tutorials, check out out [Tutorials](/docs/tutorials) section.\n",
"For further reading on the core concepts of LangChain, we've got detailed [Conceptual Guides](/docs/concepts).\n",
"\n",
"If you have specific questions on how to accomplish particular tasks, see our [How-To Guides](/docs/how_to) section.\n",
"If you have more specific questions on these concepts, check out the following sections of the how-to guides:\n",
"\n",
"For reading up on the core concepts of LangChain, we've got detailed [Conceptual Guides](/docs/concepts)"
"- [LangChain Expression Language (LCEL)](/docs/how_to/#langchain-expression-language-lcel)\n",
"- [Prompt templates](/docs/how_to/#prompt-templates)\n",
"- [Chat models](/docs/how_to/#chat-models)\n",
"- [Output parsers](/docs/how_to/#output-parsers)\n",
"- [LangServe](/docs/langserve/)\n",
"\n",
"And the LangSmith docs:\n",
"\n",
"- [LangSmith](https://docs.smith.langchain.com)"
]
},
{