Skip to content

Latest commit

 

History

History

nextjs-openai-simple

Nextjs + OpenInference Minimum Working Example

This is a Next.js project bootstrapped with create-next-app that uses OpenAI to generate text and is traced using Phoenix.

Note

This example explicitly uses Next.js 13. OpenTelemetry support for Next.js 14 is still under active development. If you are using Next.js 14 and need workarounds, please contact us at [email protected]

Installation

Install the dependencies:

npm install

Getting Started

Make sure you have OPENAI_API_KEY set as an environment variable.

First, start phoenix to trace the application.

docker run -p 6006:6006 arizephoenix/phoenix:latest

Start the Next.js application:

npm run dev

View the application at http://localhost:3000 and the traces in the Phoenix UI at http://localhost:6006.

Learn More

You can check out the Phoenix GitHub repository - your feedback and contributions are welcome!