diff --git a/src/api_service.ts b/src/api_service.ts index a240246..c38594a 100644 --- a/src/api_service.ts +++ b/src/api_service.ts @@ -36,12 +36,12 @@ const apiService: FastifyPluginCallback = ( { role: 'user', content: userMessage } ] }); - if (chatCompletion.choices[0].message.content) { - const content = JSON.parse(chatCompletion.choices[0].message.content); - return reply.send(content.assistantMessage); + const content = chatCompletion.choices[0].message.content; + + return reply.send(content); } - return reply.send('empty response'); + return reply.send('I am sorry, I do not understand.'); } next(); diff --git a/src/app/globals.css b/src/app/globals.css index 8d89eae..565f297 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -3,8 +3,9 @@ @tailwind utilities; :root { - --background: transparent; - --foreground: #ededed; + --background: #282c35; + --foreground: transparent; + --borderradius: 20px; } body { @@ -18,18 +19,10 @@ body { text-wrap: balance; } } -.glassmorphism { - background: linear-gradient(from left, right, to right-d, #51259dff, #00bcd4); - backdrop-filter: blur(7px); - border: 2px solid rgba(205, 118, 205, 0.2); - border-radius: 10px; -} + .gradient-text { background: linear-gradient(to right, rgb(140, 96, 214), #00bcd4); -webkit-text-fill-color: transparent; background-clip: text; -webkit-background-clip: text; } -.gradient-bg { - background: linear-gradient(to bottom, right, to right, #7e57c2, #00bcd4); -} diff --git a/src/app/layout.tsx b/src/app/layout.tsx index a7bc632..b58b763 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,4 +1,5 @@ import './globals.css'; + import { Providers } from './providers'; export default function RootLayout({ @@ -7,8 +8,8 @@ export default function RootLayout({ children: React.ReactNode; }>) { return ( - - + + {children} diff --git a/src/app/page.tsx b/src/app/page.tsx index 65fa13a..ead5791 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -25,6 +25,7 @@ export default function Page() { method: 'POST', body: JSON.stringify({ userMessage: input }) }); + setInput(''); if (response.ok) { setResponse(await response.text()); } @@ -35,9 +36,9 @@ export default function Page() { }; return ( -
- -
+
+ +
@@ -46,10 +47,12 @@ export default function Page() {
- + {loading &&

Loading...

} {error &&

{error}

} - {response &&

{response}

} +
+ {response &&

{response}

} +