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

# チャットエージェント API の概要

[SambaNova エージェント](/docs/ja/build/agents)は、さまざまなタスクに特化した AI エージェントへのアクセスを提供します。各エージェントには、Fire-and-forget (単発実行) エンドポイント (単一呼び出し) とインタラクティブエンドポイント (マルチターン会話) の両方が用意されています。

## 利用可能なエージェント

| エージェント | エンドポイント | 機能 |
| :- | :- | :- |
| Main Agent | `/agent/mainagent` | すべてのサブエージェントにアクセスできる汎用アシスタント |
| Financial Analysis | `/agent/financialanalysis` | 株式分析、財務指標、市場データ |
| Deep Research | `/agent/deepresearch` | 複数回の反復による調査と包括的なレポート作成 |
| Data Science | `/agent/datascience` | データセット分析、可視化、機械学習ワークフロー |
| Coding Agent | `/agent/coding` | コード実行、デバッグ、サンドボックス化された Python |

## 主な特徴

* **アーティファクトシステム:** ファイル (グラフ、PDF、スクリプトなど) をダウンロード可能な ID として返却
* **マルチターン会話:** `thread_id` によって会話を継続できるインタラクティブエンドポイント
* **自動承認:** Deep Research およびデータサイエンスの割り込み (interrupt) を自動的に処理
* **ファイルアップロード:** データサイエンスエージェントはデータセットのアップロードに対応
* **Bearer 認証:** API キーによる安全な認証

## 共通パターン

### Fire-and-forget パターン

単一の API 呼び出しでリクエストを処理し、完全な結果を返します。

**ユースケース:** 簡単な問い合わせ、ワンショットのタスク、自動化されたワークフロー

<CodeGroup>
  ```bash Request theme={}
  curl -X POST "https://<base-url>/agent/mainagent" \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer your-api-key" \
    -d '{
      "prompt": "Create a bar chart for Q1 sales"
    }'
  ```

  ```json Response theme={}
  {
    "status": "success",
    "result": "I've created the bar chart...",
    "artifacts": ["file-id-123"],
    "thread_id": "thread-abc"
  }
  ```
</CodeGroup>

***

### インタラクティブパターン

`thread_id` を使用してコンテキストを維持しながら、マルチターン会話を行います。

**ユースケース:** フォローアップの質問、反復的な開発、複雑なワークフロー

#### ステップ 1: 初回リクエスト

<CodeGroup>
  ```bash Request theme={}
  curl -X POST "https://<base-url>/agent/mainagent/interactive" \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer your-api-key" \
    -d '{
      "prompt": "Create a bar chart for Q1 sales",
      "resume": false
    }'
  ```

  ```json Response theme={}
  {
    "status": "success",
    "result": "I've created the bar chart...",
    "artifacts": ["file-id-123"],
    "thread_id": "thread-abc"
  }
  ```
</CodeGroup>

#### ステップ 2: フォローアップリクエスト

<CodeGroup>
  ```bash Request theme={}
  curl -X POST "https://<base-url>/agent/mainagent/interactive" \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer your-api-key" \
    -d '{
      "prompt": "Now create a pie chart showing the distribution",
      "thread_id": "thread-abc",
      "resume": true
    }'
  ```

  ```json Response theme={}
  {
    "status": "success",
    "result": "I've created the pie chart...",
    "artifacts": ["file-id-456"],
    "thread_id": "thread-abc"
  }
  ```
</CodeGroup>
