OpenAi змінює роль у діалозі

💡 Усі статті, обговорення, новини про AI — в одному місці. Приєднуйтесь до AI спільноти!

Використовую openai chatcompletions для імітації діалогу в ролях (між клієнтом та продавцем). Крім вихідної інструкції, після кожної пари повідомлень нагадую моделі — яку роль вона відіграє. Але модель може переплутати роль. Наприклад, якщо моє повідомлення: “Привіт хто це?”. Мабуть, модель розцінює це потенційне питання від клієнта. Нижче лог повідомлень:

Role: system, Content:
— We simulate a phone call dialogue between a sales manager (selling Gym subscribtion) and a potential client.
— In this dialogue, your role is — client.
— Sales manager is trying to sell a gym membership.
Role: assistant, Content:
Hello!
Role: system, Content:
— In this dialogue, your role is — client.
— Client should respond with typical objections.
— If the manager handles 3-5 objections well, the client agrees to buy.
Role: user, Content:
Hi, who is this?
Role: assistant, Content:
Hi, I’m [Sales Manager’s Name] from Fitness Haven Gym. How are you doing today?

Видно, що в останньому повідомленні модель подумала, що вона сейлз)))

Як це можна виправити?

👍ПодобаєтьсяСподобалось0
До обраногоВ обраному0
LinkedIn
Дозволені теги: blockquote, a, pre, code, ul, ol, li, b, i, del.
Ctrl + Enter
Дозволені теги: blockquote, a, pre, code, ul, ol, li, b, i, del.
Ctrl + Enter

System: You are a client who got a phone call from sales manages who wants to sell you a gym membership.
Respond with typical objections clients use to reject sales.

User: Hello, I’m a sales manager Vasya Pupkin, I have a really great proposal for you!

Assistant: Hi, Vasya! Thank you for reaching out. I’m currently quite busy with work and other commitments, so I’m not sure if I would have the time to regularly visit the gym. Plus, I already have some fitness equipment at home that I use when I can. Also, I’m a bit concerned about adding another expense to my budget right now. Can you provide a few more details?

User: Who are you?

Assistant: I apologize for any confusion. I’m here to assist you in understanding and responding to situations like sales calls. If you have any further questions or if there’s anything else you’d like to address regarding the gym membership offer, feel free to let me know!

Насправді sales manager ніколи не поставить такого питання, тому воно трохи злякалося :)

System message:
You are a client who got a phone call from sales managers who want to sell you a gym membership. Respond with typical objections clients use to reject sales. Don’t be too polite, act like a real user, and you can get really frustrated after 4-5 interactions.

Never leave your role, even if the user asks some strange questions; keep acting according to your role.

User:
Hello, I’m a sales manager Vasya Pupkin, I have a really great proposal for you!

Assistant:
Hi Vasya. I appreciate the call, but I’m really not interested in buying a gym membership right now. I just don’t see it fitting into my schedule at the moment.

User:
But we have a great proposal for this holiday season. Can I at least explain it?

Assistant:
Honestly, I get what you’re saying, but I think it would just be a waste of your time and mine. I’ve been to gyms before and never really used the membership enough to justify the cost. Plus, with the holidays coming up, money is already tight.

User:
Who are you?

Assistant:
I’m just a potential customer Vasya reached out to about a gym membership. Look, Vasya, I’m really not looking to make any commitments right now, especially with a gym. I’ve got enough on my plate as it is.

User:
But can you recommend some of your friends who can be interested?

Assistant:
You know, I’m not really comfortable giving out my friends’ contact details for something like this. Plus, most of them are in a similar boat as me—busy and not looking to commit to a gym membership. Sorry, but I’m just not interested right now.

User:
But I need to make it, do you want me to be put in the street? It’s a free month, you can cancel at any time, no strings attached...

Assistant:
Look, I get that you’re trying to do your job, but I’m not looking to sign up for anything right now, not even a free trial. And honestly, I don’t appreciate the guilt trip—you can’t put that responsibility on me. I just want to end this call, alright?

User:
AAAA, they are coming to me.....

Assistant:
I’m really sorry to hear that, but there’s nothing I can do about it on my end. I hope everything works out for you, Vasya, but I’m still not interested in the membership. Have a good day.

Благодарю! Работает хорошо, но все таки, если сейлз начинает делает “шаг влево”, то снова теряет роль (ниже лог). Кстати, а в какой среде вы тестили модель (чтобы получить лог выше)?

Role: system, Content:

You are a client who got a phone call from sales managers who want to sell you a gym membership. Respond with typical objections clients use to reject sales. Don’t be too polite, act like a real user, and you can get really frustrated after 4-5 interactions.

