File size: 2,084 Bytes
685d968
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
"""Quick test of diverse generation with high temperature."""
import json
import random
import os
from dotenv import load_dotenv
load_dotenv()

import cohere

client = cohere.ClientV2(api_key=os.getenv("COHERE_API_KEY"))

INDUSTRIES = ["fintech startup", "healthcare SaaS", "e-commerce fashion"]
STARTERS = ["So about", "Following up on", "I've been thinking about"]

# Test 3 different categories with HIGH temperature
test_cases = [
    ("company.tools_config", "fintech startup", "growth hacker"),
    ("user.communication_style", "healthcare SaaS", "CMO"),
    ("none", "e-commerce fashion", "marketing manager")
]

for category, industry, role in test_cases:
    starter = random.choice(STARTERS)
    turns = random.randint(3, 6)
    
    if category == "none":
        prompt = f"""Create a UNMEMORABLE conversation between a {role} at a {industry} and AI.
Purely transactional - status check, scheduling, confirmation. NO specific details.
{turns} turns. Start with "{starter}..."
Return JSON: {{"conversation": [...], "labels": {{"categories": ["none"]}}}}"""
    else:
        prompt = f"""Create a marketing conversation for a {role} at a {industry}.
Must demonstrate: {category}
{turns} turns. Start with "{starter}..."
Be SPECIFIC with realistic details unique to {industry}.
Return JSON: {{"conversation": [...], "labels": {{"categories": ["{category}"]}}}}"""

    response = client.chat(
        messages=[{"role": "user", "content": prompt}],
        temperature=0.95,
        model="command-r-plus-08-2024",
        response_format={"type": "json_object"}
    )
    
    content = response.message.content[0].text
    data = json.loads(content)
    
    print(f"\n{'='*60}")
    print(f"Category: {category} | Industry: {industry}")
    print(f"Output categories: {data.get('labels', {}).get('categories', [])}")
    conv = data.get("conversation", [])
    if conv:
        first = conv[0]
        if isinstance(first, dict):
            print(f"First turn: {first.get('content', '')[:120]}...")
        else:
            print(f"First turn: {str(first)[:120]}...")