> ## 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.

# Cohere

> 了解如何在 Agno 中使用 Cohere 模型。

利用 Cohere 强大的 command 模型等。

[Cohere](https://cohere.com) 拥有广泛的模型，并且非常适合进行微调。在此处查看其模型库：[here](https://docs.cohere.com/v2/docs/models)。

我们建议进行实验以找到最适合您用例的模型。以下是一些通用建议：

* `command` 模型适用于大多数基本用例。
* `command-light` 模型适用于小型任务和更快的推理。
* `command-r7b-12-2024` 模型适用于 RAG 任务、复杂推理和多步任务。

Cohere 还支持模型微调。这是如何操作的指南：[guide](https://docs.cohere.com/v2/docs/fine-tuning)。

Cohere 具有基于层级的速率限制。有关更多信息，请参阅[文档](https://docs.cohere.com/v2/docs/rate-limits)。

## 身份验证

设置您的 `CO_API_KEY` 环境变量。在此处获取您的密钥：[here](https://dashboard.cohere.com/api-keys)。

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

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

## 示例

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

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

  agent = Agent(
      model=Cohere(id="command-r-08-2024"),
      markdown=True
  )

  # 在终端中打印响应
  agent.print_response("Share a 2 sentence horror story.")

  ```
</CodeGroup>

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

## 参数

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

`Cohere` 是 `Model` 类的一个子类，可以访问相同的参数。
