Skip to content

Commit

Permalink
docs: Cosmetic documentation fix. Update llm_chain.ipynb. (langchai…
Browse files Browse the repository at this point in the history
…n-ai#27394)

ATM [LLM chain
docs](https://python.langchain.com/docs/tutorials/llm_chain/#server)
say:

```
# 3. Create parser
parser = StrOutputParser()

# 4. Create chain
chain = prompt_template | model | parser


# 4. App definition
app = FastAPI(
  title="LangChain Server",
  version="1.0",
  description="A simple API server using LangChain's Runnable interfaces",
)

# 5. Adding chain route
add_routes(
    app,
    chain,
    path="/chain",
)
```

I corrected it to:


```
# 3. Create parser
parser = StrOutputParser()

# 4. Create chain
chain = prompt_template | model | parser

# 5. App definition
app = FastAPI(
  title="LangChain Server",
  version="1.0",
  description="A simple API server using LangChain's Runnable interfaces",
)

# 6. Adding chain route
add_routes(
    app,
    chain,
    path="/chain",
)
```
  • Loading branch information
barseghyanartur authored Oct 16, 2024
1 parent a4392b0 commit 88d71f6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions docs/docs/tutorials/llm_chain.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -497,15 +497,14 @@
"# 4. Create chain\n",
"chain = prompt_template | model | parser\n",
"\n",
"\n",
"# 4. App definition\n",
"# 5. App definition\n",
"app = FastAPI(\n",
" title=\"LangChain Server\",\n",
" version=\"1.0\",\n",
" description=\"A simple API server using LangChain's Runnable interfaces\",\n",
")\n",
"\n",
"# 5. Adding chain route\n",
"# 6. Adding chain route\n",
"add_routes(\n",
" app,\n",
" chain,\n",
Expand Down

0 comments on commit 88d71f6

Please sign in to comment.