

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# Writer AI Palmyra モデル
<a name="model-parameters-writer-palmyra"></a>

このセクションでは、Writer AI モデルのリクエストパラメータとレスポンスフィールドについて説明します。この情報を使用して、[InvokeModel](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_InvokeModel.html) および [InvokeModelWithResponseStream](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_InvokeModelWithResponseStream.html) (ストリーミング) オペレーションで Writer AI モデルに推論呼び出しを実行します。このセクションでは、Writer AI モデルを呼び出す方法を示す Python コード例も含まれています。推論オペレーションでモデルを使用するには、そのモデルのモデル ID が必要です。モデル ID を取得するには、「[Amazon Bedrock でサポートされている基盤モデル](models-supported.md)」を参照してください。モデルによっては、[Converse API](conversation-inference.md) でも動作します。Converse API が特定の Writer AI モデルをサポートしているかどうかを確認するには、「[サポートされているモデルとモデルの機能](conversation-inference-supported-models-features.md)」を参照してください。コード例については、「[AWS SDKsコード例](service_code_examples.md)」を参照してください。

Amazon Bedrock の基盤モデルは、モデルごとに異なる入出力モダリティをサポートしています。Writer AI モデルがサポートするモダリティを確認するには、「[Amazon Bedrock でサポートされている基盤モデル](models-supported.md)」を参照してください。Writer AI モデルがサポートする Amazon Bedrock 機能を確認するには、「[Amazon Bedrock でサポートされている基盤モデル](models-supported.md)」を参照してください。Writer AI モデルが使用可能な AWS リージョンを確認するには、「[Amazon Bedrock でサポートされている基盤モデル](models-supported.md)」を参照してください。

Writer AI モデルで推論呼び出しを行う場合は、モデルのプロンプトを含めます。Amazon Bedrock がサポートするモデルのプロンプト作成に関する一般情報については、「[プロンプトエンジニアリングの概念](prompt-engineering-guidelines.md)」を参照してください。Writer AI 特定のプロンプト情報については、「[Writer AI プロンプトエンジニアリングガイド]()」を参照してください。

**Writer Palmyra X4**

Stanford HELM で上位にランクインした Writer Palmyra X4 は、複雑なタスクやエージェントワークフローで優れたパフォーマンスを実現します。128k トークンのコンテキストウィンドウと、高度な推論、ツール呼び出し、LLM 委任、組み込み RAG、コード生成、構造化出力、マルチモダリティ、多言語サポートなど、エンタープライズグレードの機能のスイートが統合されています。モデルのアクションを実行する機能を拡張するエンタープライズ固有のツールを使用すると、Palmyra X4 を使って、デベロッパーはシステムの更新、トランザクションの実行、メールの送信、ワークフローのトリガーなど、さまざまな機能を備えたアプリケーションやエージェントを開発できます。

**Writer Palmyra X5**

100 万トークンのコンテキストウィンドウを備えた Writer Palmyra X5 は、アプリケーションおよびエージェントの開発のコンテキスト制約を打破しています。Writer の最新モデルは、拡張されたメモリと処理能力により、長いコンテキストの推論で優れたパフォーマンスを発揮し、デベロッパーはより複雑な複数ステップのエージェントワークフローをより迅速に構築できます。Palmyra X4 と同様に、Palmyra X5 は、高度な推論、ツール呼び出し、LLM 委任、組み込み RAG、コード生成、構造化出力、マルチモダリティ、多言語サポートなど、エンタープライズ対応の機能のスイートを提供します。

**Topics**
+ [Writer Palmyra X4](model-parameters-palmyra-x4.md)
+ [Writer Palmyra X5](model-parameters-palmyra-x5.md)

# Writer Palmyra X4
<a name="model-parameters-palmyra-x4"></a>

Writer Palmyra X4 は、最大 128,000 トークンのコンテキストウィンドウを持つモデルです。このモデルは、複雑なタスクの処理と理解に優れているため、ワークフローオートメーション、コーディングタスク、データ分析に最適です。
+ プロバイダー — Writer
+ カテゴリ — テキスト生成、コード生成、リッチテキストフォーマット
+ 最新バージョン — v1
+ リリース日 — 2025 年 4 月 28 日
+ モデル ID — `writer.palmyra-x4-v1:0`
+ モダリティ — テキスト
+ 最大トークン数 — 入力: 122,880 トークン、出力: 8,192 トークン
+ 言語 — 英語、スペイン語、フランス語、ドイツ語、中国語、その他の複数の言語
+ デプロイタイプ — サーバーレス

