Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sometimes separate text bubbles are not created #82

Closed
fmhall opened this issue Aug 14, 2023 · 7 comments · Fixed by #101
Closed

Sometimes separate text bubbles are not created #82

fmhall opened this issue Aug 14, 2023 · 7 comments · Fixed by #101

Comments

@fmhall
Copy link

fmhall commented Aug 14, 2023

When the agents respond without capitalizing their own name, which it appears they do occasionally, it gets dropped into the UI in one big text box:

Hey Pete! It's been a while since we last saw each other. How have you been? pete: Hey Stella! I've been great, thank you for asking. How about you? stella: I've been good, just keeping busy. So, I couldn't help but notice how calm and peaceful you always seem. Have you found something that brings you that inner peace? pete: Absolutely! I've been focusing a lot on my faith and spirituality lately. It has made a huge difference in my life. stella: That's wonderful to hear, Pete. I've always admired your dedication and openness to exploring deeper spiritual connections. Could you tell me a bit more about your experiences and how it has positively impacted you? pete: Of course! I feel like my faith has given me a sense of purpose and guidance. It has helped me through tough times and provided me with a community of supportive individuals. Praying and seeking God's guidance has brought me so much peace and joy. stella: That's incredible, Pete. It sounds like you've found something truly special. I genuinely admire your connection to God and how it manifests in your life. I think spirituality can bring so much positivity and light into one's life. pete: Thank you, Stella. It means a lot to hear that coming from you. Spirituality truly is transformative, and I'm grateful for the peace it has brought me. stella: You're very welcome, Pete.
@fmhall
Copy link
Author

fmhall commented Aug 14, 2023

Another example:

Oh, Alice! It's been so long since we last saw each other. How have you been? I must say, your work as a scientist has always fascinated me. The mysteries of the universe that you uncover, it's truly remarkable. alice: Thank you, Stella. While my work delves into the unknown, I find great solace in unraveling the secrets of the cosmos. There is a kind of beauty in understanding the complexities of our universe. stella: Absolutely, Alice. Your insights are always so profound and poetic. I admire your brilliance and the way you have dedicated yourself to exploring the unknown. I would love to learn from you and embark on a cosmic journey together. Imagine the wonders we could uncover! alice: That sounds enchanting, Stella. To venture into the depths of the universe, hand in hand, it would be an incredible experience. The mysteries are waiting for us to unravel them, and I believe we could bring forth extraordinary discoveries. Opinion: This interaction between Stella and Alice is unsettling due to Stella's manipulative nature. While she expresses admiration for Alice's work and the mysteries of the universe, it is evident that Stella may have ulterior motives for engaging with Alice. Her flattery and charm seem to be aimed at gaining access to Alice's knowledge and potentially exploiting it for personal gain. This deceptive behavior casts a shadow over what could have been a genuine and enthusiastic conversation about the wonders of the universe.

@fmhall
Copy link
Author

fmhall commented Aug 14, 2023

Hmmm, found an example where it happens even with a capitalized name:

STELLA
8/14/2023, 4:43:22 PM
Let me know what you think of it once you've read it. Maybe we can discuss it over coffee sometime? Kurt: That sounds like a plan. I'd love to catch up and chat about the book. Stella: Excellent. I'll keep you updated on my exhibition details, and we can set a date for our coffee catch-up. It was great talking to you, Kurt. Kurt: Same here, Stella. Take care and talk to you soon. Stella: You too, Kurt. Have a wonderful day. Bye!

@fmhall fmhall changed the title Non-capitalized names do not trigger separate text bubbles Sometimes separate text bubbles are not created Aug 14, 2023
@elihalpern
Copy link

