Description
OpenAI released a new model with a chat-like experience. So we will migrate to it and improve UX as well.
Solution
Note how it handles prompts now, API accepts an array of messages to have the whole context of the conversation
Including the conversation history helps when user instructions refer to prior messages. In the example above, the userβs final question of βWhere was it played?β only makes sense in the context of the prior messages about the World Series of 2020. Because the models have no memory of past requests, all relevant information must be supplied via the conversation. If a conversation cannot fit within the modelβs token limit, it will need to be shortened in some way.
>>
import openai
openai.ChatCompletion.create(
model="gpt-3.5-turbo",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Who won the world series in 2020?"},
{"role": "assistant", "content": "The Los Angeles Dodgers won the World Series in 2020."},
{"role": "user", "content": "Where was it played?"}
]
)
Insert / Replace buttons make sense (for example, a user can set cursor into some panel and click Insert)
LATER: Saving/Editing commands.
Every prompt should have Save button (maybe icon? maybe visible on hover?) so a user can save it as a command.
Every First command should have Edit button as it has now. When user Edit command and run it, then all messages BELOW are cleared and command is re-run
π¨ NOTE: Commands should handle both cases somehow, like selected text or not. For example, I have Emojify command. I can invoke it on a selected text, or I can just invoke it as a message in a conversation. How to do it?
"""
{{input}}
"""
Add some relevant emojis into text above in the end of some sentences
->
Add some relevant emojis into text above in the end of some sentences
List of Changed/New commands with prompts
It seems all default commands should be reviewed and redone.
π¦ Improve text for clarity
You are a professional writer. Improve the following text for clarity:
"""
{{input}}
"""
ποΈ Continue writing...
The following text in triple quotes below has already been written:
"""
{{input}}
"""
Continue writing the sentence, keeping the same voice and style. Stay on the same topic. Do not wrap responses in quotes. Write 2-3 sentences.
π©βπ« Fix spelling and grammar
Correct the text in triple quotes below into standard English and fix the grammar. Make your best effort.
"""
{{input}}
"""
Do not change markdown formatting.
Corrected text:
π Short summary
Summarize the text in triple quotes but keep it concise. Summarize using plain and simple language and keep the same tense.
"""
{{input}}
"""
Summary:
π― Outline β Blog post
Write a blog post using the outline in triple quotes below. Use plain and simple language. Do not return anything other than the blog post. Do not wrap responses in quotes.
"""
{{input}}
"""
π Act as a copy editor
Act as a copy editor. Go through the text in triple quotes below. Edit it for spelling mistakes, grammar issues, punctuation, and generally for readability and flow.
"""
{{input}}
"""
Return only the edited text. Do not wrap your response in quotes.
π§΅ Twitter thread
You are a social media expert. Generate a twitter thread for the post in triple quotes. Start every tweet with a relevant emoji. Add a tweet number in a format 1/ in the end of every tweet.
Here is a tweet example:
π§΅ this is a cool tweet
add more
1/
"""
{{input}}
"""
Thread:
β
Generate action items
Some specification is below in triple quotes:
"""
{{input}}
"""
Write a todo list of action items from this specification using the following format:
- [ ] <first action item>
- [ ] <second action item>
- [ ] <third action item>
- [ ] <fourth action item>
Do not return anything other than the todo list. Do not wrap responses in quotes.
π Write analogies
Write 3-5 different analogies for the text in triple quotes below. Use plain and simple language. Do not return anything other than the analogies. Do not wrap responses in quotes.
"""
{{input}}
"""
π€¨ Generate counter arguments
Give 1-3 counter arguments to the text below:
"""
{{input}}
"""
Do not return anything other than the counter-arguments. Do not wrap responses in quotes
π₯Έ Generate overview
The article is below in the triple quotes:
"""
{{input}}
"""
Provide a overview of the article. Use the following format:
"""
Summary:
< one to two line summary >
Key takeaways:
1. < first key takeaway >
2. < second key takeaway >
3. < third key takeaway >
Counter arguments:
1. < first main counter argument >
2. < second main counter argument >
"""
Do not return anything other than the overview. Do not wrap responses in quotes.
π€ Emojify
Add some relevant emojis into the text below. Add emojis in the end of some sentences only:
"""
{{input}}
"""
Translate β English π¬π§
Provide the English translation for these sentences.
"""
{{input}}
"""
Translation: