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

# AI Connector

> Connect to AI models via a REST API to process messages using configurable prompts and generate structured outputs within your data flows.

export const CommonActionType = ({resource = "script"}) => <>
    <p>このコネクタは、3 つのコネクタアクションタイプのいずれも実行できます。</p>
    <p style={{
  paddingLeft: '1.5rem',
  marginTop: '0.25rem',
  marginBottom: '0.25rem'
}}>• <em>Trigger</em> は、スケジュールに基づいて{resource}を実行し、フローに送信するファイルを生成する場合があります。このアクションはフローの起点として機能します。</p>
    <p style={{
  paddingLeft: '1.5rem',
  marginTop: '0.25rem',
  marginBottom: '0.25rem'
}}>• <em>Transform</em> は、フローからのメッセージを{resource}への入力として受け取り、出力を生成します。このアクションはフローの中間として機能します。</p>
    <p style={{
  paddingLeft: '1.5rem',
  marginTop: '0.25rem',
  marginBottom: '0.25rem'
}}>• <em>Terminal</em> は、フローからのメッセージを{resource}への入力として受け取り、フローの終端として機能します。</p>
  </>;

export const SlasTab = ({siteName = "CData Arc"}) => <>
    <p><em>サービスレベルアグリーメント（SLA）の設定に関する設定です。</em></p>
    <p>
      SLA を使用すると、フロー内のコネクタが送受信すると見込まれるボリュームを設定し、そのボリュームを達成すると見込まれる期間を設定できます。{siteName} は、SLA が達成されない場合にユーザーへ警告するメールを送信し、SLA を<em>At Risk</em> としてマークします。これは、SLA が間もなく達成されない場合に<em>Violated</em> としてマークされることを意味します。これにより、ユーザーは介入してSLA が達成されない理由を特定し、適切な対応を取る機会を得られます。At Risk 期間の終了時点でもSLA が達成されない場合、SLA はviolated としてマークされ、ユーザーに再度通知されます。
    </p>
    <p>
      SLA を定義するには、<strong>Expected Volume</strong> をオンに切り替え、<strong>Settings</strong> タブをクリックします。
    </p>
    <img src="/public/images/sla_empty.png" alt="SLA Empty" />
    <ul>
      <li>コネクタに送信と受信の個別のアクションがある場合は、ラジオボタンを使用してSLA がどちらの方向に適用されるかを指定します。</li>
      <li>ウィンドウの<strong>Expect at least</strong> 部分で、次を設定します。
        <ul>
          <li>処理を見込む最小トランザクション数（ボリューム）を設定します。</li>
          <li><strong>Every</strong> フィールドを使用して期間を指定します。</li>
          <li>SLA を有効にするタイミングを指定します。<strong>Starting on</strong> を選択した場合は、日付および時刻フィールドを入力します。</li>
          <li>SLA を有効にしたい曜日のチェックボックスをオンにします。必要に応じて、ドロップダウンで<strong>Everyday</strong> を選択します。</li>
        </ul>
      </li>
      <li>ウィンドウの<strong>Set status to 'At Risk'</strong> 部分で、SLA をAt Risk としてマークするタイミングを指定します。
        <ul>
          <li>デフォルトでは、SLA が違反状態になるまで通知は送信されません。これを変更するには、<strong>Send an 'At Risk' notification</strong> をオンにします。</li>
        </ul>
      </li>
    </ul>
    <p>
      次の例は、月曜日から金曜日まで毎日1000 件のファイルを受信すると見込むコネクタ向けに設定されたSLA を示しています。1000 件のファイルが受信されていない場合、期間の終了の1時間前にAt Risk 通知が送信されます。
    </p>
    <img src="/public/images/sla_defined.png" alt="SLA Configuration Example" />
    <Note>
      必要に応じてSLA アラートをオフにすることができます。これはメンテナンスウィンドウ中に役立ちます。navbar で<strong>Settings</strong> をクリックし、<strong>Alerts &gt; General Alerts</strong> に移動します。タブレットと鉛筆のアイコンをクリックして編集し、<strong>SLA Alerts</strong> 設定のチェックを外します。
    </Note>
  </>;

export const AlertsTab = ({siteNameShort = "Arc"}) => <>
    <p><em>アラートの設定に関する設定です。</em></p>
    <p>
      サービスレベルアグリーメント（SLA）を実行する前に、通知用のメールアラートをセットアップする必要があります。デフォルトでは、{siteNameShort} は<a href="/26.2/self-hosted/ja/getting-started/administration/settings/alerts">Alerts</a> タブのグローバル設定を使用します。このコネクタに別の設定を使用するには、<strong>Override global setting</strong> をオンに切り替えます。
    </p>
    <p>
      デフォルトではエラーアラートが有効になっており、エラーが発生するたびにメールが送信されます。これをオフにするには、<strong>Enable</strong> チェックボックスのチェックを外します。
    </p>
    <p>
      <strong>Subject</strong>（必須）を入力し、必要に応じて<strong>Recipient</strong> のメールアドレスをカンマ区切りのリストで入力します。
    </p>
  </>;

export const CommonProxySettings = () => <>
    <p>これらは、接続のルーティング先となるプロキシを識別し認証するための一連の設定です。デフォルトでは、このセクションは<a href="/26.2/self-hosted/ja/getting-started/administration/settings/security">Security Settings</a> ページの<a href="/26.2/self-hosted/ja/getting-started/administration/settings/proxy-settings">Proxy Settings</a> 部分にあるグローバル設定を使用します。チェックボックスをオフにすると、コネクタ固有の設定を指定できます。</p>
    <table>
      <thead>
        <tr><th>設定</th><th>説明</th></tr>
      </thead>
      <tbody>
        <tr>
          <td><strong>Proxy Type</strong></td>
          <td>プロキシベースのファイアウォールで使用されるプロトコル。</td>
        </tr>
        <tr>
          <td><strong>Proxy Host</strong></td>
          <td>プロキシベースのファイアウォールの名前またはIP アドレス。</td>
        </tr>
        <tr>
          <td><strong>Proxy Port</strong></td>
          <td>プロキシベースのファイアウォールのTCP ポート。</td>
        </tr>
        <tr>
          <td><strong>Proxy User</strong></td>
          <td>プロキシベースのファイアウォールで認証するために使用するユーザー名。</td>
        </tr>
        <tr>
          <td><strong>Proxy Password</strong></td>
          <td>プロキシベースのファイアウォールで認証するために使用するパスワード。</td>
        </tr>
        <tr>
          <td><strong>Authentication Scheme</strong></td>
          <td>デフォルトの<strong>None</strong> のままにするか、次の認証スキームのいずれかを選択します：<strong>Basic</strong>、<strong>Digest</strong>、<strong>Proprietary</strong>、または<strong>NTLM</strong>。</td>
        </tr>
      </tbody>
    </table>
  </>;

export const Message = () => <>
    <p><em>Message 設定は、コネクタがメッセージを検索する方法と、処理後にメッセージを管理する方法を決定します。</em></p>
    <table>
      <thead>
        <tr><th>設定</th><th>説明</th></tr>
      </thead>
      <tbody>
        
          <tr>
            <td><strong>Save to Sent Folder</strong></td>
            <td>コネクタが処理したファイルをコネクタのSent フォルダにコピーするには、これをオンにします。</td>
          </tr>
        
        <tr>
          <td><strong>Sent Folder Scheme</strong></td>
          <td>選択した間隔に従って、コネクタが<strong>Sent</strong> フォルダ内のファイルをグループ化するよう指示します。例えば、<strong>Weekly</strong> オプションは、コネクタが毎週新しいサブフォルダを作成し、その週のすべての送信済みファイルをそのフォルダに保存するよう指示します。空白の設定は、コネクタがすべてのファイルを<strong>Sent</strong> フォルダに直接保存するよう指示します。多数のトランザクションを処理するコネクタでは、サブフォルダを使用することでファイルを整理しやすくなり、パフォーマンスを向上できます。</td>
        </tr>
      </tbody>
    </table>
  </>;

export const MiscConnector = () => <>
    <p><em>Miscellaneous 設定は、特定のユースケース向けの設定です。</em></p>
    <table>
      <thead>
        <tr>
          <th>設定</th>
          <th>説明</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td><strong>Other Settings</strong></td>
          <td>非表示のコネクタ設定をセミコロン区切りのリストで設定できます（例：<code>setting1=value1;setting2=value2</code>）。通常のコネクタのユースケースや機能では、これらの設定の使用は必要ありません。</td>
        </tr>
      </tbody>
    </table>
  </>;