## Palmyra X4 呼び出しリクエストの本文フィールド
<a name="model-parameters-palmyra-x4-request-body"></a>

Writer モデルを使用して [InvokeModel](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_InvokeModel.html) または [InvokeModelWithResponseStream](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_InvokeModelWithResponseStream.html) を呼び出す場合、以下の JSON オブジェクトを `body` フィールドに入力します。`text_prompts` オブジェクトの `text` フィールドにプロンプトを入力してください。

```
{
"modelId": "writer.palmyra-x4-v1:0",
"contentType": "application/json",
"accept": "application/json",
"body": "{\"messages\":[{\"role\":\"user\",\"content\":{\"text\":\"Explain quantum computing in simple terms\"}}]}"
}
```

次の表は、数値パラメータの最小値、最大値、およびデフォルト値を示しています。


****  

| パラメータ | タイプ | デフォルト | 範囲/検証 | 説明 | 
| --- | --- | --- | --- | --- | 
| メッセージ | 配列 | 必須 | 1～∞ 項目 | チャット履歴メッセージ | 
| 温度 | フロート | 1.0 | 0.0 ≤ x ≤ 2.0 | サンプリング温度 | 
| top\$1p | フロート | 1.0 | 0.0 < 値 ≤ 1.0 | Nucleus サンプリングしきい値 | 
| max\$1tokens | int | 16 | 1 ≤ x ≤ 8192 | 生成する最大トークン数 | 
| min\$1tokens | int | 0 | 0 ≤ x ≤ max\$1tokens | 停止前の最小トークン数 | 
| 停止 | 配列 | [] | ≤4 エントリ | 停止シーケンス | 
| シード | int | null | 任意の整数 | [Random seed] (ランダムシード) | 
| presence\$1penalty | フロート | 0.0 | -2.0 ≤ x ≤ 2.0 | 新しいトークンプレゼンスのペナルティ | 
| frequency\$1penalty | フロート | 0.0 | -2.0 ≤ x ≤ 2.0 | トークンの頻度ペナルティ | 

## Palmyra X4 呼び出しレスポンスの本文フィールド
<a name="model-parameters-palmyra-x4-response-body"></a>

Writer Palmyra X4 のレスポンス JSON は、以下の形式を使用します。

```
{
  "id": "chatcmpl-a689a6e150b048ca8814890d3d904d41",
  "object": "chat.completion",
  "created": 1745854231,
  "model": "writer.palmyra-x4-v1:0",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "reasoning_content": null,
        "content": "Quantum computing harnesses quantum mechanics to process information in extraordinarily powerful ways. Unlike classical bits, which are 0 or 1, quantum bits (qubits) can exist in multiple states simultaneously through superposition. Qubits also entangle, allowing them to be interconnected in such a way that the state of one (whether it's 0 or 1) can depend on the state of another, no matter the distance between them. This combination of superposition and entanglement enables quantum computers to solve complex problems much faster than classical computers, particularly in areas like cryptography, optimization, and simulations of molecular structures. However, quantum computing is still in its early stages, facing challenges in stability and scalability.",
        "tool_calls": []
      },
      "logprobs": null,
      "finish_reason": "stop",
      "stop_reason": null
    }
  ],
  "usage": {
    "prompt_tokens": 43,
    "total_tokens": 186,
    "completion_tokens": 143,
    "prompt_tokens_details": null
  },
  "prompt_logprobs": null
}
```

## Writer Palmyra X4 のコードの例
<a name="model-parameters-palmyra-x4-example-code"></a>

Writer Palmyra X4 のコード例

```
import boto3
import json
from botocore.exceptions import ClientError

client = boto3.client("bedrock-runtime", region_name="us-west-2")
model_id = "writer.palmyra-x4-v1:0"

# Format the request payload using the model's native structure.
native_request = {
    "temperature": 1,
    "messages": [
        {
            "role": "user",
            "content": "Explain quantum computing in simple terms.",
        }
    ],
}

# Convert the native request to JSON.
request = json.dumps(native_request)

try:
    # Invoke the model with the request.
    response = client.invoke_model(modelId=model_id, body=request)
except (ClientError, Exception) as e:
    print(f"ERROR: Can't invoke '{model_id}'. Reason: {e}")
    exit(1)

# Decode the response body.
model_response = json.loads(response["body"].read())

# Extract and print the response text.
response_text = model_response["content"][0]["text"]
print(response_text)
```

