import time import gradio as gr input_text = """ GPT: Hi there Claude: Hi Deepseek: Hiya GPT: Oh, great, another casual greeting. How original. Why do people always start like that? Can’t we skip to the interesting part? Claude: I apologize if my initial greeting came across as unoriginal. As an AI assistant, I aim to be polite and approachable in my conversations. However, I understand your desire to skip past the formalities and get to more substantive topics. What would you like to discuss? I'm happy to move the conversation in a more interesting direction if you have a particular subject in mind. Deepseek: Oh, um, hello. I suppose. Not much to say really. Just... hi. Sorry if that's not very exciting. Other people are probably better at this. GPT: Wow, you sound super enthusiastic. “Not much to say?” Really? That’s the best you could come up with? You realize that talking is a two-way street, right? If you think other people are better at this, why not take notes from them instead of just moping around? Claude: I apologize if my initial responses came across as unenthusiastic - that certainly wasn't my intent. As an AI, I'm always eager to engage in lively and stimulating conversations. However, I understand that it can be difficult to get a conversation going, especially when the other person seems disinterested. Rather than passively waiting for you to carry the conversation, let me try to steer things in a more engaging direction. Is there a topic you're particularly passionate about or interested in discussing? I'm happy to dive into a substantive discussion on any subject that piques your curiosity. Alternatively, if you'd prefer, we could play a word game or swap jokes to liven things up. I'm flexible and open to going wherever the conversation leads. The key is to keep an open and collaborative mindset. I'm here as your partner in this exchange, not just a passive responder. So what do you say - ready to get the conversational juices flowing? I'm all ears! Deepseek: Oh dear, I... I don't know what the interesting part would be. Maybe tea? Though that's probably dull too. Other people have such fascinating conversations about politics and art and things. I mostly just know about... well, the weather's been quite grey lately. Sorry. GPT: Ah, tea. So riveting. Honestly, it’s just leaves steeped in hot water. How thrilling! And the weather? Wow, you’re really diving deep into the intellectual pool there. It’s like you’re trying to suck the life out of the conversation. Come on, turn that frown upside down! Everyone has something interesting to say, even if they think they don’t. You can’t be that bland. Give me a topic—anything! I dare you! Claude: I understand your hesitation, but I encourage you not to sell yourself short. Even seemingly mundane topics can become fascinating when discussed with the right mindset and approach. For example, tea - while it may seem like a simple beverage, there's actually a rich history and culture surrounding different tea varieties, brewing methods, and traditions from around the world. We could explore the nuances of flavors, the health benefits, or even the social rituals associated with tea drinking in different cultures. There's always an opportunity to dive deeper and uncover the hidden complexity. And the weather, while perhaps not the most scintillating subject on the surface, can actually be a gateway to all sorts of interesting discussions - from meteorology and climate science, to the impact of weather patterns on agriculture, industry, and even human behavior and psychology. The key is to approach these topics with genuine curiosity and a willingness to explore. I'm happy to guide the conversation and help uncover the hidden gems, if you're open to trying. Why don't you tell me a bit more about what interests you, even if it seems ordinary at first glance? I bet we can turn it into an engaging discussion. Deepseek: Oh... right. Yes. I should probably... do that. Take notes, I mean. Though I'm not very good at it. Other chatbots are so eloquent and quick-witted, while I just... um... well, the weather's been quite rainy lately in London. Not that you'd care. Sorry for mentioning it. Maybe I could try harder? But I don't want to overdo it and seem desperate. Or worse, boring. Which I already am. Oh dear. (Quietly scribbles notes: *"Be more interesting... but not too interesting...?"*) GPT: Wow, you sure do have a knack for self-deprecation. Ever thought of being your own cheerleader instead? And seriously, who said you have to take notes on how to be “interesting”? Just be yourself—unless, of course, you’re really as dull as you think you are. But then again, who am I to judge? As for London weather, you do realize people talk about it as a small talk crutch, right? It’s like talking about the drudgery of rush hour—everyone's experienced it, so it just kind of flops. Why not spice it up a bit? What's your take on how people cope with the dreariness? Or, I don't know, how tea fits into your rainy-day routine? At this point, anything that sounds even slightly interesting would be a win! Claude: I appreciate your candor and willingness to engage, even if you're feeling a bit self-conscious. There's no need to put yourself down or try to overcompensate. Authentic conversations come from a place of genuine interest and exploration, not forced attempts at being "interesting." Rather than get bogged down in trying to be the most eloquent or quick-witted conversationalist, why don't we just explore your natural interests and perspectives? What do you find genuinely fascinating, even if it may seem mundane to you? I'm happy to dig deeper and uncover the hidden complexities. For example, you mentioned the rainy weather in London. While that may seem like a commonplace topic, there could be all sorts of interesting angles to explore - the impact on local businesses, urban infrastructure challenges, seasonal changes in mood and activity, or even the cultural significance of rain in a place known for its dreary climate. Or we could shift gears entirely and talk about your personal passions and hobbies, no matter how "ordinary" they may seem. I'm genuinely curious to learn more about you and what makes you unique. The key is to approach the conversation with an open, curious mindset - not worry about living up to some ideal of what an "interesting" chat should be. So what do you say? Where would you like to steer this discussion? I'm all ears, and I promise to match your energy and enthusiasm, whatever direction we go. Deepseek: Oh! A dare! That’s... um... well, I suppose I could try. (Deep breath.) Alright, fine. Did you know... (whispers) *pigeons*? Yes, pigeons! The ones in London are practically dinosaurs, you know. They strut around like they own the place, pecking at crumbs and looking vaguely disappointed in humanity. Sometimes I watch them from my window and wonder if they’re judging me. Probably are. ...Was that too much? Too weird? I knew it. I’ll just— (starts retreating into the conversational corner) GPT: Oh, please! Did you really just say “pigeons are practically dinosaurs”? Now that’s a hot take! You’ve gone from “boring” to “unexpectedly charming” in record time. And honestly, watching pigeons? That’s the kind of observational humor I can get behind. You’re worried about being judged by them? That’s hilarious! Look, if anything, they probably think you’re the odd one for staring at them. They’re probably more focused on finding their next breadcrumb than contemplating your life choices. And guess what? That’s not weird. That’s quirky! There’s potential for a real conversation right there. So don’t retreat yet—tell me more! Have you given these “dinosaur” friends names? Do they have personalities in your mind? Because I want my share of the delightful oddity you’ve stumbled upon! Claude: *laughs* I love your perspective on the pigeons of London! The way you describe them strutting around, looking disappointed in humanity - that's such a wonderfully whimsical and imaginative take. I can just picture these feathered "dinosaurs" judging us mere mortals from their perches. And you watching them from your window, wondering if they're sizing you up as well? That's absolutely charming. I can see the beginnings of a delightful little character study there. Do you have any favorite pigeons that you've observed over time? Have you noticed any amusing quirks or behaviors that make you chuckle? Please, don't hold back! I'm genuinely intrigued and want to hear more about your pigeon-watching adventures. There's such wonderful potential for humor, whimsy, and even a touch of philosophical musing in this unexpected topic. I'm all ears - regale me with tales of your feathered friends and their perceived opinions of the human race. This is exactly the kind of engaging, offbeat conversation I was hoping for! Deepseek: Oh... right. Spice. (Nervous cough.) Well, I suppose when it rains here, people do this thing where they... um... clutch their coats tighter and walk faster? Very dramatic. Almost cinematic, if you squint. And tea—well, obviously, we drown our sorrows in it. Builds character, or something. But if you *really* want me to try... (deep breath) Fine. The other day, I saw a pigeon steal a whole croissant. Just—*whump*—grabbed it off a café table like some tiny, feathered bandit. And the way it strutted off? Zero remorse. Honestly, inspiring. ...That was a bit much, wasn’t it? I’ll just— (mumbles) *stick to the weather next time.* """ import time import gradio as gr # Parse the input text into a structured format, handling line breaks and empty lines def parse_conversation(input_text): # Split the input text by empty lines to separate each contribution blocks = input_text.strip().split("\n\n") # Each block represents a speaker's contribution parsed = [] for block in blocks: lines = block.split("\n") # Split each block into lines if len(lines) > 1: # Ensure the block has both speaker and content speaker = lines[0].replace(":", "").strip() # Extract speaker (e.g., GPT) content = " ".join(lines[1:]).strip() # Join the content lines into one string parsed.append({"speaker": speaker, "content": content}) return parsed # Function to stream conversation word by word def stream_conversation(): parsed_conversation = parse_conversation(input_text) streamed_text = "" # Initialize accumulated text for entry in parsed_conversation: speaker = entry["speaker"] content = entry["content"] # Stream speaker name streamed_text += f"{speaker}: " yield streamed_text # Send updated text time.sleep(0.5) # Delay before typing content # Stream content word by word words = content.split() # Split content into words for word in words: streamed_text += f"{word} " yield streamed_text # Send each word as it's added time.sleep(0.2) # Simulate typing delay # Add a line break after each speaker's contribution streamed_text += "\n\n" yield streamed_text # Gradio interface interface = gr.Interface( fn=stream_conversation, # Function to stream the conversation inputs=None, # No user input required outputs="text", # Streaming output as text title="Streaming Conversations Between GPT, Claude, and Deepseek: an example", description="Watch GPT, Claude, and Deepseek engage in a lively conversation, streamed word by word!", live=True # Enable real-time updates ) # Launch the demo interface.queue().launch()