judygab / chatgpt-api-react Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://chatgpt-api-react.vercel.app
Home Page: https://chatgpt-api-react.vercel.app
whenever we give a query, no visible responce
Hi. I noticed in the chatLog that formatting was not carried over.
This is because whitespace-pre-line what not added in the div via tailwind.
Here is how to carry over formating from API message to the front end.
{
chatLog.map((message, index) => (
<div key={index} className={flex ${message.type === 'user' ? 'justify-end' : 'justify-start'}
}>
<div className={${message.type === 'user' ? 'bg-blue-500' : 'bg-gray-800' } rounded-lg p-4 text-white max-w-sm **whitespace-pre-line**
}> {message.message}
))
}
Getting following syntax error. I can guess that this might be npm version issue. But I am not a npm developer , just trying to run this. If anyone can help.
npm run dev
[email protected] dev
next dev
/home/abhishek/Repository/chatgpt-api-react/node_modules/next/dist/cli/next-dev.js:362
showAll: args["--show-all"] ?? false,
^
SyntaxError: Unexpected token '?'
at wrapSafe (internal/modules/cjs/loader.js:915:16)
at Module._compile (internal/modules/cjs/loader.js:963:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.dev (/home/abhishek/Repository/chatgpt-api-react/node_modules/next/dist/lib/commands.js:10:30)
at Object. (/home/abhishek/Repository/chatgpt-api-react/node_modules/next/dist/bin/next:141:28)
at Module._compile (internal/modules/cjs/loader.js:999:30)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.