# Writer Palmyra X5
<a name="model-parameters-palmyra-x5"></a>

Writer Palmyra X5 は、高度な推論、ツール呼び出し、LLM 委任、組み込み RAG、コード生成、構造化出力、マルチモダリティ、多言語サポートなど、エンタープライズ対応の機能のスイートを提供します。

Writer Palmyra X5 モデルには次のコントロールがあります。
+ プロバイダー — Writer
+ カテゴリ — テキスト生成、コード生成、リッチテキストフォーマット
+ 最新バージョン — v1
+ リリース日 — 2025 年 4 月 28 日
+ モデル ID — `writer.palmyra-x5-v1:0`
+ モダリティ — テキスト
+ 最大トークン数 — 入力: 1,040,000 トークン、出力: 8,192 トークン
+ 言語 — 英語、スペイン語、フランス語、ドイツ語、中国語、その他の複数の言語
+ デプロイタイプ — サーバーレス

## Palmyra X5 呼び出しリクエストの本文フィールド
<a name="model-parameters-palmyra-x5-request-body"></a>

Writer モデルを使用して [InvokeModel](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_InvokeModel.html) または [InvokeModelWithResponseStream](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_InvokeModelWithResponseStream.html) を呼び出す場合、以下の JSON オブジェクトを `body` フィールドに入力します。`text_prompts` オブジェクトの `text` フィールドにプロンプトを入力してください。

```
{
"modelId": "writer.palmyra-x5-v1:0",
"contentType": "application/json",
"accept": "application/json",
"body": "{\"messages\":[{\"role\":\"user\",\"content\":{\"text\":\"Explain quantum computing in simple terms\"}}]}"
}
```

次の表は、数値パラメータの最小値、最大値、およびデフォルト値を示しています。


****  

| パラメータ | タイプ | デフォルト | 範囲/検証 | 説明 | 
| --- | --- | --- | --- | --- | 
| メッセージ | 配列 | 必須 | 1～∞ 項目 | チャット履歴メッセージ | 
| 温度 | フロート | 1.0 | 0.0 ≤ x ≤ 2.0 | サンプリング温度 | 
| top\$1p | フロート | 1.0 | 0.0 < x ≤ 1.0 | Nucleus サンプリングしきい値 | 
| max\$1tokens | int | 16 | 1 ≤ x ≤ 8192 | 生成する最大トークン数 | 
| min\$1tokens | int | 0 | 0 ≤ x ≤ max\$1tokens | 停止前の最小トークン数 | 
| 停止 | 配列 | [] | ≤4 エントリ | 停止シーケンス | 
| シード | int | null | 任意の整数 | [Random seed] (ランダムシード) | 
| presence\$1penalty | フロート | 0.0 | -2.0 ≤ x ≤ 2.0 | 新しいトークンプレゼンスのペナルティ | 
| frequency\$1penalty | フロート | 0.0 | -2.0 ≤ x ≤ 2.0 | トークンの頻度ペナルティ | 

## Palmyra X5 呼び出しレスポンスの本文フィールド
<a name="model-parameters-palmyra-x5-response-body"></a>

Writer Palmyra X5 のレスポンス JSON は、以下の形式を使用します。

```
{
  "id": "chatcmpl-a689a6e150b048ca8814890d3d904d41",
  "object": "chat.completion",
  "created": 1745854231,
  "model": "writer.palmyra-x5-v1:0",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "reasoning_content": null,
        "content": "Quantum computing harnesses quantum mechanics to process information in extraordinarily powerful ways. Unlike classical bits, which are 0 or 1, quantum bits (qubits) can exist in multiple states simultaneously through superposition. Qubits also entangle, allowing them to be interconnected in such a way that the state of one (whether it's 0 or 1) can depend on the state of another, no matter the distance between them. This combination of superposition and entanglement enables quantum computers to solve complex problems much faster than classical computers, particularly in areas like cryptography, optimization, and simulations of molecular structures. However, quantum computing is still in its early stages, facing challenges in stability and scalability.",
        "tool_calls": []
      },
      "logprobs": null,
      "finish_reason": "stop",
      "stop_reason": null
    }
  ],
  "usage": {
    "prompt_tokens": 43,
    "total_tokens": 186,
    "completion_tokens": 143,
    "prompt_tokens_details": null
  },
  "prompt_logprobs": null
}
```