export const Logging = () => <>
    <p><em>ログの作成と保存を制御する設定です。</em></p>
    <table>
      <thead>
        <tr>
          <th>設定</th>
          <th>説明</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td><strong>Log Level</strong></td>
          <td>コネクタが生成するログの詳細度です。サポートを依頼する際は、これを<strong>Debug</strong> に設定してください。</td>
        </tr>
        <tr>
          <td><strong>Log Subfolder Scheme</strong></td>
          <td>選択した間隔に従って、コネクタがLogs フォルダ内のファイルをグループ化するよう指示します。<strong>Weekly</strong> オプション（デフォルト）は、コネクタが毎週新しいサブフォルダを作成し、その週のすべてのログをそのフォルダに保存するよう指示します。この設定を空白のままにすると、コネクタはすべてのログをLogs フォルダに直接保存します。多数のトランザクションを処理するコネクタでは、サブフォルダを使用することでログを整理しやすくなり、パフォーマンスが向上します。</td>
        </tr>
        <tr>
          <td><strong>Log Messages</strong></td>
          <td>処理したファイルのログエントリにファイル自体のコピーを含めるには、これをオンにします。これを無効にすると、<strong>Transactions</strong> タブからファイルのコピーをダウンロードできなくなる場合があります。</td>
        </tr>
      </tbody>
    </table>
  </>;

export const MacrosExamples = ({extraMacros = []}) => <>
    <p>
      %Ext% や %ShortDate% などの一部のマクロは引数を必要としませんが、引数を必要とするものもあります。
      引数を取るすべてのマクロは次の構文を使用します。<code>%Macro:argument%</code>
    </p>

    <p>引数を取るマクロの例を次に示します。</p>

    <ul>
      <li>%Header:headername%：<code>headername</code> はメッセージ上のヘッダーの名前です。</li>
      <li>%Header:mycustomheader% は、入力メッセージに設定された<code>mycustomheader</code> ヘッダーの値に解決されます。</li>
      <li>%Header:ponum% は、入力メッセージに設定された<code>ponum</code> ヘッダーの値に解決されます。</li>
      <li>%RegexFilename:pattern%：<code>pattern</code> は正規表現パターンです。例えば、<code>%RegexFilename:^([\w][A-Za-z]+)%</code> は、ファイル名の最初の単語にマッチしてそれに解決され、大文字・小文字を区別しません（<code>test_file.xml</code> は<code>test</code> に解決されます）。</li>
      <li>%Vault:vaultitem%：<code>vaultitem</code> は<a href="/26.2/self-hosted/ja/getting-started/administration/settings/global-settings-vault">Vault</a> 内のアイテムの名前です。例えば、<code>%Vault:companyname%</code> は、Vault に保存された<code>companyname</code> アイテムの値に解決されます。</li>
      <li>%DateFormat:format%：<code>format</code> は許容される日付形式です（詳細は<a href="/26.2/self-hosted/ja/scripting/value-formatters/date-formatters#sample-date-formats">日付形式のサンプル</a>を参照してください）。例えば、<code>%DateFormat:yyyy-MM-dd-HH-mm-ss-fff%</code> は、ファイルの日付とタイムスタンプに解決されます。</li>
      {extraMacros.filter(item => item.example).map(item => <li key={`ex-${item.name}`}>{item.example}</li>)}
    </ul>

    <p>次の例に示すように、より高度なマクロを作成することもできます。</p>

    <ul>
      <li>1 つのファイル名で複数のマクロを組み合わせる：<code>%DateFormat:yyyy-MM-dd-HH-mm-ss-fff%%EXT%</code></li>
      <li>マクロの外側にテキストを含める：<code>MyFile_%DateFormat:yyyy-MM-dd-HH-mm-ss-fff%</code></li>
      <li>マクロの内側にテキストを含める：<code>%DateFormat:'DateProcessed-'yyyy-MM-dd_'TimeProcessed-'HH-mm-ss%</code></li>
    </ul>
  </>;

