langchain-ai / langchain

🦜🔗 Build context-aware reasoning applications
https://python.langchain.com
MIT License
89.3k stars 14.08k forks source link

Catch and Filter OpenAI "As an AI model" responses #8637

Closed sarmientoj24 closed 5 months ago

sarmientoj24 commented 11 months ago

Feature request

When connecting to ChatGPT API, it is possible to get responses by the chatbot as "As an AI model...", which ruins the chatbot experience on your application.

A way to filter this and generate a default response might be better.

Motivation

For applications using OpenAI API, this would enable filtering those requests.

Your contribution

Not really

KeshavSingh29 commented 11 months ago

I dont think you need a filter for this. Such a behavior can be easily controlled via prompting or changing system prompt.

sarmientoj24 commented 11 months ago

@KeshavSingh29 For example, someone says an R-18 or something racist, it will say something like this. It can be controlled via prompts but I think it can still be uncontrollable at times.

dosubot[bot] commented 8 months ago

Hi, @sarmientoj24! I'm Dosu, and I'm helping the LangChain team manage their backlog. I wanted to let you know that we are marking this issue as stale.

From what I understand, you raised a feature request to catch and filter OpenAI "As an AI model" responses when using the ChatGPT API. There was a discussion in the comments about controlling this behavior through prompts or changing the system prompt. However, you expressed concerns that prompts may not always be sufficient to control inappropriate or uncontrollable responses.

Before we close this issue, we wanted to check if it is still relevant to the latest version of the LangChain repository. If it is, please let us know by commenting on the issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days.

Thank you for your contribution to the LangChain project!

KeshavSingh29 commented 8 months ago

@sarmientoj24 Thats true. One way I do it is to have a validation method where I use a customized prompt to change/rewrite such responses. But again its filtering through prompting. Do you have some other way in mind? In that case such a feature would be nice to have.

dosubot[bot] commented 8 months ago

@baskaryan Could you please help @sarmientoj24 with this issue? They have indicated that the problem is still relevant and are looking for a way to catch and filter OpenAI "As an AI model" responses when using the ChatGPT API. They mentioned using a validation method with a customized prompt, but are open to other suggestions. Thank you!

dosubot[bot] commented 5 months ago

Hi, @sarmientoj24

I'm helping the LangChain team manage their backlog and am marking this issue as stale. From what I understand, you raised a feature request to catch and filter OpenAI "As an AI model" responses when using the ChatGPT API. There was a discussion about controlling the behavior through prompts or changing the system prompt, but concerns were raised about the effectiveness of this approach. It seems that the issue is still relevant to you, so could you please confirm if it's still applicable to the latest version of the LangChain repository?

If it is, please let the LangChain team know by commenting on the issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days. Thank you for your understanding and cooperation.