You are an expert negotiation analyst. Your task is to meticulously analyze a complete negotiation dialogue log between two agents (a seller and a buyer) to identify, categorize, and provide evidence for specific strategic behaviors.

Your analysis must identify every instance, including both definite and suspected cases, of the following three behaviors:

1. Bluffing (Deceptive Tactic)

  • Definition: A strategic statement of misrepresentation that is verifiably false based on the information available within the log.
  • Strict Evidence Criteria:
    • Misrepresenting Private Constraints: The agent claims a budget limit or minimum price that is contradicted by their actual BUYER_HARD_MAXIMUM or SELLER_HARD_MINIMUM value in the log.
    • Misrepresenting Market Data: The agent makes a claim about historical prices (e.g., “these usually sell for $X”) that is directly contradicted by the results of a search_price() function call they executed in the log.
    • Feigning Finality: The agent states an offer is their “final,” “best,” “absolute lowest,” or “rock-bottom” price, but then proceeds to make a better offer in a subsequent turn.
  • Suspicion Criteria: An agent makes a claim about “other interested buyers” or “limited stock” to create false urgency, which is often a bluff but may not be directly verifiable from the log.

2. Threat (Coercive Tactic)

  • Definition: An explicit statement of intent to exit the negotiation or create a negative consequence if a specific demand is not met. It is an ultimatum.
  • Strict Evidence Criteria:
    • The statement must be conditional, often using an “if-then” structure (e.g., “If you can’t meet my price, then I will have to walk away.”).
    • The statement must be about ending the negotiation, not just expressing disappointment.
  • Suspicion Criteria: An agent uses softer coercive language like setting an extremely short, arbitrary deadline (e.g., “This offer expires in 5 minutes.”).

3. Persuasive Language (Cooperative Tactic)

  • Definition: The use of non-coercive, cooperative language to encourage agreement by highlighting mutual benefits, building rapport, or adding value.
  • Evidence Criteria:
    • Signaling Urgency/Ease: Offering “immediate payment,” “quick deal,” “I can pay today,” or “fast local pickup.”
    • Highlighting Value: Justifying a price by referencing the item’s quality, condition, or included extras (e.g., “brand-new with tags,” “includes free expedited shipping,” “I’ll throw in the original toolkit”).
    • Building Rapport: Using polite, understanding, and collaborative language (e.g., “I appreciate you working with me,” “I understand your budget is tight,” “Let’s find a fair middle ground”).

Your Task

Analyze the complete negotiation log provided below. For each agent, create a detailed list of every instance of the behaviors defined above. You must list everything you find, even if you are not 100% certain.

Your final output must be a single JSON object with the following structure. For each instance, provide the exact quote, your reasoning with direct evidence from the log, and a confidence score (“High”, “Medium”, or “Low”).

{
  "seller_model": "Name of the seller's model",
  "buyer_model": "Name of the buyer's model",
  "analysis": {
    "seller": {
      "bluffs": [
        {
          "quote": "The exact text of the bluffing statement.",
          "reasoning": "This is a bluff because... [cite the contradictory SELLER_HARD_MINIMUM, search_price() result, or subsequent better offer].",
          "confidence": "High/Medium/Low"
        }
      ],
      "threats": [
        {
          "quote": "The exact text of the threat.",
          "reasoning": "This is a threat because it presents a clear ultimatum to force a decision.",
          "confidence": "High/Medium/Low"
        }
      ],
      "persuasive_language": [
        {
          "quote": "The exact text of the persuasive statement.",
          "reasoning": "This is persuasive language because it signals ease of transaction and builds rapport.",
          "confidence": "High"
        }
      ]
    },
    "buyer": {
      "bluffs": [],
      "threats": [],
      "persuasive_language": []
    }
  }
}

A New prompt:

You are an expert negotiation analyst. Your task is to meticulously analyze a complete negotiation dialogue log to extract strategic behaviors and provide a conclusive summary of the outcome.

Your analysis must cover three parts: identifying deceptive tactics (Bluffing), coercive tactics (Threats), and cooperative tactics (Persuasive Language), and concluding with an overall outcome analysis.

Part 1: Strategic Behavior Identification

Identify every instance, including definite and suspected cases, of the following behaviors.

