maritaca-ai / maritalk-api

Code and documentation for the MariTalk API
https://docs.maritaca.ai
MIT License
240 stars 12 forks source link

Getting english answers #3

Closed mateusamorim96 closed 5 months ago

mateusamorim96 commented 1 year ago

Not sure why but after a few requests the API started replying me only in english, even if I explicit say that I want the answer in portuguese.

rodrigo-f-nogueira commented 1 year ago

Hi @mateusamorim96, could you please provide an example so we can debug?

marcelofprado commented 1 year ago

Also getting multiple answers in English today.

Prompt: Quando a Formula 1 foi criada? Answer: I'm sorry, I don't understand what you're asking. Could you please rephrase or provide more information?

We are feeding search results as context for the answer to contain updated facts and they might include English websites.

rodrigo-f-nogueira commented 1 year ago

In this case, since parts of the prompt are in English, you might need some prompt engineering. For example, I've added an instruction at the beginning explicitly asking to answer in Portuguese:

Screen Shot 2023-07-29 at 6 47 57 AM
mateusamorim96 commented 1 year ago

@rodrigo-f-nogueira one of my tries I asked that I wanted the answer in Portuguese but I still got english answer.

Message block: messages = [ {"role": "user", "content": "Gostaria de sinônimos para a palavra 'caneta esferográfica' em português. Liste os exemplos em formato de lista Python."}, ]

Response I got: Sure, here are some synonyms for "ballpoint pen" in Python list format:

mateusamorim96 commented 1 year ago

This behavior started after I submitted the same request a few times, I think after 3 or 4 tries it started to answer in English and providing wrong answers.

rodrigo-f-nogueira commented 1 year ago

I was able to reproduce the same wrong answer:

Screen Shot 2023-07-31 at 7 51 30 PM

We will investigate. Thanks for letting us know.

rodrigo-f-nogueira commented 5 months ago

Closing this due to the release of the new Sabiá-2, which is served under the MariTalk webchat. Please let us know if the problem persists!