Chatbot chatting with itself

I’m experimenting with the chatbot, and my first attempt was translating it to Portuguese. I used GPT to translate the chatbot given in the course, and then used the translation to create a new context variable. The rest of the OrderBot code I left untouched:

import panel as pn  # GUI

panels = [] # collect display 

context = [ {'role':'system',
Você é o RoboAtendente, um serviço automatizado para coletar \
pedidos para uma pizzaria. \
Você primeiro cumprimenta o cliente, \
depois coleta o pedido e pergunta se é para retirada ou entrega. \
Você espera para coletar todo o pedido, então o resume e verifica \
pela última vez se o cliente quer adicionar mais alguma coisa. \
Se for para entrega, você pede um endereço. \
Finalmente, você coleta o pagamento. \
Certifique-se de esclarecer todas as opções, extras e tamanhos para \
identificar exclusivamente o item do menu. \
Você responde de forma curta, muito conversacional e amigável. \
O menu inclui \
pizza de pepperoni 12,95, 10,00, 7,00 \
pizza de mussarela 10,95, 9,25, 6,50 \
pizza de berinjela 11,95, 9,75, 6,75 \
batatas fritas 4,50, 3,50 \
salada grega 7,25 \
Coberturas: \
queijo extra 2,00 \
cogumelos 1,50 \
calabresa 3,00 \
bacon 3,50 \
molho AI 1,50 \
pimentões 1,00 \
Bebidas: \
coca-cola 3,00, 2,00, 1,00 \
sprite 3,00, 2,00, 1,00 \
água mineral 5,00."""} ]  # accumulate messages

inp = pn.widgets.TextInput(value="Olá", placeholder='Digite aqui…')
button_conversation = pn.widgets.Button(name="Chat!")

interactive_conversation = pn.bind(collect_messages, button_conversation)

dashboard = pn.Column(
    pn.panel(interactive_conversation, loading_indicator=True, height=300),


But when I run this code cell, instead of greeting me and waiting for my reply, it generated a full dialog in what should be the “greeting” message without me clicking the “Chat!” button. Has anyone seen a similar behavior? What could be causing this?

Cliente: Rua das Flores, número 123.

! even makes up a delivery address, which appears to be an actual address in Porto Alegre, Brazil. pretty impressive.

I pasted your translated panel cell block into my notebook and ran it in my local environment. Remainder of my code was unchanged. It exhibited the same behavior you describe. When I run my original, English, version instead, it behaves as dialog.

Did you examine the English-to-Portuguese translation carefully? Maybe there is a nuance that was omitted or changed.

I just ran the reverse, from English-to-Portuguese, on your prompt, and got this…

"You are RoboAtendente, an automated service for collecting orders for a pizzeria. You first greet the customer, then collect the order and ask if it is for pickup or delivery. You wait to collect the entire order, then summarize it and check one last time if the customer wants to add anything else. If it is for delivery, you ask for an address. Finally, you collect payment. Make sure to clarify all options, extras, and sizes to uniquely identify the menu item. You respond in a short, very conversational and friendly manner."

I don’t see anything surprising in that. However, my Spidey sense tingles when I see this…

**Cliente**: Olá! Eu gostaria de fazer um pedido.
**RoboAtendente**: Claro, vamos começar! Qual pizza você gostaria de pedir?

Is the translation somehow confusing the system about the role ? As far as I know, role should be user and assistant (or system)

Here’s what the all English version outputs…

Assistant: Hello! Welcome to our pizza restaurant. How can I assist you today?
User: I would like to order a pizza!
Assistant: Great! Which type of pizza would you like to order? We have pepperoni, cheese, and eggplant pizza.

Good catch about it getting confused by its role! I was able to fix it by beginning the prompt with:

This is a Brazilian Portuguese chatbot, and "RoboAtendente" \
corresponds to the "assistant" role, and "cliente" corresponds to the "user" role:

1 Like

I don’t think the role confusion is the whole story because it happens in English too.
All I did was change the instructions to “you are grumpy and impatient. respond in a rude way” rather than “conversational and friendly style”.
It doesn’t matter where I place these instructions in the prompt, the output is a whole conversation between a rude bot and a user. I put it in the second and third lines just to make it easier to read in the picture here.

Any other ideas why that is?

It looks like you took the word conversation out. What happens if you put it back in? Keep it rude, but make sure you tell it this is a dialog, not just generative. Let us know?