gpt4free
gpt4free copied to clipboard
[OpenaiChat] Adding the 'system' role
Could you please add the system role to the OpenaiChat provider and other gpt-compatible providers with the corresponding field in the WebUI.
https://platform.openai.com/docs/guides/text-generation
You can set globally a system message in OpenAI Chat, but not for a conversation. By default the system message are added to the user message with System: and then the message. But if you write: Instructions: and then the system message, it should works better.
E.g. if I need OpenaiChat to translate some text with the system message, i have to write the following in the prompt field?
Instructions: You are a professional, authentic translation engine, only returns translations. Translate the following text to English: /here is some text/
But how OpenaiChat separate Instructions: from Translate the following text to English:?
There is no reason to separate it. It is also a instruction. But between the instructions and the text, you should add 2 or 3 line breaks.
I.e. from the example above I need to do the following:
Instructions: You are a professional, authentic translation engine, only returns translations.
Translate the following text to English: /here is some text/
Sure, this approach could be used, but as a temporary roundabout measure, since dedicated field in the WebUI with the corresponding field in the request would still be preferable and more reasonable, because it is unknown how OpenaiChat would be counting the respective number of tokens in the request with Instructions:... in the role's content and in the system's content.
Why you are using not the API from OpenAI? I can't change companys
Why you are using not the API from OpenAI?
What do you mean? I exactly try to use OpenAI API - https://help.openai.com/en/articles/7042661-moving-from-completions-to-chat-completions-in-the-openai-api - which postulates:
You can also use a system level instruction to guide the model's behavior throughout the conversation.
There is also a man here who was wondering the same thing - https://community.openai.com/t/understanding-role-management-in-openais-api-two-methods-compared/253289
OpenaiChat use not the Chat API. It use the Frontend of chat.openai.com, because it is free. You can use system messages only with the paid API.
IMHO, it's not quite like that. I use following apps to translate texts using g4f as an API proxy:
- pot-desktop https://github.com/pot-app/pot-desktop
- immersive-translate https://github.com/immersive-translate/immersive-translate/
Here are their settings, which differ only in the system fields:
But, the translation differs in meaning and fluent in some places quite a lot.
I added a message history and system message support to OpenaiChat. I convert now the messages for the Chat API. #1637
@hlohaus Custom instructions from the web app are transferred to the G4F. Is this intended behavior?
It is a excepted behavior. It is the Web API.
Bumping this issue because it has been open for 7 days with no activity. Closing automatically in 7 days unless it becomes active again.
Is it possible to add a message support into the WebUI?
So that there are 2 separate text input fields for message and for user.
Like in LiaobotsUI
Thank you very much!