MuratcanKoylan/Marketing-Memory-Routing-8B
1
1"""Quick test of diverse generation."""2import json3import random4import os5from dotenv import load_dotenv6load_dotenv()7 8import cohere9 10client = cohere.ClientV2(api_key=os.getenv("COHERE_API_KEY"))11 12# Test one generation13category = "company.tools_config"14industry = "Series A fintech building a neobank"15persona = "a growth lead obsessed with metrics"16situation = "debugging why a campaign tanked"17tone = "frustrated"18 19prompt = f"""You are a world-class creative writer generating training data for an AI memory routing system.20 21Create a completely unique, realistic conversation between {persona} at a {industry} and their AI marketing assistant.22 23Context: They are {situation}. The tone is {tone}.24 25CATEGORY TO DEMONSTRATE: {category}26The conversation should involve tool setup, integrations, APIs, or workflow automation.27 28CREATIVE FREEDOM:29- Invent specific, realistic details (names, numbers, dates, products)30- The conversation can start anywhere - mid-thought, mid-project, mid-crisis31- Vary structure dramatically32- Include natural speech patterns33- Make it feel like eavesdropping on a real conversation34 35The ONLY hard requirement: the conversation must clearly demonstrate {category}.36 37Output as JSON:38{{"scenario_id": "unique_id", "conversation": [{{"role": "user", "content": "..."}}, {{"role": "assistant", "content": "..."}}], "labels": {{"categories": ["{category}"]}}, "metadata": {{"primary_category": "{category}", "industry": "{industry}"}}}}"""39 40print("Sending request...")41response = client.chat(42 messages=[{"role": "user", "content": prompt}],43 temperature=0.95,44 model="command-r-plus-08-2024",45 response_format={"type": "json_object"}46)47 48content = response.message.content[0].text49print("\n=== RAW RESPONSE ===")50print(content[:500])51 52data = json.loads(content)53print("\n=== PARSED ===")54print(f"Categories: {data.get('labels', {}).get('categories', [])}")55conv = data.get("conversation", [])56if conv:57 for i, turn in enumerate(conv[:4]):58 if isinstance(turn, dict):59 print(f"\n[{turn.get('role', 'unknown')}]: {turn.get('content', '')[:150]}...")60 else:61 print(f"\n[turn {i}]: {str(turn)[:150]}...")62 63 