Skip to content

Commit

Permalink
docs[patch]: Update quickstart tutorial (#5662)
Browse files Browse the repository at this point in the history
* Update quickstart tutorial

* Broken link
  • Loading branch information
jacoblee93 authored Jun 4, 2024
1 parent 7d7b5ad commit 74cb905
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 19 deletions.
2 changes: 1 addition & 1 deletion docs/core_docs/docs/tutorials/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ New to LangChain or to LLM app development in general? Read this material to qui

### 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 an Agent](/docs/tutorials/agents)

Expand Down
40 changes: 22 additions & 18 deletions docs/core_docs/docs/tutorials/llm_chain.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,21 @@
"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) to chain components together\n",
"\n",
"- Debugging and tracing your application using [LangSmith](/docs/concepts/#langsmith)\n",
"\n",
"That's a fair amount to cover! Let's dive in.\n",
"Let's dive in!\n",
"\n",
"## Setup\n",
"\n",
Expand Down Expand Up @@ -71,11 +69,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",
Expand Down Expand Up @@ -218,9 +211,11 @@
"id": "d508b79d",
"metadata": {},
"source": [
"More commonly, we can \"chain\" the model with this output parser. This means this output parser will get called every time in this chain. This chain takes on the input type of the language model (string or list of message) and returns the output type of the output parser (string).\n",
"## Chaining together components with LCEL\n",
"\n",
"We can easily create the chain using the `.pipe` method. The `.pipe` method is used in LangChain to combine two elements together."
"We can also \"chain\" the model to the output parser. This means this output parser will get called with the output from the model. This chain takes on the input type of the language model (string or list of message) and returns the output type of the output parser (string).\n",
"\n",
"We can create the chain using the `.pipe()` method. The `.pipe()` method is used in LangChain to combine two elements together."
]
},
{
Expand Down Expand Up @@ -259,6 +254,8 @@
"id": "dd009096",
"metadata": {},
"source": [
"This is a simple example of using [LangChain Expression Language (LCEL)](/docs/concepts/#langchain-expression-language) to chain together LangChain modules. There are several benefits to this approach, including optimized streaming and tracing support.\n",
"\n",
"If we now look at LangSmith, we can see that the chain has two steps: first the language model is called, then the result of that is passed to the output parser. We can see the [LangSmith trace](https://smith.langchain.com/public/05bec1c1-fc51-4b2c-ab3b-4b63709e4462/r)"
]
},
Expand Down Expand Up @@ -520,15 +517,22 @@
"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, and how to get great observability into chains you create with LangSmith.\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 together with LCEL, and how to get great observability into chains you create with LangSmith.\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 more specific questions on these concepts, check out the following sections of the how-to guides:\n",
"\n",
"- [LangChain Expression Language (LCEL)](/docs/how_to/#langchain-expression-language)\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",
"\n",
"If you have specific questions on how to accomplish particular tasks, see our [How-To Guides](/docs/how_to) section.\n",
"And the LangSmith docs:\n",
"\n",
"For reading up on the core concepts of LangChain, we've got detailed [Conceptual Guides](/docs/concepts)"
"- [LangSmith](https://docs.smith.langchain.com)"
]
}
],
Expand Down

0 comments on commit 74cb905

Please sign in to comment.