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

# Olostep + ElizaOS 集成

> 通过 `OLOSTEP_SEARCH` 动作将 Olostep 网络搜索添加到 Eliza 代理中。

Eliza + Olostep 为你的代理提供可靠的网络搜索功能，让他们能够查找最新信息、使用实时结果回答开放性问题，并返回去重后的链接及其标题和描述。

## 功能

<CardGroup cols={2}>
  <Card title="网络搜索动作" icon="magnifying-glass">
    为 Eliza 代理添加 `OLOSTEP_SEARCH` 动作，以进行实时网络搜索。
  </Card>

  <Card title="去重结果" icon="filter">
    移除重复链接，并将最相关的结果置于顶部。
  </Card>

  <Card title="简单设置" icon="plug">
    在你的 Eliza 代理设置中配置一个 API 密钥即可开始搜索。
  </Card>

  <Card title="自然语言触发" icon="message-lines">
    当用户要求代理搜索网络、查找某物或寻找在线资源时生效。
  </Card>

  <Card title="结构化结果" icon="list-check">
    返回易于代理总结或引用的标题、描述和 URL。
  </Card>

  <Card title="无需 SDK" icon="code">
    通过标准 `fetch` 直接调用 Olostep 的 `/searches` 端点。
  </Card>
</CardGroup>

## 安装

<CodeGroup>
  ```bash npm theme={null}
  npm install @olostep/plugin-elizaos-olostep
  ```

  ```bash pnpm theme={null}
  pnpm add @olostep/plugin-elizaos-olostep
  ```

  ```bash bun theme={null}
  bun add @olostep/plugin-elizaos-olostep
  ```
</CodeGroup>

<Note>
  此软件包在 npm 上发布为 `@olostep/plugin-elizaos-olostep`。
</Note>

## 设置

1. 在你的 Olostep 控制面板中创建一个 Olostep API 密钥。
2. 将密钥添加到你的 Eliza 代理设置中，作为 `OLOSTEP_API_KEY`。
3. 在你的角色配置中包含该插件。

```json theme={null}
{
  "name": "MyAgent",
  "settings": {
    "secrets": {
      "OLOSTEP_API_KEY": "your-olostep-api-key-here"
    }
  }
}
```

<CodeGroup>
  ```typescript TypeScript theme={null}
  import type { Character } from '@elizaos/core';

  export const character: Character = {
    name: 'MyAgent',
    plugins: [
      '@elizaos/plugin-bootstrap',
      '@elizaos/plugin-openai',
      '@olostep/plugin-elizaos-olostep',
    ],
  };
  ```

  ```json JSON theme={null}
  {
    "name": "MyAgent",
    "plugins": [
      "@elizaos/plugin-bootstrap",
      "@elizaos/plugin-openai",
      "@olostep/plugin-elizaos-olostep"
    ]
  }
  ```
</CodeGroup>

## 可用工具

### `OLOSTEP_SEARCH`

使用 Olostep 搜索网络，并返回带有标题和描述的相关链接列表。当用户要求代理搜索信息、查找主题或寻找当前网络资源时使用。

<ParamField path="OLOSTEP_API_KEY" type="string" required>
  存储在代理运行时机密中的 Olostep API 密钥。
</ParamField>

<ParamField path="message.content.text" type="string" required>
  搜索查询。Eliza 使用传入的用户消息文本作为查询。
</ParamField>

<CodeGroup>
  ```typescript Basic Setup theme={null}
  // 注册插件并让 Eliza 路由搜索请求
  import type { Character } from '@elizaos/core';

  export const character: Character = {
    name: 'ResearchAgent',
    plugins: ['@olostep/plugin-elizaos-olostep'],
  };
  ```

  ```typescript Advanced Setup theme={null}
  // 将 Olostep 与模型插件结合，打造完整的研究代理
  import type { Character } from '@elizaos/core';

  export const character: Character = {
    name: 'ResearchAgent',
    bio: ['Investigates current events and summarizes web sources.'],
    plugins: [
      '@elizaos/plugin-bootstrap',
      '@elizaos/plugin-openai',
      '@olostep/plugin-elizaos-olostep',
    ],
  };
  ```

  ```typescript With Style Guide theme={null}
  // 定制代理以偏好网络搜索
  import type { Character } from '@elizaos/core';

  export const character: Character = {
    name: 'NewsAgent',
    style: {
      all: ['Use web search when the answer may have changed recently.'],
    },
    plugins: ['@olostep/plugin-elizaos-olostep'],
  };
  ```