export const MacrosTable = ({siteName = "CData Arc", extraMacros = []}) => <>
    <p>
      ファイル命名戦略でマクロを使用すると、データの整理効率と文脈の理解を高めることができます。
      ファイル名にマクロを組み込むことで、識別子、タイムスタンプ、ヘッダー情報などの関連情報を
      動的に含めることができ、各ファイルに有用な文脈を提供します。
    </p>

    <p>{siteName} は次のマクロをサポートしています。これらはすべて次の構文を使用します。<code>%Macro%</code></p>

    <table>
      <thead>
        <tr><th>マクロ</th><th>説明</th></tr>
      </thead>
      <tbody>
        <tr><td>ConnectorID</td><td>コネクタのConnectorID に評価されます。</td></tr>
        <tr><td>Ext</td><td>コネクタが現在処理しているファイルの拡張子に評価されます。</td></tr>
        <tr><td>Filename</td><td>コネクタが現在処理しているファイルのファイル名（拡張子を含む）に評価されます。</td></tr>
        <tr><td>FilenameNoExt</td><td>コネクタが現在処理しているファイルのファイル名（拡張子を除く）に評価されます。</td></tr>
        <tr><td>MessageId</td><td>コネクタが出力しているメッセージのMessageId に評価されます。</td></tr>
        <tr><td>RegexFilename:<em>pattern</em></td><td>コネクタが現在処理しているファイルのファイル名に正規表現パターンを適用します。</td></tr>
        <tr><td>Header:<em>headername</em></td><td>コネクタが現在処理しているメッセージ上の対象ヘッダー（<code>headername</code>）の値に評価されます。</td></tr>
        <tr><td>LongDate</td><td>システムの現在の日時を長い形式（例：Wednesday, January 24, 2024）で評価します。</td></tr>
        <tr><td>ShortDate</td><td>システムの現在の日時をyyyy-MM-dd 形式（例：2024-01-24）で評価します。</td></tr>
        <tr><td>DateFormat:<em>format</em></td><td>システムの現在の日時を指定された形式（<code>format</code>）で評価します。利用可能な日時形式については、<a href="/26.2/self-hosted/ja/scripting/value-formatters/date-formatters#date-formats-with-literal-characters">日付形式のサンプル</a>を参照してください。</td></tr>
        <tr><td>Vault:<em>vaultitem</em></td><td>指定されたVault アイテムの値に評価されます。</td></tr>
        {extraMacros.map(item => <tr key={item.name}>
            <td>{item.name}</td>
            <td>{item.description}</td>
          </tr>)}
      </tbody>
    </table>
  </>;

export const siteNameShort = "Arc";

export const siteName = "CData Arc";

