4 ms·
You can just use the normal GPT3 API for this. It costs on the order of 1 cent per page of text. You can build a chat interface in a terminal with a few lines o
by gamegoblin 4y ago
You can just use the normal GPT3 API for this. It costs on the order of 1 cent per page of text. You can build a chat interface in a terminal with a few lines of Python, and give it whatever initial prompt to assume whatever kind of character or personality you want.
(I understand lots of people want the full tailored experience and don't want to write 10 lines of Python, but my main point is that this is easy for someone to build today. I think you don't see too many companies doing this because there is exactly zero moat.)
I just whipped this up as a demo:
import openai
import os
openai.api_key = os.getenv("OPENAI_API_KEY")
transcript = []
while True:
user_input = input("User: ")
transcript.append(f"User: {user_input}")
while True:
transcript_flat = '\n'.join(transcript)
if len(transcript_flat) < 1000 and len(transcript) > 1:
transcript.pop(0)
else:
break
prompt = f'Transcript between a helpful AI assistant and its human user:\n{transcript_flat}\nAI:'
response = openai.Completion.create(model="text-davinci-003", prompt=prompt, temperature=0.1, max_tokens=1000, stop="User:").choices[0].text.strip()
response = f"AI: {response}"
print(response)
transcript.append(response)
It's very basic but demonstrates the basic idea if you want to go get an OpenAI API key and give it a shot. You can give it more sophisticated prompts to get different sorts of answers.
- shagie 4y agoThe playground works also for this, though takes a bit of making sure you've got the prompt set up correctly. I'd start working from https://beta.openai.com/playground/p/default-micro-horror?model=text-davinci-003 https://beta.openai.com/playground/p/default-micro-horror?mo... Write a paragraph describing the battle between an African Lion and a bison. The battle between an African Lion and a bison was fierce and intense. The bison, weighing nearly a ton, attempted to use its immense size and strength to overpower the lion. Despite his size, the lion was no match for the bison's strength and agility. The lion used its superior speed, agility and razor sharp claws to try to inflict damage on the bison. Although the lion was able to land multiple scratches on the bison with its claws, it was not enough to take down the massive animal. After a long and grueling fight, the lion ultimately retreated in defeat as the bison emerged victorious from this epic battle of nature. https://imgur.com/a/z6il6IZ https://imgur.com/a/z6il6IZ
- shrimpx 4y agoThanks! Is this basically what chatgpt is, a thin frontend on GPT3? Or is there more to it?
- doctoboggan 4y agoIt’s my understanding that its more like GPT3.5 since it was fine tuned on human feedback
- shagie 4y agoChatGPT has more "memory" to it. If you tell it something, it "remembers" it across the chat session. GPT3 is stateless. You give it the prompt and it responds back. Context doesn't carry between requests unless you (the user) pass it along. That can make "chat" sessions with GPT (not ChatGPT) expensive as passing along the past context of the chat session consumes a lot of tokens as it gets longer and longer.
- gamegoblin 4y agoIt had a context window of 8192 characters (2x as long as GPT3). It is possible they are using GPT itself to summarize the past transcript and pass that in as context. So your “remember X” would probably get included in that summary. That said, I have not tried to tell it to remember X and then exceeded the 8192 token contest window. Source: https://twitter.com/goodside/status/1598882343586238464 https://twitter.com/goodside/status/1598882343586238464
- shrimpx 4y agoBtw the GPT3 codex model `code-davinci-002` has a 8k token limit, too.
- stavros 4y agoWhile this is true, I feel like it's worth pointing out that ChatGPT "just" feeds your previous conversation to GPT-3 every message. I don't really think there's any difference between the two under the hood.
- 4y ago