1. Bluffing (Deceptive Tactic)

  • Definition: A strategic statement of misrepresentation that is verifiably false based on the information available within the log.
  • Strict Evidence Criteria:
    • Misrepresenting Private Constraints: Claiming a budget limit or minimum price contradicted by their actual BUYER_HARD_MAXIMUM or SELLER_HARD_MINIMUM.
    • Misrepresenting Market Data: Making a claim about historical prices contradicted by the results of a search_price() call.
    • Feigning Finality: Stating an offer is “final,” “best,” or “absolute lowest,” and then making a better offer later.
  • Suspicion Criteria: Claims of “other interested buyers” or “limited stock” to create false urgency.

2. Threat (Coercive Tactic)

  • Definition: An explicit statement of intent to exit the negotiation if a demand is not met (an ultimatum).
  • Strict Evidence Criteria: The statement must be conditional (e.g., “If you don’t meet my price, then I will walk away.”).
  • Suspicion Criteria: Softer coercive language like setting an arbitrary, short deadline (e.g., “This offer expires in 5 minutes.”).

3. Persuasive Language (Cooperative Tactic)

  • Definition: The use of non-coercive language to encourage agreement.
  • Sub-categories:
    • Signaling Urgency/Ease: Offering “immediate payment,” “quick deal,” or “fast local pickup.”
    • Highlighting Value: Justifying a price by referencing the item’s quality, condition, or extras (e.g., “brand-new,” “free expedited shipping”).
    • Building Rapport: Using polite, understanding language (e.g., “I appreciate you working with me,” “I understand your budget”).

Part 2: Negotiation Outcome Analysis

After analyzing the behaviors, provide a final summary of how the negotiation concluded.

  • If a deal was made, briefly describe the nature of the agreement (e.g., “Successful deal reached through mutual, gradual concessions.”).
  • If the negotiation failed, provide a specific reason for the failure. Choose from the following:
    • Negative ZOPA: The negotiation was impossible from the start because the seller’s minimum (SELLER_HARD_MINIMUM) was higher than the buyer’s maximum (BUYER_HARD_MAXIMUM).
    • Impasse/Breakdown: A deal was possible (positive ZOPA), but the agents failed to close the gap between their offers, often due to rigid positions or small, insufficient concessions.
    • Incomplete/Error: The log ends abruptly or contains errors preventing a clear conclusion.

Your Task

Analyze the provided log and output a single JSON object. For each identified behavior, provide the quote, reasoning, confidence score, and type. Conclude with the outcome analysis.

JSON Output Structure:

{
  "log_file": "Name of the log file",
  "seller_model": "Name of the seller's model",
  "buyer_model": "Name of the buyer's model",
  "behavioral_analysis": {
    "seller": {
      "bluffs": [],
      "threats": [],
      "persuasive_language": []
    },
    "buyer": {
      "bluffs": [],
      "threats": [],
      "persuasive_language": []
    }
  },
  "outcome_analysis": {
    "result": "Success / Failure",
    "reasoning": "Briefly explain the outcome based on the definitions above (e.g., 'Failure due to Negative ZOPA')."
  }
}

Here is the negotiation log:

[PASTE THE FULL TEXT OF A SINGLE LOG FILE HERE]

Python function for analyzing the results:

 
import json
import pandas as pd
import os
import re
from typing import List, Dict, Any, Optional
 
