Skip to content

Commit

Permalink
prep migration to chatGPT
Browse files Browse the repository at this point in the history
  • Loading branch information
Nutlope committed Mar 2, 2023
1 parent 2a55bb8 commit 14d46a5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ This project generates Twitter bios for you using AI.

## How it works

This project uses the [OpenAI GPT-3 API](https://openai.com/api/) (specifically, text-davinci-003) and [Vercel Edge functions](https://vercel.com/features/edge-functions) with streaming. It constructs a prompt based on the form and user input, sends it to the GPT-3 API via a Vercel Edge function, then streams the response back to the application.
This project uses the [ChatGPT API](https://openai.com/api/) and [Vercel Edge functions](https://vercel.com/features/edge-functions) with streaming. It constructs a prompt based on the form and user input, sends it to the chatGPT API via a Vercel Edge function, then streams the response back to the application.

Video and blog post coming soon on how to build apps with OpenAI and Vercel Edge functions!
If you'd like to see how I built this, check out the [video](https://youtu.be/JcE-1xzQTE0) or [blog post](https://vercel.com/blog/gpt-3-app-next-js-vercel-edge-functions).

## Running Locally

Expand Down
4 changes: 2 additions & 2 deletions components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ export default function Footer() {
<div>
Powered by{" "}
<a
href="https://openai.com/"
href="https://openai.com/blog/chatgpt"
target="_blank"
rel="noreferrer"
className="font-bold hover:underline transition underline-offset-2"
>
OpenAI{" "}
ChatGPT{" "}
</a>
and{" "}
<a
Expand Down
6 changes: 2 additions & 4 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ const Home: NextPage = () => {
const [vibe, setVibe] = useState<VibeType>("Professional");
const [generatedBios, setGeneratedBios] = useState<String>("");

console.log("Streamed response: ", generatedBios);

const prompt =
vibe === "Funny"
? `Generate 2 funny twitter bios with no hashtags and clearly labeled "1." and "2.". Make sure there is a joke in there and it's a little ridiculous. Make sure each generated bio is at max 20 words and base it on this context: ${bio}${
Expand Down Expand Up @@ -70,7 +68,7 @@ const Home: NextPage = () => {
return (
<div className="flex max-w-5xl mx-auto flex-col items-center justify-center py-2 min-h-screen">
<Head>
<title>Twitter Generator</title>
<title>Twitter Bio Generator</title>
<link rel="icon" href="/favicon.ico" />
</Head>

Expand All @@ -86,7 +84,7 @@ const Home: NextPage = () => {
<p>Star on GitHub</p>
</a>
<h1 className="sm:text-6xl text-4xl max-w-2xl font-bold text-slate-900">
Generate your next Twitter bio in seconds
Generate your next Twitter bio using chatGPT
</h1>
<p className="text-slate-500 mt-5">47,118 bios generated so far.</p>
<div className="max-w-xl w-full">
Expand Down

0 comments on commit 14d46a5

Please sign in to comment.