> ## Documentation Index
> Fetch the complete documentation index at: https://ikun.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Perplexity

> 了解如何使用 Perplexity 和 Agno。

Perplexity 提供强大的语言模型，并内置网页搜索功能，可实现高级研究和问答功能。

在此处探索 Perplexity 的模型：[https://docs.perplexity.ai/guides/model-cards](https://docs.perplexity.ai/guides/model-cards)。

## Authentication

设置您的 `PERPLEXITY_API_KEY` 环境变量。在此处从 Perplexity 获取您的密钥：[https://www.perplexity.ai/settings/api](https://www.perplexity.ai/settings/api)。

<CodeGroup>
  ```bash Mac theme={null}
  export PERPLEXITY_API_KEY=***
  ```

  ```bash Windows theme={null}
  setx PERPLEXITY_API_KEY ***
  ```
</CodeGroup>

## Example

在您的 `Agent` 中使用 `Perplexity`：

<CodeGroup>
  ```python agent.py theme={null}
  from agno.agent import Agent, RunResponse
  from agno.models.perplexity import Perplexity

  agent = Agent(model=Perplexity(id="sonar-pro"), markdown=True)

  # Print the response in the terminal
  agent.print_response("Share a 2 sentence horror story")

  ```
</CodeGroup>

<Note> 在此处查看更多示例：[../examples/models/perplexity](../examples/models/perplexity)。 </Note>

## Params

<Snippet file="model-perplexity-params.mdx" />

`Perplexity` 还支持 [OpenAI](/reference/models/openai) 的参数。
