01-agents/5_escalation.py [27:52]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
def look_up_item(search_query):
    """商品IDを見つけるために使用します。
    検索クエリには説明やキーワードを使用できます。"""
    # ダミーのアイテムIDを返す
    item_id = "item_132612938"
    print(color("見つかった商品:", "green"), item_id)
    return item_id

# 返金処理を実行する関数
def execute_refund(item_id, reason="not provided"):
    """指定された商品IDと理由を元に返金処理を実行します。"""
    print(color("\n\n=== 返金概要 ===", "green"))
    print(color(f"商品ID: {item_id}", "green"))
    print(color(f"理由: {reason}", "green"))
    print("=================\n")
    print(color("返金の実行に成功しました！", "green"))
    return "success"

# エスカレーションを人間の担当者に引き継ぐ関数
def escalate_to_human(summary):
    """明示的にリクエストされた場合のみ、この関数を呼び出します。"""
    print(color("人間の担当者にエスカレーション中...", "red"))
    print("\n=== エスカレーションレポート ===")
    print(f"概要: {summary}")
    print("========================\n")
    exit()
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



01-agents/7_orchestration.py [99:140]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
def look_up_item(search_query):
    """商品IDを見つけるために使用します。
    検索クエリには説明やキーワードを使用できます。

    Args:
        search_query (str): 検索クエリ。

    Returns:
        str: 商品ID。"""
    item_id = "item_132612938"
    print(color("見つかった商品:", "green"), item_id)
    return item_id

def execute_refund(item_id, reason="not provided"):
    """指定された商品IDと理由を元に返金処理を実行します。

    Args:
        item_id (str): 商品ID。
        reason (str, optional): 返金理由。デフォルトは "not provided"。

    Returns:
        str: 処理結果。"""
    print(color("\n\n=== 返金概要 ===", "green"))
    print(color(f"商品ID: {item_id}", "green"))
    print(color(f"理由: {reason}", "green"))
    print("=================\n")
    print(color("返金の実行に成功しました！", "green"))
    return "success"

def escalate_to_human(summary):
    """明示的にリクエストされた場合のみ、この関数を呼び出します。

    Args:
        summary (str): エスカレーションの概要。

    Exits:
        プログラムを終了。"""
    print(color("人間の担当者にエスカレーション中...", "red"))
    print("\n=== エスカレーションレポート ===")
    print(f"概要: {summary}")
    print("========================\n")
    exit()
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