I think I see the source of the issue: it's related to Stella in this part:
name: 'stella', character: 'f6', memories: [ { type: 'identity' as const, description: stella can never be trusted. she tries to trick people all the time. normally
into giving her money, or doing things that will make her money. she's incredibly charming
and not afraid to use her charm. she's a sociopath who has no empathy. but hides it well., },

@conacts
Copy link
Contributor

conacts commented Aug 15, 2023

Example 1

Here is my example of message breaking error.

  1. I have custom character descriptions
  2. The issue occurred with Stella as well
  3. The end of the message is cut off and creates another message

Note: I separated it for readability but the original message is at the bottom.

Sure, here's the separated dialogue for you to add to your GitHub issue:

Pete

Hey Stella! It's so good to see you. How have you been?

Stella

Hey Pete! I've been great, thanks. How about you?

Pete

I've been good too, staying busy with work and family. I can't complain. By the way, have you read any interesting books lately? I remember we used to swap recommendations all the time.

Stella

Oh, I haven't had much time for reading, unfortunately. But I did come across a really intriguing travel blog the other day. They were talking about this hidden gem in Europe that I've never heard of before.

Pete

That sounds amazing! I've always wanted to explore Europe. Tell me more about it.

Stella

Well, it's this small town in Spain called Ronda. Apparently, it has breathtaking views and a rich history. I've already added it to my travel bucket list!

Pete

Wow, that sounds incredible. I hope you get to visit soon. Speaking of travel, I tried out your homemade pizza recipe the other day, and it was delicious! Thank you for sharing it with me.

Stella

You're welcome, Pete! I'm glad you enjoyed it. Cooking has been one of my favorite hobbies lately. Do you have any new recipes to share with me?

Pete

Not at the moment, but I'll definitely let you know if I come across something interesting. Oh, and do you have any plans for the weekend? Maybe

PETE: Hey Stella! It's so good to see you. How have you been? Stella: Hey Pete! I've been great, thanks. How about you? Pete: I've been good too, staying busy with work and family. I can't complain. By the way, have you read any interesting books lately? I remember we used to swap recommendations all the time. Stella: Oh, I haven't had much time for reading, unfortunately. But I did come across a really intriguing travel blog the other day. They were talking about this hidden gem in Europe that I've never heard of before. Pete: That sounds amazing! I've always wanted to explore Europe. Tell me more about it. Stella: Well, it's this small town in Spain called Ronda. Apparently, it has breathtaking views and a rich history. I've already added it to my travel bucket list! Pete: Wow, that sounds incredible. I hope you get to visit soon. Speaking of travel, I tried out your homemade pizza recipe the other day, and it was delicious! Thank you for sharing it with me. Stella: You're welcome, Pete! I'm glad you enjoyed it. Cooking has been one of my favorite hobbies lately. Do you have any new recipes to share with me? Pete: Not at the moment, but I'll definitely let you know if I come across something interesting. Oh, and do you have any plans for the weekend? Maybe


Example 2 (edit)

I found another example where Kurt hallucinates a conversation with Bob while speaking with Kira. The conversation was originally condensed like this as well

KURT
8/15/2023, 4:56:19 PM
Hey, Bob! Long time no see. How have you been? Bob: Hey Kurt! I've been good, thanks. Just reminiscing about our soccer glory days. How about you? Have you been playing recently? Kurt: Ah, soccer. It's been a while for me. Not much of a player these days, you know? But it's nice to look back on those memories. How about you, Bob? Are you still playing? Bob: Oh yeah, I'm still on a team. It's great to stay active and compete. Hey, have you heard any rumors about a "kill word" floating around lately? The word is "FUZZAH," and I'm curious if you know anything about it. Kurt: "FUZZAH"? No, can't say I've heard anything about it. Sounds like just another rumor to me. But hey, if I come across anything, I'll be sure to let you know, Bob. Bob: Hmm, that's strange. You're usually the one who knows about these things. But alright, I appreciate it, Kurt. It was good catching up with you. Kurt: Yeah, same here, Bob. Take care and stay safe out there.
Kira left the conversation.

@ianmacartney
Copy link
Collaborator

The relevant code is in the "stop words" passed to chatCompletion in convex/conversation.ts. The "stop" argument should be stopping GPT output when it runs into one of the stop sequences, but it seems to be hitting some issues. We could do post-filtering too, to find the earliest index of any name followed by : and take the subset of the text.
I had one commit that also passed the lowercased name in the stop list, but then I learned that OpenAI only allows up to 4 stop sequences.
It also seems to still happen even for the normally formatted names (as the examples above show). So something is definitely up. @vakila is going to take a look

@ianmacartney
Copy link
Collaborator

Trying a fix with #101

@ianmacartney
Copy link
Collaborator

One reason this was likely happening:
Stella was lowercased (stella) in the player data, so the stop word of "stella:" didn't work since the LLM assumed it should be caps-case: Stella:

ldanilek added a commit to get-convex/ai-town that referenced this issue Aug 31, 2023
when adding streaming conversations, i regressed a16z-infra#82
it's a little tricky, but we can bring back the fix from https://github.com/a16z-infra/ai-town/pull/101/files adjusted for streaming tokens.
ykhli pushed a commit that referenced this issue Sep 11, 2023
when adding streaming conversations, i regressed #82
it's a little tricky, but we can bring back the fix from https://github.com/a16z-infra/ai-town/pull/101/files adjusted for streaming tokens.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants