---
schema_version: "1"
id: 473fef6b503854795b816ce3ab287bc1ab3e5c0dbff6b48b68ea95cef31f6d89
title: 画像生成操作の設定
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/mulesoft-ai-chain-connector/1.0/configuring-image-generation-operations.md
canonical_url: https://docs.mulesoft.com/jp/mulesoft-ai-chain-connector/1.0/configuring-image-generation-operations
source_site: docs.mulesoft.com
content_type: documentation
content_hash: a6837169977a498c78daff46d65c9e75784b402464c6e81b78974b8c8d618f67
description: MuleSoft Documentation Site
release: "1.0"
latest: true
---
# 画像生成操作の設定

## [](#image-read-操作の設定)Image Read 操作の設定

**Image read**​ 操作では、プロンプトに基づいて画像を読み取って解釈します。現在、MuleSoft AI Chain Connector では OpenAI 画像モデルのみがサポートされています。

**Image read**​ 操作を設定する手順は、次のとおりです。

Unresolved include directive in modules/ROOT/pages/configuring-image-generation-operations.adoc - include::connectors::partial$t-configure-operations.adoc\[\] \* **Data**

\+ 操作のプロンプトを含めます。 \* **ContextUrl**​

\+ 読み取る画像ファイルへの URL を含めます。

この操作の XML 設定を次に示します。

```xml
<ms-aichain:image-read
  doc:name="Image read"
  doc:id="16cac2ce-def9-41e2-aaff-0f9c33d622f1"
  config-ref="MuleSoft_AI_Chain_Config"
  contextURL="#[payload.imageUrl]">
  <ms-aichain:data><![CDATA[#[payload.prompt]]]></ms-aichain:data>
</ms-aichain:image-read>
```

### [](#出力設定)出力設定

この操作の応答には、メイン LLM 応答を含む JSON ペイロードが含まれます。また、トークン利用状況などの属性がメインペイロード内ではなくメタデータ (属性) の一部として含まれます。

JSON ペイロードの応答例を次に示します。

```json
{
  "response": "The image depicts a group of men in what appears to be a stadium or arena setting. They are standing in the stands, with some looking agitated or engaged in a discussion."
}
```

操作では、JSON ペイロードに加えて、トークン利用状況に関する情報が含まれる属性も返されます。次に例を示します。

```json
{
  "attributes": {
      "tokenUsage": {
          "outputCount": 87,
          "totalCount": 187,
          "inputCount": 100
      },
      "additionalAttributes": {}
  }
}
```

## [](#image-generate-操作の設定)Image Generate 操作の設定

**Image generate**​ 操作では、LLM に送信されたプロンプトに基づいて画像を生成します。現在、MuleSoft AI Chain Connector では OpenAI 画像モデルのみがサポートされています。

**Image generate**​ 操作を設定する手順は、次のとおりです。

1. Studio キャンバスで操作を選択します。
2. **\[General (一般)\]**​ プロパティセクションで、画像を生成するためのプロンプト (​`payload.prompt`​ など) を使用して ​**\[Data (データ)\]**​ 項目を設定します。

この操作の XML 設定を次に示します。

```xml
<ms-aichain:image-generate
  doc:name="Image generate"
  doc:id="a057ad09-533f-42e9-bfd6-00014db6cec8"
  config-ref="MuleSoft_AI_Chain_Config">
  <ms-aichain:data><![CDATA[#[payload.prompt]]]></ms-aichain:data>
</ms-aichain:image-generate>
```

### [](#出力設定-2)出力設定

この操作の応答には、生成された画像の URL を含む JSON ペイロードが含まれます。次に例を示します。

```json
{
  "response": "https://oaidalleapiprodscus.blob.core.windows.net/private/org-dP8odnP25FlwTi1fOMr1X7vO/user-Jyi0vNlYu4mjEBZl9Mu1lXBW/img-bEO12CWIRI7CkGUjfz5ajAlS.png"
}
```

## [](#関連情報)関連情報

- [Using Anypoint Code Builder to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-acb)
- [Studio を使用したコネクタの設定](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio)
- [MuleSoft AI Chain Connector の概要](https://docs.mulesoft.com/jp/mulesoft-ai-chain-connector/1.0/)
- [MuleSoft AI Chain Connector リファレンス](https://docs.mulesoft.com/jp/mulesoft-ai-chain-connector/1.0/mulesoft-ai-chain-connector-reference)
- [MuleSoft ヘルプセンター](https://help.mulesoft.com)