langchain/docs
Sydney Runkle af66ab098e
Adding Perplexity extra and deprecating the community version of ChatPerplexity (#30649)
Plus, some accompanying docs updates

Some compelling usage:

```py
from langchain_perplexity import ChatPerplexity


chat = ChatPerplexity(model="llama-3.1-sonar-small-128k-online")
response = chat.invoke(
    "What were the most significant newsworthy events that occurred in the US recently?",
    extra_body={"search_recency_filter": "week"},
)
print(response.content)
# > Here are the top significant newsworthy events in the US recently: ...
```

Also, some confirmation of structured outputs:

```py
from langchain_perplexity import ChatPerplexity
from pydantic import BaseModel


class AnswerFormat(BaseModel):
    first_name: str
    last_name: str
    year_of_birth: int
    num_seasons_in_nba: int


messages = [
    {"role": "system", "content": "Be precise and concise."},
    {
        "role": "user",
        "content": (
            "Tell me about Michael Jordan. "
            "Please output a JSON object containing the following fields: "
            "first_name, last_name, year_of_birth, num_seasons_in_nba. "
        ),
    },
]

llm = ChatPerplexity(model="llama-3.1-sonar-small-128k-online")
structured_llm = llm.with_structured_output(AnswerFormat)
response = structured_llm.invoke(messages)
print(repr(response))
#> AnswerFormat(first_name='Michael', last_name='Jordan', year_of_birth=1963, num_seasons_in_nba=15)
```
2025-04-03 14:29:17 -04:00
..
api_reference docs: add missing with_config method to Runnable templates API reference (#30560) 2025-03-31 10:08:02 -04:00
cassettes docs: update cassettes for chat token usage tracking guide (#30558) 2025-03-30 14:57:15 -04:00
data docs: 👥 Update LangChain people data (#27022) 2024-10-08 17:09:07 +00:00
docs Adding Perplexity extra and deprecating the community version of ChatPerplexity (#30649) 2025-04-03 14:29:17 -04:00
scripts docs: Add GOAT integration to docs (#30478) 2025-03-28 15:19:37 -04:00
src partners: Add Perplexity Chat Integration (#30618) 2025-04-03 16:09:14 +00:00
static docs: fix llms-txt (#30528) 2025-03-27 19:02:44 +00:00
.gitignore infra: cleanup docs build (#21134) 2024-05-01 17:34:05 -07:00
.yarnrc.yml docs[minor]: Add thumbs up/down to all docs pages (#18526) 2024-03-04 15:14:28 -08:00
babel.config.js
docusaurus.config.js Banner for interrupt (#29567) 2025-02-03 17:40:24 -08:00
ignore-step.sh infra: run docs build on packages.yml updates (#29796) 2025-02-19 18:45:30 +00:00
Makefile docs: fix httpx conflicts with overrides in docs build (#29180) 2025-01-13 21:25:00 +00:00
package.json docs: raw loader codeblock (#28548) 2024-12-06 09:26:34 -08:00
README.md docs: reorganize contributing docs (#27649) 2024-10-25 22:41:54 +00:00
sidebars.js docs: reorg sidebar (#27978) 2024-11-15 14:28:18 -08:00
vercel_overrides.txt docs: add to vercel overrides (#30063) 2025-03-01 17:21:15 -05:00
vercel_requirements.txt docs: more useful vercel warnings (#28699) 2024-12-13 03:07:24 +00:00
vercel.json docs: tests/standard tests api ref redirect (#29444) 2025-01-27 23:21:50 -08:00
yarn.lock docs: raw loader codeblock (#28548) 2024-12-06 09:26:34 -08:00

LangChain Documentation

For more information on contributing to our documentation, see the Documentation Contributing Guide