[Docs] Capitalization Nits (#485)

This commit is contained in:
William FH
2024-05-17 08:15:54 -07:00
committed by GitHub
parent 920978c4ab
commit c056ec9f54
5 changed files with 37 additions and 30 deletions
+17 -17
View File
@@ -1,37 +1,37 @@
# How-To Guides
# How-to guides
Welcome to the LangGraph How-To Guides! These guides provide practical, step-by-step instructions for accomplishing key tasks in LangGraph.
Welcome to the LangGraph how-to guides! These guides provide practical, step-by-step instructions for accomplishing key tasks in LangGraph.
## Core
The core guides show how to address common needs when building a out AI workflows, with special focus placed on [ReAct](https://arxiv.org/abs/2210.03629)-style agents with [tool calling](https://python.langchain.com/docs/modules/model_io/chat/function_calling/).
The core guides show how to address common needs when building out AI workflows, with special focus placed on [ReAct](https://arxiv.org/abs/2210.03629)-style agents with [tool calling](https://python.langchain.com/docs/modules/model_io/chat/function_calling/).
- [Persistence](persistence.ipynb): How to give your graph "memory" and resiliance by saving and loading state
- [Time Travel](time-travel.ipynb): How to navigate and manipulate graph state history once it's persisted
- [Async Execution](async.ipynb): How to run nodes asynchronously for improved performance
- [Streaming Responses](streaming-tokens.ipynb): How to stream agent responses in real-time
- [Persistence](persistence.ipynb): How to give your graph "memory" and resilience by saving and loading state
- [Time travel](time-travel.ipynb): How to navigate and manipulate graph state history once it's persisted
- [Async execution](async.ipynb): How to run nodes asynchronously for improved performance
- [Streaming responses](streaming-tokens.ipynb): How to stream agent responses in real-time
- [Visualization](visualization.ipynb): How to visualize your graphs
- [Configuration](configuration.ipynb): How to indicate that a graph can swap out configurable components
### Design Patterns
### Design patterns
Recipes showing how to apply common design patterns in your workflows:
- [Subgraphs](subgraph.ipynb): How to compose subgraphs within a larger graph
- [Branching](branching.ipynb): How to create branching logic in your graphs for parallel node execution
- [Human-in-the-Loop](human-in-the-loop.ipynb): How to incorporate human feedback and intervention
- [Human-in-the-loop](human-in-the-loop.ipynb): How to incorporate human feedback and intervention
The following examples are useful especially if you are used to LangChain's AgentExecutor configurations.
- [Force Calling a Tool First](force-calling-a-tool-first.ipynb): Define a fixed workflow before ceding control to the ReAct agent
- [Dynamic Direct Return](dynamically-returning-directly.ipynb): Let the LLM to decide whether the graph should finish after a tool is run or whether the LLM should be able to review the output and keep going.
- [Respond in Structured Format](respond-in-format.ipynb): Let the LLM use tools or populate schema to provide the user. Useful if your agent should generate structured content.
- [Managing Agent Steps](managing-agent-steps.ipynb): How to format the intermediate steps of your workflow for the agent.
- [Force calling a tool first](force-calling-a-tool-first.ipynb): Define a fixed workflow before ceding control to the ReAct agent
- [Dynamic direct return](dynamically-returning-directly.ipynb): Let the LLM decide whether the graph should finish after a tool is run or whether the LLM should be able to review the output and keep going
- [Respond in structured format](respond-in-format.ipynb): Let the LLM use tools or populate schema to provide the user. Useful if your agent should generate structured content
- [Managing agent steps](managing-agent-steps.ipynb): How to format the intermediate steps of your workflow for the agent
### Alternative ways to define State
### Alternative ways to define state
- [Pydantic State](state-model.ipynb): Use a pydantic model as your state
- [Pydantic state](state-model.ipynb): Use a Pydantic model as your state
### Structured Output
### Structured output
- [Extraction with Re-prompting](./extraction/retries.ipynb): how to generate complex nested schemas using JSONPatch retries, for when function calling is insufficient, and regular reprompting still fails to generate valid results.
- [Extraction with re-prompting](./extraction/retries.ipynb): How to generate complex nested schemas using JSONPatch retries, for when function calling is insufficient, and regular reprompting still fails to generate valid results
+4
View File
@@ -7,6 +7,10 @@ hide_comments: true
⚡ Build language agents as graphs ⚡
!!! note "Python version :material-language-python:"
Looking for the JS version? Click [:fontawesome-brands-square-js: here](https://github.com/langchain-ai/langgraphjs) ([:simple-readme: JS docs](https://langchain-ai.github.io/langgraphjs/)).
## Overview
Suppose you're building a customer support assistant. You want your assistant to be able to:
+1 -1
View File
@@ -208,6 +208,6 @@ extra:
- icon: fontawesome/brands/js
link: https://langchain-ai.github.io/langgraphjs/
- icon: fontawesome/brands/github
link: https://github.com/langchain-ai/langgraphjs
link: https://github.com/langchain-ai/langgraph
- icon: fontawesome/brands/twitter
link: https://twitter.com/LangChainAI
+14 -11
View File
@@ -173,9 +173,8 @@
"id": "01885785-b71a-44d1-b1d6-7b5b14d53b58",
"metadata": {},
"source": [
"We can now wrap these tools in a simple ToolExecutor.\n",
"This is a real simple class that takes in a ToolInvocation and calls that tool, returning the output.\n",
"A ToolInvocation is any class with `tool` and `tool_input` attribute.\n"
"Now we can create our [ToolNode](https://langchain-ai.github.io/langgraph/reference/prebuilt/?h=tool+node#toolnode). This \n",
"object actually **runs** the tools (aka functions) that the LLM has asked to use."
]
},
{
@@ -197,13 +196,19 @@
"source": [
"## Set up the model\n",
"\n",
"Now we need to load the chat model we want to use.\n",
"Importantly, this should satisfy two criteria:\n",
"Now we need to load the [chat model](https://python.langchain.com/v0.2/docs/concepts/#chat-models) to power our agent.\n",
"For the design below, it must satisfy two criteria:\n",
"\n",
"1. It should work with messages. We will represent all agent state in the form of messages, so it needs to be able to work well with them.\n",
"2. It should work with OpenAI function calling. This means it should either be an OpenAI model or a model that exposes a similar interface.\n",
"1. It should work with **messages** (since our state contains a list of chat messages)\n",
"2. It should work with [**tool calling**](https://python.langchain.com/v0.1/docs/modules/model_io/chat/function_calling/).\n",
"\n",
"Note: these model requirements are not requirements for using LangGraph - they are just requirements for this one example."
"<div class=\"admonition tip\">\n",
" <p class=\"admonition-title\">Note</p>\n",
" <p>\n",
" These model requirements are not general requirements for using LangGraph - they are just requirements for this one example.\n",
" </p>\n",
"</div> \n",
" "
]
},
{
@@ -245,7 +250,7 @@
"id": "e03c5094-9297-4d19-a04e-3eedc75cefb4",
"metadata": {},
"source": [
"## Define the nodes\n",
"## Define the graph \n",
"\n",
"We now need to define a few different nodes in our graph.\n",
"In `langgraph`, a node can be either a function or a [runnable](https://python.langchain.com/docs/expression_language/).\n",
@@ -300,8 +305,6 @@
"id": "ffd6e892-946c-4899-8cc0-7c9291c1f73b",
"metadata": {},
"source": [
"## Define the graph\n",
"\n",
"We can now put it all together and define the graph!"
]
},
+1 -1
View File
@@ -7,7 +7,7 @@
"source": [
"# Streaming Tokens\n",
"\n",
"In this example we will stream tokens from the language model powering an agent. We will use a ReAct agent as an example. The main thing to bear in mind here is that using [async nodes](./async.ipynb) typically offers the best behavior for this, since we will be using the `async_log` method.\n",
"In this example we will stream tokens from the language model powering an agent. We will use a ReAct agent as an example. The main thing to bear in mind here is that using [async nodes](./async.ipynb) typically offers the best behavior for this, since we will be using the `astream_events` method.\n",
"\n",
"This how-to guide closely follows the others in this directory, so we will call out differences with the **STREAMING** tag below (if you just want to search for those).\n",
"\n",