AI で返金依頼への返信を下書きする(送信はしない)

エージェントが返金依頼をポリシーと照らし合わせ、人が承認するための返信を下書きします。返金そのものはできません。

  • ファイル
  • 読み取り専用の接続
  • コールバック
  • 予算の上限

実際の実行を見る

2026年10月7日 の実際の実行を再生しています。モデル: openai/gpt-6-luna。

入力
{
  "ticket_id": "tkt_1001",
  "today": "2026-10-06"
}
成功run_3602104e2ab91b251b1b9eac8516ac97$0.03 のうち $0.002782
  1. 待機中予算 $0.03 を確保
  2. MicroVMmicroVM ready
  3. MicroVMworker started · shell off · web off
  4. ファイルread refund-policy.md
  5. 接続helpdesk GET /tickets/tkt_1001
  6. 結果helpdesk GET → 200
  7. MicroVMmicroVM destroyed
  8. 成功モデル呼び出し 3 回、トークン 4,442記録された出力(英語)

    Decision: Eligible

    Reason: Policy clause 1 allows a full refund within 14 days for an annual plan if no project was created and no API call was made. The ticket shows purchase on 2026-09-28, zero projects, and zero API calls; the request is dated 2026-10-06, within 14 days.

    Draft reply: Hi Maria, your annual plan meets the refund criteria. The billing team will process the refund to your original payment method. Best, Support

  9. ワーカーを破棄$0.002782 を請求、$0.027218 を解放
モデル $0.000382 · Web $0.00 · コンピュート $0.0024

自分で実行する

リクエスト全体が入力された状態で、サンプルをプレイグラウンドで開きます。実行はご自身のアカウントで、表示された予算の範囲内で、同じ読み取り専用のサンプルシステムに対して行われます。

このサンプルの予算: $0.03

仕組み

ポリシーはファイルで、チケットは読み取り専用のヘルプデスク接続から取得します。エージェントは依頼が対象かどうかを判断し、根拠にした条項を引用して、下書きを書きます。承認は人が行い、その後は請求システムが処理します。

エージェントにできること、できないこと

権限はリクエストの一部です。ここに挙げていないものは、実行では利用できません。

設定許可
接続
helpdesk: GET のみ、ephemer.al/api/samples/support-api へ
Webオフ
シェルオフ
ファイルrefund-policy.md(読み取り専用)
ゼロデータ保持オフ: 記録は 30 日間保存されます
予算$0.03、厳格な上限
タイムアウト60 秒

認証情報がマシンに入ることはありません。ブローカーが各呼び出しに認証情報を付与し、上記のメソッドだけを通します。

コード

サンプルが送信する正確なリクエストです。EPHEMERAL_API_KEY には、組織のメンバーキーを設定してください。

curl -X POST $EPHEMERAL_URL/v1/runs \
  -H "Authorization: Bearer $EPHEMERAL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d @request.json

リクエストに含まれるファイル

インラインで渡すため、事前にアップロードする必要はありません。エージェントには、それぞれが読み取り専用のファイルとして見えます。

refund-policy.md
refund-policy.md
# Refund policy

1. Annual plans may be refunded in full within 14 days of purchase if no project has been created and no API call has been made.
2. After 14 days, or after any use, annual plans are refunded pro rata for the unused full months only, at our discretion.
3. Monthly plans are not refunded for the current month; cancelling stops the next charge.
4. A refund is issued by the billing team only, to the original payment method. Never promise a date.
5. Always be polite, concise and plain. Do not offer discounts.
リクエスト本文の全体 request.json

同じ本文を、ファイルをインラインにした形で示します。

request.json
{
  "prompt": "Handle the refund request in the helpdesk ticket input.ticket_id (GET /tickets/{id}); today's date is input.today. Apply refund-policy.md. Reply in Markdown with: Decision (eligible, not eligible or needs a human, one line), Reason (cite the policy clause number and the ticket facts you used), and Draft reply (under 90 words, in the customer's language). The draft is for a human to review: never say a refund has been issued, only that the billing team will process it if the decision is eligible. Use only what the data returns and never guess; if a call fails or a field is missing, say so.",
  "input": {
    "ticket_id": "tkt_1001",
    "today": "2026-10-06"
  },
  "files": [
    {
      "path": "refund-policy.md",
      "content": "# Refund policy\n\n1. Annual plans may be refunded in full within 14 days of purchase if no project has been created and no API call has been made.\n2. After 14 days, or after any use, annual plans are refunded pro rata for the unused full months only, at our discretion.\n3. Monthly plans are not refunded for the current month; cancelling stops the next charge.\n4. A refund is issued by the billing team only, to the original payment method. Never promise a date.\n5. Always be polite, concise and plain. Do not offer discounts.\n"
    }
  ],
  "connections": {
    "helpdesk": {
      "type": "http",
      "url": "https://ephemer.al/api/samples/support-api",
      "auth": {
        "type": "bearer",
        "token": "sample_read_key"
      },
      "allowed_methods": [
        "GET"
      ],
      "instructions": "A helpdesk. GET /tickets lists tickets (id, subject, status, language). GET /tickets/{id} returns one ticket with customer, context (order or invoice facts) and the full message thread. Amounts are in cents."
    }
  },
  "shell": false,
  "timeout_seconds": 60,
  "max_cost_micros": 30000
}

さらに読む

関連するサンプル

esc

「」に一致する項目はありません。