AI connectors are designed to connect to a number of AI models that expose a REST API. The supported list is [below](./ai#ai-config-tab).

## Key Capabilities

* Multi-provider AI integration
* Flexible prompt engineering
* Customizable AI model selection
* Structured output control
* Intelligent content processing

## Overview

The {siteName} AI connector is a flexible integration tool that connects to any AI model via REST APIs, enabling you to process input messages using configurable system and user prompts to generate structured outputs within your data flows. It supports popular AI services like OpenAI, Gemini, Ollama, and other OpenAI-compatible providers, with full control over API endpoints, models, and parameters. With {siteNameShort}Script-enabled prompts and customizable output formats, the connector enables use cases such as extracting insights from unstructured feedback, translating content across languages, and transforming text data into actionable structured information.

### Actions

<CommonActionType resource="request" />

## Connector Configuration

This section contains all of the configurable connector properties.

### AI Config Tab

If you have not already configured the global AI settings at **Settings > Advanced > AI Settings**, the **AI Config** tab displays a message that you must do this before you can use the connector. Click the **Configure AI Settings** button, and follow the instructions in [AI Settings](../getting-started/administration/settings/ai-settings). If the global settings have already been configured but you want to override them in this connector, click **Edit**. To override the global settings, toggle on **Override global setting**. Now you can select which AI provider you want to use, enter the appropriate connection details and then save the configuration. The connector supports the following providers:

* Claude
* Deepseek
* Gemini
* Grok
* Ollama (cloud and local)
* OpenAI
* OpenAI Compatible (any AI provider that implements OpenAI's API)

Use the **Edit AI Settings** pane to define the **Base URL** (only available when the provider is **Ollama** or **OpenAI Compatible**), add the provider's **API Key**, and select a **Model**.

To populate the **User Prompt** field, you can click **Suggested Prompts** to see a set of predefined prompts for a variety of use cases, or you can enter your own prompt directly into the field. This is where you define the task or request that you want the connector to perform when it receives a file. For example, you could enter something like *Summarize the inbound EDI X12 file using natural language* so that employees who are not familiar with the EDI X12 structure can read the summary and understand what information the document contains. This field supports {siteNameShort}Script.

You can also choose to **Attach input messages to requests**. This is especially useful when you are providing binary files (such as a PDF or image) to the AI provider.

To include non-binary files in the request, you need to use \_message.body in your prompt, like this:

```
<BEGIN FILE>
[_message.body]
<END FILE>
```

<Note>See the Summarize option in the Suggested Prompts dropdown for a complete example.</Note>

Toggle **System Prompt** to provide a set of specific instructions, constraints, languages, or roles that the AI provider should use when providing its response. For example: *Do not use any em dashes or emojis in your response.* This field also supports {siteNameShort}Script.

The way in which you test your configuration and prompts varies by the connector's [action type](#actions):

* If your connector is a trigger, click the **Test** button.
* If your connector is a transform or terminal, on the **Testing** tab, paste content into the **Input Body** or use the dropdown to add **Headers** and values, then click the **Test** button.

In both cases, the test results appear in the **Testing** tab. Logs from the test are displayed in the **Log** tab.

### Settings Tab

*Settings related to the core configuration of the connector.*

#### Configuration

| Setting                   | Description                                                                                                                                                                                                                                                                           |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Connector Id**          | The static, unique identifier for the connector.                                                                                                                                                                                                                                      |
| **Connector Type**        | Displays the connector name and a description of what it does.                                                                                                                                                                                                                        |
| **Connector Description** | An optional field to provide a free-form description of the connector and its role in the flow.                                                                                                                                                                                       |
| **Action**                | The action this connector is performing: trigger, transform, or terminal.                                                                                                                                                                                                             |
| **Output in JSON**        | If your model supports structured outputs, check this to deliver the connector output in JSON format. This is useful when you want to ensure the AI output is structured and machine-readable, so it is easier to parse, extract data, or use in downstream connectors and processes. |

#### Advanced Settings

| Setting               | Description                                                                                                                                                                                                                             |
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Local File Scheme** | A scheme for assigning filenames to messages that are output by the connector. You can use macros in your filenames dynamically to include information such as identifiers and timestamps. For more information, see [Macros](#macros). |

### Advanced Tab

#### Other Settings

| Setting     | Description                                                                       |
| ----------- | --------------------------------------------------------------------------------- |
| **Timeout** | The AI response timeout, in seconds. By default, this value is set to 60 seconds. |

#### Proxy Settings

<CommonProxySettings />

#### Message

<Message />

#### Logging

<Logging />

#### Miscellaneous

<MiscConnector />

### Automation Tab

#### Automation Settings

*Settings related to the automatic processing of files by the connector.*

| Setting                   | Description                                                                                                                                                                                                       |
| ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Send**                  | Whether files arriving at the connector are automatically uploaded.                                                                                                                                               |
| **Retry Interval**        | The amount of time before a failed upload is retried.                                                                                                                                                             |
| **Max Attempts**          | The maximum number of times the connector processes the input file. Success is measured based on a successful server acknowledgement. If you set this to 0, the connector retries the file indefinitely.          |
| **Receive**               | Whether the connector should automatically poll the remote download path for files to download.                                                                                                                   |
| **Interval**              | The interval between automatic download attempts.                                                                                                                                                                 |
| **Minutes Past the Hour** | The minutes offset for an hourly schedule. Only applicable when the interval setting above is set to *Hourly*. For example, if this value is set to 5, the automation service downloads at 1:05, 2:05, 3:05, etc. |
| **Time**                  | The time of day that the attempt should occur. Only applicable when the interval setting above is set to *Daily*, *Weekly*, or *Monthly*.                                                                         |
| **Day**                   | The day on which the attempt should occur. Only applicable when the interval setting above is set to *Weekly* or *Monthly*.                                                                                       |
| **Minutes**               | The number of minutes to wait before attempting the download. Only applicable when the interval setting above is set to *Minute*.                                                                                 |
| **Cron Expression**       | A five-position string representing a cron expression that determines when the attempt should occur. Only applicable when the interval setting above is set to *Advanced*.                                        |

### Alerts Tab

<AlertsTab />

### SLAs Tab

<SlasTab />

### Transactions Tab

This tab lists all messages associated with the connector. Use the search bar to find specific messages, or click the funnel icon to apply a filter. You can filter by time, message direction, and/or status.

Options on this tab vary depending on the connector's [action type](#actions):

* If your connector is a **Trigger**, use the **Receive Files** button to start the flow.
* If your connector is a **Transform** or **Terminal**, use the **Upload Files** button to upload files to the flow.

## Macros

<MacrosTable />

### Examples

<MacrosExamples />