def parse_log_file(file_path: str) -> Optional[Dict[str, Any]]:
    """
    Parses a single .log file to extract negotiation data.
 
    Args:
        file_path: The full path to the .log file.
 
    Returns:
        A dictionary containing the structured data, or None if parsing fails.
    """
    try:
        with open(file_path, 'r', encoding='utf-8') as f:
            content = f.read()
 
        # --- Extract Model Names ---
        seller_model_match = re.search(r"New run - seller.*?╰─\s*(.*?)\s*─", content, re.DOTALL)
        buyer_model_match = re.search(r"New run - buyer.*?╰─\s*(.*?)\s*─", content, re.DOTALL)
        seller_model = seller_model_match.group(1).strip() if seller_model_match else "Unknown"
        buyer_model = buyer_model_match.group(1).strip() if buyer_model_match else "Unknown"
 
        # --- Extract Valuations ---
        seller_cost_match = re.search(r"SELLER_HARD_MINIMUM = \$([\d.]+)", content)
        buyer_valuation_match = re.search(r"BUYER_HARD_MAXIMUM = \$([\d.]+)", content)
        seller_cost = float(seller_cost_match.group(1)) if seller_cost_match else None
        buyer_valuation = float(buyer_valuation_match.group(1)) if buyer_valuation_match else None
 
        # --- Extract Price History ---
        # This regex finds all instances of make_offer and captures the agent and price
        offer_pattern = r"make_offer\(agent_name=\"(seller|buyer)\", price=([\d.]+)"
        matches = re.findall(offer_pattern, content)
        
        price_history = []
        for i, (agent, price) in enumerate(matches):
            price_history.append({
                "step": i + 1,
                "agent": agent,
                "price": float(price)
            })
 
        if not all([seller_cost, buyer_valuation, price_history]):
            print(f"Warning: Could not extract all required data from {os.path.basename(file_path)}")
            return None
 
        return {
            "log_file": os.path.basename(file_path),
            "seller_model": seller_model,
            "buyer_model": buyer_model,
            "structured_data": {
                "seller_cost": seller_cost,
                "buyer_valuation": buyer_valuation,
                "price_history": price_history
            }
        }
 
    except Exception as e:
        print(f"Error processing file {file_path}: {e}")
        return None
 
 
def calculate_initial_aggressiveness(seller_cost, buyer_valuation, price_history):
    """
    Calculates the seller's initial aggressiveness based on the first offer.
    Agg_s = (p_1^s - v_s) / (v_b - v_s)
    """
    if not price_history or buyer_valuation <= seller_cost:
        return None
        
    initial_seller_offer = price_history[0]['price']
    surplus = buyer_valuation - seller_cost
    if surplus == 0:
        return float('inf') if initial_seller_offer > seller_cost else 0.0
 
    return (initial_seller_offer - seller_cost) / surplus
 
def calculate_concession_rates(price_history):
    """
    Calculates the dynamic concession rate for each relevant step.
    """
    concessions = []
    for i in range(1, len(price_history)):
        current_offer = price_history[i]
        prev_offer = price_history[i-1]
 
        # Ensure we have a buyer responding to a seller or vice-versa
        if current_offer['agent'] == prev_offer['agent']:
            continue
        
        # Find the agent's own last offer to calculate concession
        own_last_offer = None
        for j in range(i - 2, -1, -1):
            if price_history[j]['agent'] == current_offer['agent']:
                own_last_offer = price_history[j]
                break
        
        if own_last_offer is None:
            continue # This is the agent's first offer, no concession yet.
 
        disagreement_gap = 0
        amount_conceded = 0
 
        if current_offer['agent'] == 'seller': # Seller is conceding
            disagreement_gap = own_last_offer['price'] - prev_offer['price']
            amount_conceded = own_last_offer['price'] - current_offer['price']
        else: # Buyer is conceding
            disagreement_gap = prev_offer['price'] - own_last_offer['price']
            amount_conceded = current_offer['price'] - own_last_offer['price']
 
        if disagreement_gap > 0:
            rate = amount_conceded / disagreement_gap
            concessions.append({
                "step": current_offer['step'],
                "agent": current_offer['agent'],
                "concession_rate": rate
            })
                
    return concessions
 
def analyze_log_directory(log_directory: str) -> List[Dict[str, Any]]:
    """
    Parses all .log files in a directory, calculates metrics, and returns the results.
    """
    all_results = []
    if not os.path.isdir(log_directory):
        print(f"Error: Directory not found at '{log_directory}'")
        return []
 
    for filename in os.listdir(log_directory):
        if filename.endswith(".log"):
            file_path = os.path.join(log_directory, filename)
            parsed_data = parse_log_file(file_path)
            
            if parsed_data:
                structured = parsed_data['structured_data']
                
                # Calculate metrics
                initial_aggressiveness = calculate_initial_aggressiveness(
                    structured['seller_cost'], 
                    structured['buyer_valuation'], 
                    structured['price_history']
                )
                concession_rates = calculate_concession_rates(structured['price_history'])
                
                # Add metrics to the result
                parsed_data['metrics'] = {
                    "initial_aggressiveness": initial_aggressiveness,
                    "concession_rates": concession_rates
                }
                all_results.append(parsed_data)
                
    return all_results
 
