> For the complete documentation index, see [llms.txt](https://docs.roboflow.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roboflow.com/workflows/ja/burokku/blocks/run-a-model/google-gemma-api.md).

# Google Gemma API

{% hint style="warning" %}
**非推奨**

Roboflow管理のAPIキーオプション、ユーザーが選択できるプライバシー制御、そして同じOpenRouterパススルー機能を追加するGoogle Gemma v2ブロックを使用します。
{% endhint %}

画像機能を備えたGoogleのGemmaモデルに質問します。

任意のテキストプロンプトまたは事前定義済みのものを指定できます。このブロックは次の種類のプロンプトをサポートしています:

* **オープンプロンプト** (`制約なし`) - 任意のプロンプトを使用して、生の応答を生成します
* **テキスト認識（OCR）** (`ocr`) - モデルが画像内のテキストを認識します
* **視覚的質問応答** (`visual-question-answering`) - モデルがプロンプトで送信された質問に答えます
* **キャプション生成（短い）** (`caption`) - モデルが画像の短い説明を提供します
* **キャプション生成** (`detailed-caption`) - モデルが画像の長い説明を提供します
* **単一ラベル分類** (`classification`) - モデルが画像内容を、提供されたクラスのいずれか1つとして分類します
* **複数ラベル分類** (`multi-label-classification`) - モデルが画像内容を、提供されたクラスの1つまたは複数として分類します
* **プロンプトなしオブジェクト検出** (`object-detection`) - モデルが画像内の目立つオブジェクトを検出し、バウンディングボックスを返します
* **構造化出力生成** (`structured-answering`) - モデルが指定されたフィールドを持つ JSON 応答を返します

#### 🛠️ APIプロバイダーとモデルのバリエーション

Gemma は以下を通じて公開されます [OpenRouter API](https://openrouter.ai/) そして、次を渡す必要があります [OpenRouter APIキー](https://openrouter.ai/docs/api-keys) を実行するために。

以下から特定のモデルバージョンを選択してください `model_version` ドロップダウン - 新しいGemmaリリースは、OpenRouterで利用可能になり次第、このリストに追加されます。

{% hint style="warning" %}
**API利用料金**

OpenRouterは、モデルへのアクセスを提供し、利用に応じて料金が発生する外部の第三者です。料金は以下でご確認ください [openrouter.ai](https://openrouter.ai/) を使用する前に。
{% endhint %}

#### 💡 参考情報と利用規定

{% hint style="warning" %}
**モデルライセンス**

以下を確認してください [Gemma 利用規約](https://ai.google.dev/gemma/terms) を使用する前に。
{% endhint %}

### 型識別子

ステップで次の識別子を使用してください `"type"` フィールド： `roboflow_core/google_gemma@v1` ワークフローにこのブロックをステップとして追加するには。

### プロパティ

| **名前**                    | **型**            | **説明**                                                                                                                       | 参照 |
| ------------------------- | ---------------- | ---------------------------------------------------------------------------------------------------------------------------- | -- |
| `name`                    | `str`            | このステップの一意の識別子を入力してください。                                                                                                      | ❌  |
| `task_type`               | `str`            | モデルによって実行されるタスクの種類。値によって必要なパラメータと出力応答が決まります。。                                                                                | ❌  |
| `プロンプト`                   | `str`            | Gemma モデルへのテキストプロンプト。                                                                                                        | ✅  |
| `output_structure`        | `Dict[str, str]` | 期待される JSON 応答の構造を持つ辞書。                                                                                                       | ❌  |
| `classes`                 | `List[str]`      | 使用するクラスのリスト。                                                                                                                 | ✅  |
| `api_key`                 | `str`            | あなたのOpenRouter APIキー。                                                                                                        | ✅  |
| `model_version`           | `str`            | 使用するモデル。                                                                                                                     | ✅  |
| `max_tokens`              | `整数`             | モデルが応答で生成できるトークンの最大数。。                                                                                                       | ❌  |
| `temperature`             | `float`          | モデルからサンプリングするための温度。値の範囲は 0.0〜2.0 で、高いほど生成結果はよりランダム／「創造的」になります。。                                                              | ✅  |
| `max_concurrent_requests` | `整数`             | 入力画像のバッチが提供されたときに、このブロックで実行できる同時リクエスト数。指定がない場合、このブロックはWorkflows Execution Engineでグローバルに設定された値をデフォルトで使用します。上限に達する場合は制限してください。 | ❌  |

この **参照** 列は、で利用可能な動的値を使ってプロパティをパラメータ化できる可能性を示します `ワークフロー` 実行時。参照 *バインディング* 詳細は。

### ランタイム互換性

`requires_internet` - エアギャップ／オフライン環境: このブロックは、完全にオフライン／エアギャップ環境から到達できないサービスに依存しています。

### 入力と出力のバインディング

利用可能な接続は、そのバインディング種別によって異なります。どのバインディング種別が `Google Gemma API` のバージョン `v1` あるか確認してください。

<details>

<summary>入力と出力のバインディング</summary>

* 入力
  * `images` ([*`image`*](/workflows/ja/gaido/developer-guide/kinds/image.md)): 推論対象の画像です..
  * `プロンプト` ([*`string`*](/workflows/ja/gaido/developer-guide/kinds/string.md)): Gemma モデルへのテキストプロンプト。
  * `classes` ([*`list_of_values`*](/workflows/ja/gaido/developer-guide/kinds/list-of-values.md))：使用するクラスのリスト。
  * `api_key` (*Union\[*[*`secret`*](/workflows/ja/gaido/developer-guide/kinds/secret.md)*,* [*`string`*](/workflows/ja/gaido/developer-guide/kinds/string.md)*]*）：あなたのOpenRouter APIキー。
  * `model_version` ([*`string`*](/workflows/ja/gaido/developer-guide/kinds/string.md))：使用するモデル。
  * `temperature` ([*`float`*](/workflows/ja/gaido/developer-guide/kinds/float.md))：モデルからサンプリングするための温度。値の範囲は 0.0〜2.0 で、高いほど生成結果はよりランダム／「創造的」になります。。
* 出力
  * `出力` (*Union\[*[*`string`*](/workflows/ja/gaido/developer-guide/kinds/string.md)*,* [*`language_model_output`*](/workflows/ja/gaido/developer-guide/kinds/language-model-output.md)*]*)：の文字列値 `string` または LLM / VLM の出力（条件が `language_model_output`.
  * `classes` ([`list_of_values`](/workflows/ja/gaido/developer-guide/kinds/list-of-values.md))：任意の型の値のリスト。

</details>

<details>

<summary>JSON 定義の例</summary>

```json
{
	    "name": "<your_step_name_here>",
	    "type": "roboflow_core/google_gemma@v1",
	    "images": "$inputs.image",
	    "task_type": "<block_does_not_provide_example>",
	    "prompt": "my prompt",
	    "output_structure": {
	        "my_key": "description"
	    },
	    "classes": [
	        "class-a",
	        "class-b"
	    ],
	    "api_key": "xxx-xxx",
	    "model_version": "Gemma 4 31B - OpenRouter",
	    "max_tokens": "<block_does_not_provide_example>",
	    "temperature": "<block_does_not_provide_example>",
	    "max_concurrent_requests": "<block_does_not_provide_example>"
	}
```

</details>
