Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a "context" box #2

Open
philohelp opened this issue Feb 26, 2023 · 2 comments
Open

Add a "context" box #2

philohelp opened this issue Feb 26, 2023 · 2 comments

Comments

@philohelp
Copy link

Not a bug, a suggestion. When you make a request to openAi in a content type, sometimes you have to prompt with two different elements: a context and a request. The idea is that you can keep the same context to apply it to different requests.

Like, for instance:
{"context":"Reshape this text to fit the following format: one paragraph for general informations and one for various announcements.", "request":"[The text to reshape]"

Then you do const globalPrompt = ${context}${request}

This is how I implemented it using the plugin:
Capture d’écran 2023-02-26 à 22 12 24

@Mcastres
Copy link
Collaborator

Mcastres commented Mar 9, 2023

Thanks @philohelp for opening the issue. That is a good idea :)
What you mean is having the context saved in the settings so that you can have it every time you open the modal that's right?

@philohelp
Copy link
Author

philohelp commented Mar 9, 2023

Yes it can be handy - and fit the new gpt-3.5-turbo model as it expects a context as the first message of the "chat" (but it doesn't have to be a chat).

So the prompt would be looking like:

messages:[
{
role:"system",
content:"Reshape the following text to fit this format: one paragraph for general informations and one for various announcements.", 
},
{
role:"user",
"content":"[The text to reshape]"
}
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants