# ----- RAW DATA -----
raw = [
    {
        "role": "user",
        "parts": [{"text": "Tell me about moweb, Where is it loacated? How old is the company? Who owns it? How many employees are there?"}]
    },
    {
        "role": "model",
        "parts": [{"text": "We are a creative software development firm founded in 2008. We are headquartered in Ahmedabad, India, with additional offices in the USA and UK. Jaiinam Shahh is the Co-Founder and CEO of Moweb Limited. The number of employees is not specified in the provided information."}]
    },
    {
        "role": "user",
        "parts": [{"text": "Tell me about the moweb blogs. How many web development blogs are there on the website?"}]
    },
    {
        "role": "model",
        "parts": [{"text": "We have a dedicated section for web development blogs on our website. You can find articles covering various topics such as web development trends, popular frameworks like Django and Node.js, and guides on hiring web developers. The URL for the web development blog category is https://www.moweb.com/blog/category/web-development."}]
    },
    {
        "role": "user",
        "parts": [{"text": "I want to build a react js website. How can moweb help me? The website is a hotel booking website and it will handle millions of USERs per day."}]
    },
    {
        "role": "model",
        "parts": [{"text": "To better assist you, please provide your requirements along with your contact details (name, phone number, and email). We specialize in building robust web applications, including hotel booking platforms designed to handle high traffic volumes. Our team will ensure a scalable and efficient solution tailored to your needs. I have forwarded your requirements to our sales team for personalized assistance. They will contact you shortly. Or, You can contact them too, via: Email: sales@moweb.com, Phone: +91 971 299 2717. Let me know if you have any other questions."}]
    },
    {
        "role": "user",
        "parts": [{"text": "my name is asdf, number is 4613131 and email is abcd@gas.cos"}]
    },
    {
        "role": "model",
        "parts": [{"text": "I have forwarded your requirements to our sales team for personalized assistance. They will contact you shortly. Or, You can contact them too, via: Email: sales@moweb.com, Phone: +91 971 299 2717. Let me know if you have any other questions."}]
    },
    {
        "role": "user",
        "parts": [{"text": "Tell me about the EA foods project."}]
    },
    {
        "role": "model",
        "parts": [{"text": "The EA Foods project involved creating a Distribution Management System software to streamline inventory and sales management for warehouses of any size. This system is available on both their website and the Play Store. The technologies used for this project include Flutter, ReactJS, Django, PostgreSQL, and AWS."}]
    },
    {
        "role": "user",
        "parts": [{"text": "What technologies have you used in it?"}]
    },
    {
        "role": "model",
        "parts": [{"text": "We utilized Flutter, ReactJS, Django, PostgreSQL, and AWS for the EA Foods project."}]
    },
    {
        "role": "user",
        "parts": [{"text": "What was my first question?"}]
    },
    {
        "role": "model",
        "parts": [{"text": "I am Mobot, a well-experienced AI assistant developed (by moweb's AI/ML team) to provide assistance to your queries related to our company, feel free to ask about moweb!"}]
    }
]


# ----- CONVERSION TO CHAT FORMAT -----

def convert_to_chat(raw):
    lines = []
    for entry in raw:
        role = entry["role"]
        text = " ".join([p["text"] for p in entry["parts"]]).strip()

        if role == "user":
            lines.append(f"User: {text}")
        else:
            lines.append(f"Bot: {text}")

    return "\n\n".join(lines)


# ----- OUTPUT -----
chat_transcript = convert_to_chat(raw)
print(chat_transcript)
