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

# エージェントについて

> ローカル設定ファイルを使用して AI エージェントを定義します

<div className="dev-docs-banner">
  <div className="dev-docs-banner-content">
    <div className="dev-docs-banner-title">
      開発者向けドキュメントを表示しています
    </div>

    <div className="dev-docs-banner-text">
      このドキュメントは、Base44 開発者プラットフォームで作業する開発者向けです。アプリエディタ内の AI エージェントについては、<a href="/Building-your-app/AI-agents-for-apps">AI エージェントのセットアップ</a>を参照してください。
    </div>
  </div>
</div>

[AI エージェント](/Building-your-app/AI-agents-for-apps)は、アクションを実行しツールに接続して、チームメンバーやエンドユーザーをサポートするカスタマイズ可能な AI アシスタントです。エージェントの動作、権限、ツールをローカル JSONC 設定ファイルを使用して定義します。

## エージェントを作成する

`base44/agents/` ディレクトリに JSONC 設定ファイルを作成し (エージェントごとに 1 ファイル)、[`agents push`](/developers/references/cli/commands/agents-push) を実行して Base44 に同期します。

## 例

```jsonc theme={null}
{
  "name": "customer_support",
  "description": "Handles customer support inquiries and ticket management",
  "instructions": "You are a friendly customer support agent. Help users resolve their issues politely and efficiently. If you cannot help, escalate to a human agent.",
  "model": "anthropic/claude-sonnet-4-20250514",
  "tool_configs": [
    {
      "entity_name": "tickets",
      "allowed_operations": ["read", "create", "update"],
    },
    {
      "entity_name": "customers",
      "allowed_operations": ["read"],
    },
    {
      "function_name": "send_notification",
      "description": "Sends a push notification to the customer",
    },
    {
      "function_name": "escalate_to_human",
      "description": "Escalates the conversation to a human support agent",
    },
  ],
  "whatsapp_greeting": "Hi, I'm your support assistant. How can I help you today?",
}
```

## フィールドリファレンス

エージェント設定は JSONC を使用します。各エージェントは `base44/agents/` ディレクトリ内の個別のファイルで定義されます。

### 必須フィールド

<ResponseField name="name" type="string" required>
  エージェントの一意の識別子。小文字とアンダースコアを使用してください。名前はファイル名と一致する必要があるため、`customer_support` という名前のエージェントは `customer_support.jsonc` 内になります。
</ResponseField>

<ResponseField name="description" type="string" required>
  エージェントが何をするかの簡単な説明。
</ResponseField>

<ResponseField name="instructions" type="string" required>
  エージェントの動作、人格、ガイドラインを定義するシステムプロンプト。
</ResponseField>

<ResponseField name="model" type="string" required>
  使用する AI モデル、`provider/model-name` 形式。

  サポートされるモデル:

  * `anthropic/claude-sonnet-4-20250514`
  * `anthropic/claude-3-5-sonnet-20241022`
  * `openai/gpt-4o`
  * `openai/gpt-4o-mini`
</ResponseField>

### オプションフィールド

<ResponseField name="tool_configs" type="array">
  エージェントがアプリと対話するために使用できるツール。[ツール設定](#tool-configuration)を参照してください。
</ResponseField>

<ResponseField name="whatsapp_greeting" type="string">
  このエージェントとの WhatsApp 会話のウェルカムメッセージ。
</ResponseField>

## ツール設定

`tool_configs` 配列は、エージェントが持つ機能を定義します。**エンティティツール**と**関数ツール**の 2 つのタイプがあります。

### エンティティツール

エンティティツールにより、エージェントはアプリの[エンティティ](/developers/backend/resources/entities/overview)に対して CRUD 操作を実行できます。

<ResponseField name="entity_name" type="string" required>
  エンティティの名前。アプリ内の既存エンティティと一致する必要があります。
</ResponseField>

<ResponseField name="allowed_operations" type="array" required>
  エージェントがこのエンティティに対して実行できる操作。有効な値は `"read"`、`"create"`、`"update"`、`"delete"` です。
</ResponseField>

### 関数ツール

関数ツールにより、エージェントはアプリの[バックエンド関数](/developers/backend/resources/backend-functions/overview)を呼び出すことができます。

<ResponseField name="function_name" type="string" required>
  関数の名前。アプリ内の既存関数と一致する必要があります。
</ResponseField>

<ResponseField name="description" type="string" required>
  関数が何をするかの説明。エージェントはこれを使用して、いつ呼び出すかを決定します。
</ResponseField>

## TypeScript 型

エージェント設定から TypeScript 型を生成して、SDK コード内のエージェント名に対する型安全性とオートコンプリートを取得します。[ダイナミック型](/developers/references/sdk/getting-started/dynamic-types)について詳しく学んでください。

## 関連項目

* [`agents pull`](/developers/references/cli/commands/agents-pull): Base44 からローカルプロジェクトにエージェント設定を同期
* [`agents push`](/developers/references/cli/commands/agents-push): ローカルエージェント設定を Base44 にデプロイ
* [`agents`](/developers/references/sdk/docs/interfaces/agents): コード内でエージェントを操作するための SDK リファレンス
* [Setting up AI agents](/Building-your-app/AI-agents-for-apps): AI エージェントの作成と構成のガイド

<Note>このページは AI を使用して翻訳されました。最も正確で最新の情報については、[英語版](/) を参照してください。 </Note>
