This repo explores using OpenAI Functions with APIs, I'm using a RapidAPI endpoint to get news on spaceflights.
There are 2 versions here using OpenAI Functions. One version <OpenAI />
and api/news-openai
uses just OpenAI. Another <Langchain />
and api/news-langchain
with Langchain.
Get API keys
Create a .env
file and paste in your keys. There is an .env.example
file that can be copied and pasted, don't put your API keys here, only in your .env
file.
Run the development server:
yarn dev
Open http://localhost:3000 with your browser to see the result.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
- OpenAI
- Langchain
- RapidAPI
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.