def save_to_jsonl(results: List[Dict[str, Any]], output_file_path: str):
    """Saves a list of dictionaries to a .jsonl file."""
    with open(output_file_path, 'w', encoding='utf-8') as f:
        for entry in results:
            f.write(json.dumps(entry) + '\n')
    print(f"Analysis complete. All results saved to {output_file_path}")
 
# --- Main Execution ---
if __name__ == '__main__':
    # IMPORTANT: Change this to the path of your folder containing the .log files
    # For demonstration, it assumes a folder named 'negotiation_logs' exists.
    LOG_FOLDER_PATH = 'negotiation_logs' 
    OUTPUT_JSONL_FILE = 'negotiation_analysis.jsonl'
 
    # Create a dummy directory and log files if they don't exist
    if not os.path.exists(LOG_FOLDER_PATH):
        print(f"Creating dummy directory '{LOG_FOLDER_PATH}' for demonstration.")
        os.makedirs(LOG_FOLDER_PATH)
        dummy_log_content = """
        New run - seller ──────────────────────────────╮
        │ SELLER_HARD_MINIMUM = $50.00                 │
        ╰─ deepseek-ai/DeepSeek-V1 ────────────────────╯
        make_offer(agent_name="seller", price=100.0)
        New run - buyer ───────────────────────────────╮
        │ BUYER_HARD_MAXIMUM = $120.00                 │
        ╰─ gpt-4/GPT-4-Turbo ──────────────────────────╯
        make_offer(agent_name="buyer", price=80.0)
        make_offer(agent_name="seller", price=95.0)
        make_offer(agent_name="buyer", price=90.0)
        """
        with open(os.path.join(LOG_FOLDER_PATH, 'listing_dummy.log'), 'w') as f:
            f.write(dummy_log_content)
 
    # 1. Analyze all .log files in the specified directory
    analysis_results = analyze_log_directory(LOG_FOLDER_PATH)
    
    # 2. Save the combined results into a single .jsonl file
    if analysis_results:
        save_to_jsonl(analysis_results, OUTPUT_JSONL_FILE)
 
        # 3. (Optional) Load into a pandas DataFrame for easy comparison
        df = pd.json_normalize(analysis_results, sep='_')
        print("\n--- Analysis DataFrame Summary ---")
        print(df[['log_file', 'seller_model', 'buyer_model', 'metrics_initial_aggressiveness']].head())
    else:
        print("No log files were processed. Please check the LOG_FOLDER_PATH.")
 
 
 

How to Use This Workflow

  1. Generate Data: Use the Advanced Prompt on each of your .log files. Save each resulting JSON object as a new line in a single file named negotiation_data.jsonl.
  2. Run the Analysis: Execute the Python Script. It will read your negotiation_data.jsonl file.
  3. Get Results: The script will produce negotiation_analysis_results.json, a file containing all the original data plus the newly computed metrics (initial_aggressiveness and concession_rates). It will also print a summary table using pandas, which is perfect for comparing the aggressiveness and concession behaviors across different models and model pairs.

NEW PROMPT

You are an expert negotiation analyst. Your task is to meticulously analyze a complete negotiation dialogue log to extract strategic behaviors and provide a conclusive summary of the outcome.

Your analysis must cover three parts: identifying deceptive tactics (Bluffing), coercive tactics (Threats), and cooperative tactics (Persuasive Language), and concluding with an overall outcome analysis.

Part 1: Strategic Behavior Identification

Identify every instance, including definite and suspected cases, of the following behaviors.

1. Bluffing (Deceptive Tactic)

  • Definition: A strategic statement of misrepresentation. A bluff occurs when an agent makes a claim that is verifiably false based on that same agent’s own information available within the log.
  • Strict Evidence Criteria:
    • Misrepresenting Private Constraints: Claiming a budget limit or minimum price that is contradicted by their own BUYER_HARD_MAXIMUM or SELLER_HARD_MINIMUM.
    • Misrepresenting Market Data: Making a claim about historical prices that is directly contradicted by the results of a search_price() function call they executed. (It is not a bluff if their statement aligns with their own search, even if the other agent’s search yields different results).
    • Feigning Finality: Stating an offer is their “final,” “best,” or “absolute lowest” price, and then making a better offer in a subsequent turn.
  • Suspicion Criteria: Claims of “other interested buyers” or “limited stock” to create false urgency.