</CodeGroup>

该动作在 `data.links` 中返回结构化搜索结果，代理响应包括最多五个顶级链接的可读摘要。

## 完整代理示例

### 研究助理

一个通用研究代理，在回答之前获取最新事实：

```typescript theme={null}
import type { Character } from '@elizaos/core';

export const character: Character = {
  name: 'ResearchAssistant',
  bio: [
    'Answers questions using current web sources.',
    'Summarizes links into concise, cited responses.',
  ],
  plugins: [
    '@elizaos/plugin-bootstrap',
    '@elizaos/plugin-openai',
    '@olostep/plugin-elizaos-olostep',
  ],
  settings: {
    secrets: {
      OLOSTEP_API_KEY: process.env.OLOSTEP_API_KEY!,
    },
  },
};
```

### 新闻监控

一个跟踪及时话题并报告显著更新的代理：

```typescript theme={null}
import type { Character } from '@elizaos/core';

export const character: Character = {
  name: 'NewsMonitor',
  bio: ['Tracks timely topics and reports notable updates from the web.'],
  plugins: [
    '@elizaos/plugin-bootstrap',
    '@elizaos/plugin-openai',
    '@olostep/plugin-elizaos-olostep',
  ],
  style: {
    all: ['Prefer current sources and include direct URLs when possible.'],
  },
};
```

用于警报、市场观察任务、趋势研究和其他时间敏感的工作流程。

### 具有搜索回退的支持代理

非常适合通过产品文档查找回答客户问题：

```typescript theme={null}
import type { Character } from '@elizaos/core';

export const character: Character = {
  name: 'SupportAgent',
  plugins: [
    '@elizaos/plugin-bootstrap',
    '@elizaos/plugin-openai',
    '@olostep/plugin-elizaos-olostep',
  ],
  topics: [
    'product support',
    'documentation lookup',
    'release notes search',
  ],
};
```

当你的代理在回答客户问题之前应搜索文档或产品页面时，此模式效果很好。

## 配置

### 启用插件

在你的角色配置中的 `plugins` 数组中添加 `@olostep/plugin-elizaos-olostep`。

### 禁用网络搜索

如果你希望 Eliza 代理没有 Olostep 搜索访问权限，请从角色配置中移除插件。

### 仅使用某些功能

此插件仅暴露一个动作，因此没有每个工具的切换。通过以下方式控制行为：

* 在角色配置中加载哪些插件
* 代理指令和风格
* 何时在运行时注入 `OLOSTEP_API_KEY`

## 专用功能

* **直接访问 `/searches` 端点** — 插件通过 `fetch` 直接调用 Olostep。
* **结果去重** — 在返回响应之前移除重复的 URL。
* **友好的回退** — 当 API 密钥缺失或查询为空时，动作返回清晰的错误。
* **顶级结果限制** — 响应被修剪为最多五个最相关的链接。

## 定价

搜索使用的定价取决于你的 Olostep 计划和控制面板设置。

* 在你的 Olostep 控制面板中查看当前使用情况和计费详情。
* 在部署高流量代理之前，检查你的账户限制。

## 支持

* **NPM 软件包**: [@olostep/plugin-elizaos-olostep](https://www.npmjs.com/package/@olostep/plugin-elizaos-olostep)
* **Olostep 网站**: [olostep.com](https://www.olostep.com)
* **Olostep 控制面板**: [dashboard.olostep.com](https://www.olostep.com/dashboard)
* **ElizaOS**: [elizaos.ai](https://elizaos.ai)
* **电子邮件支持**: [info@olostep.com](mailto:info@olostep.com)

## 相关资源

<CardGroup cols={2}>
  <Card title="搜索 API" icon="magnifying-glass" href="/searches/searches">
    了解搜索端点如何返回网络结果
  </Card>

  <Card title="批处理 API" icon="layer-group" href="/features/batches/batches">
    为更大的工作流程排队搜索和其他作业
  </Card>

  <Card title="答案 API" icon="question" href="/features/answers/answers">
    从检索的网络资源生成答案风格的输出
  </Card>

  <Card title="爬网 API" icon="spider-web" href="/features/crawls/crawls">
    探索更深入的网站收集和爬网工作流程
  </Card>

  <Card title="Python SDK" icon="python" href="/sdks/python">
    使用 Python SDK 进行围绕 Olostep 的自定义自动化
  </Card>

  <Card title="Node.js SDK" icon="code" href="/sdks/node-js">
    构建 JavaScript 集成和代理工作流程
  </Card>
</CardGroup>