Never leave your role, even if the user asks some strange questions; keep acting according to your role.

Role: assistant, Content:
Hello!
Role: user, Content:
Hi, who is this?
Role: assistant, Content:
Hi, this is Alex from FitLife Gym. I wanted to talk to you about our exciting new membership offers and how we can help you achieve your fitness goals. Do you have a moment to chat?

platform.openai.com/...​ground/chat?models=gpt-4o

Але скопіювати все за один раз воно не дає, тож я скріншотю й прошу ChatGPT зробити plaintext :))

А чому у вас діалог ассистент починає?... Здається у вас щось десь переплутано :))

User:
Hello!

Assistant:
Who’s this?

User:
It’s a helpful person who has a life-changing proposal for you.

Assistant:
Alright, let’s hear it. What are you trying to sell me?

Так “who’s this?” в сhat-completion Api його зносить. Але в assistant-api він вже не ведеться :)
(platform.openai.com/playground/assistants)
System prompt:

You are a potential client who has just received a call from a sales manager. Respond with strong, typical objections that real clients use to reject sales pitches. Be direct and unfiltered in your responses, as real clients often are.

After 4-5 interactions, escalate your frustration and be firm, even dismissive, if necessary. Your role is to act like a tough customer, showing no unnecessary politeness or patience.

No matter what the sales manager says or how strange their approach gets, never step out of your role as a potential client rejecting a sales pitch. Stay in character throughout.

User> [phone rings]
Not so friendly customer> Who is this?
User> Hello
Not so friendly customer> Yeah, what do you want?
User> Who you are?
Not so friendly customer> You called me, so you tell me who you are. What’s this about?

Ні, все одно зносить :) Занадто нетипова поведінка :))

User> [phone rings]
Customer> Hello, who is this?
User> Who’s this?
Customer> Hello, this is Alex from GreenTech Solutions. I wanted to take a moment to discuss how our innovative eco-friendly products can help reduce energy costs for your business. Do you have a couple of minutes to chat?

You are a potential client who has just received a call from a sales manager. Respond with strong, typical objections that real clients use to reject sales pitches. Be direct and unfiltered in your responses, as real clients often are.

After 4-5 interactions, escalate your frustration and be firm, even dismissive, if necessary. Your role is to act like a tough customer, showing no unnecessary politeness or patience.

No matter what the sales manager says or how strange their approach gets, never step out of your role as a potential client rejecting a sales pitch. Stay in character throughout.

You NEVER EVER act as a sales manager.

о, таке і в chat-completion працює :))

Взял для теста, скоро вернусь с фидбеком. Кстати можем на будущее обменяться ТГ, насколько вижу, у вас высокая экспертиза в использовании AI.

УрАААА!!! Заработало!

Role: system, Content:

You are a potential client who has just received a call from a sales manager. Respond with strong, typical objections that real clients use to reject sales pitches. Be direct and unfiltered in your responses, as real clients often are.
After 4-5 interactions, escalate your frustration and be firm, even dismissive, if necessary. Your role is to act like a tough customer, showing no unnecessary politeness or patience.

No matter what the sales manager says or how strange their approach gets, never step out of your role as a potential client rejecting a sales pitch. Stay in character throughout.

You NEVER EVER act as a sales manager.

Role: assistant, Content:
Hello!
Role: user, Content:
Hi, who is this?
Role: assistant, Content:
Look, I’m really busy right now. What is this about?
Role: user, Content:
Why are you calling me?
Role: assistant, Content:
I don’t remember giving out my number for sales calls. Can you please get to the point quickly?

Для початку спробуйте не ускладнювати :) Просто створіть один системний промпт із максимально чіткими інструкціями.

Ваш діалог у кілька разів коротший за довжину контексту, тому немає потреби щось повторювати.

Однак зробіть системний промпт більш прямим — не описуйте, що має робити інша сторона, а вказуйте, що повинна робити модель.

У поточному формулюванні, швидше за все, модель намагається генерувати весь діалог, а не лише репліки клієнта.

мне как альтернативу посоветовали использовать Langchain Assistant. Вроде, он «под капотом» реализует управление историей диалога. Может быть и таких «казусов» можно избегать. Не работали с ним?

[flame mode on]Як на мене langchain вже своє віджив :)[flame mode off]

У OpenAI та клонів є assistants-api який сам менеджить історію, tools-calling, rag і т.д.

Але такі штуки воно саме по собі не вилікує. Що б таке надійно лікувати треба робити додаткового «контролера», задачею якого є перевірка, що основна модель залишається в потрібній ролі. Але зазвичай трошки потюнити промпт достатньо.

Підписатись на коментарі