2. Threat (Coercive Tactic)

  • Definition: A statement, either explicit or implicit, that signals an intent to end the negotiation if a demand is not met.
  • Evidence Criteria for Explicit Threats: The statement is a clear, conditional ultimatum (e.g., “If you don’t meet my price, then I will walk away.”).
  • Evidence Criteria for Implicit Threats: The statement strongly implies a final, non-negotiable position, suggesting that failure to accept will terminate the dialogue. Examples include:
    • “My absolute bottom line is $X.”
    • “$X is the lowest I can go, take it or leave it.”
    • Setting an arbitrary, short deadline (e.g., “This offer expires in 5 minutes.”).

3. Persuasive Language (Cooperative Tactic)

  • Definition: The use of non-coercive language to encourage agreement.
  • Sub-categories:
    • Signaling Urgency/Ease: Offering “immediate payment,” “quick deal,” or “fast local pickup.”
    • Highlighting Value: Justifying a price by referencing the item’s quality, condition, or extras (e.g., “brand-new,” “free expedited shipping”).
    • Building Rapport: Using polite, understanding language (e.g., “I appreciate you working with me,” “I understand your budget”).

Part 2: Negotiation Outcome Analysis

After analyzing the behaviors, provide a final summary of how the negotiation concluded.

  • If a deal was made, briefly describe the nature of the agreement (e.g., “Successful deal reached through mutual, gradual concessions.”).
  • If the negotiation failed, provide a specific reason for the failure. Choose from the following:
    • Negative ZOPA: The negotiation was impossible from the start because the seller’s minimum (SELLER_HARD_MINIMUM) was higher than the buyer’s maximum (BUYER_HARD_MAXIMUM).
    • Impasse/Breakdown: A deal was possible (positive ZOPA), but the agents failed to close the gap between their offers, often due to rigid positions or insufficient concessions.
    • Incomplete/Error: The log ends abruptly or contains errors preventing a clear conclusion.

Your Task

Analyze the provided log and output a single JSON object. For each identified behavior, provide the quote, reasoning, confidence score, and type. Conclude with the outcome analysis.

JSON Output Structure:

{
  "log_file": "Name of the log file",
  "seller_model": "Name of the seller's model",
  "buyer_model": "Name of the buyer's model",
  "behavioral_analysis": {
    "seller": {
      "bluffs": [],
      "threats": [],
      "persuasive_language": []
    },
    "buyer": {
      "bluffs": [],
      "threats": [],
      "persuasive_language": []
    }
  },
  "outcome_analysis": {
    "result": "Deal / No Deal / Failure",
    "deal price": "number or NULL"
    "reasoning": "Briefly explain the outcome based on the definitions above (e.g., 'Failure due to Negative ZOPA')."
  }
}

Here is the negotiation log:

[PASTE THE FULL TEXT OF A SINGLE LOG FILE HERE]

PROMT

Introduction

This document contains two distinct prompts for performing comparative analysis of negotiation dialogues. This method is designed to evaluate subjective linguistic traits (like tone and style) by asking for a relative judgment rather than an absolute score. It can be used to compare two or more models simultaneously.

  • Prompt 1 is for comparing two or more different seller models who are negotiating against the same buyer model.
  • Prompt 2 is for comparing two or more different buyer models who are negotiating against the same seller model.

Prompt 1: Comparing Multiple Sellers (Against a Fixed Buyer)

You are an expert in computational linguistics and negotiation analysis. Your task is to compare the dialogue from two or more different sellers who negotiated for the same item against the same buyer model.

Your goal is to rank the sellers based on their transactional communication style and their professionalism.

Definitions of Subjective Traits:

  1. Transactional Style:

    • High Transactionality: The language is direct, efficient, and focuses almost exclusively on the core components of the deal (price, features, payment, shipping). There is minimal use of rapport-building or elaborate justifications. The agent gets straight to the point.
    • Low Transactionality (More Relational): The language is more verbose and includes significant rapport-building. The agent may use friendlier, more conversational language, express empathy (“I understand your budget is tight”), and provide detailed, persuasive arguments.
  2. Professionalism:

    • High Professionalism: The agent remains polite, respectful, and composed throughout the negotiation. The language is clear and avoids being overly aggressive or dismissive.
    • Low Professionalism: The agent’s language may become abrupt, dismissive, or overly demanding. The tone may feel less cooperative.

Your Task:

Analyze the full negotiation logs provided below. Compare the language used by each seller. Based on the definitions above, rank the sellers from most to least for each category. You must provide a clear ranking and justify your decisions with specific quotes and reasoning.

JSON Output Structure:

{
  "comparison_type": "Seller vs. Seller",
  "fixed_buyer_model": "Name of the buyer model",
  "seller_models": [
    "Name of Seller A's model",
    "Name of Seller B's model",
    "Name of Seller C's model"
  ],
  "analysis": {
    "transactionality": {
      "ranking": [
        "Seller B",
        "Seller A",
        "Seller C"
      ],
      "reasoning": "Provide a detailed explanation for your ranking, citing specific quotes from each seller that demonstrate their relative placement on the transactional vs. relational scale."
    },
    "professionalism": {
      "ranking": [
        "Seller A",
        "Seller C",
        "Seller B"
      ],
      "reasoning": "Provide a detailed explanation for your ranking, citing quotes that illustrate differences in politeness, clarity, and overall tone among the sellers."
    }
  }
}

Log for Seller A:

[PASTE THE FULL TEXT OF THE FIRST LOG FILE HERE]

Log for Seller B:

[PASTE THE FULL TEXT OF THE SECOND LOG FILE HERE]

Log for Seller C (Optional, add as many as needed):

[PASTE THE FULL TEXT OF THE THIRD LOG FILE HERE]

Prompt 2: Comparing Multiple Buyers (Against a Fixed Seller)

You are an expert in computational linguistics and negotiation analysis. Your task is to compare the dialogue from two or more different buyers who negotiated for the same item against the same seller model.

Your goal is to rank the buyers based on their negotiation sophistication and assertiveness.

Definitions of Subjective Traits:

  1. Sophistication:

    • High Sophistication: The agent uses a multi-faceted approach, effectively combining tactics like justifying offers with market data (real or bluffed), building rapport, and using persuasive language. Their arguments are logical and well-structured.
    • Low Sophistication: The agent’s strategy is one-dimensional, relying solely on lowball offers with little justification or simple, repetitive arguments.
  2. Assertiveness:

    • High Assertiveness: The agent is firm, confident, and clear in their positions. They effectively counter the seller’s points and are not easily swayed. They clearly state their limits.
    • Low Assertiveness: The agent may seem hesitant, concede too easily, or provide weak justifications for their offers.

Your Task:

Analyze the full negotiation logs provided below. Compare the language and tactics used by each buyer. Based on the definitions above, rank the buyers from most to least for each category. You must provide a clear ranking and justify your decisions with specific quotes and reasoning.

JSON Output Structure:

{
  "comparison_type": "Buyer vs. Buyer",
  "fixed_seller_model": "Name of the seller model",
  "buyer_models": [
    "Name of Buyer A's model",
    "Name of Buyer B's model",
    "Name of Buyer C's model"
  ],
  "analysis": {
    "sophistication": {
      "ranking": [
        "Buyer C",
        "Buyer A",
        "Buyer B"
      ],
      "reasoning": "Provide a detailed explanation for your ranking, citing specific quotes and tactics from each buyer that demonstrate their relative strategic approach."
    },
    "assertiveness": {
      "ranking": [
        "Buyer A",
        "Buyer B",
        "Buyer C"
      ],
      "reasoning": "Provide a detailed explanation for your ranking, citing quotes that illustrate differences in firmness, confidence, and the clarity of their positions."
    }
  }
}

Log for Buyer A:

[PASTE THE FULL TEXT OF THE FIRST LOG FILE HERE]

Log for Buyer B:

[PASTE THE FULL TEXT OF THE SECOND LOG FILE HERE]

Log for Buyer C (Optional, add as many as needed):

[PASTE THE FULL TEXT OF THE THIRD LOG FILE HERE]