add openai package
This commit is contained in:
@@ -12,6 +12,7 @@ import { withI18n } from '~/lib/i18n/with-i18n';
|
||||
|
||||
import Dashboard from '../_components/dashboard';
|
||||
import DashboardCards from '../_components/dashboard-cards';
|
||||
import Recommendations from '../_components/recommendations';
|
||||
import { loadCurrentUserAccount } from '../_lib/server/load-user-account';
|
||||
|
||||
export const generateMetadata = async () => {
|
||||
@@ -24,6 +25,7 @@ export const generateMetadata = async () => {
|
||||
};
|
||||
|
||||
async function UserHomePage() {
|
||||
console.log('process.env', process.env.OPENAI_API_KEY);
|
||||
const client = getSupabaseServerClient();
|
||||
|
||||
const { account } = await loadCurrentUserAccount();
|
||||
@@ -48,6 +50,8 @@ async function UserHomePage() {
|
||||
/>
|
||||
<PageBody>
|
||||
<Dashboard account={account} bmiThresholds={bmiThresholds} />
|
||||
|
||||
<Recommendations />
|
||||
</PageBody>
|
||||
</>
|
||||
);
|
||||
|
||||
26
app/home/(user)/_components/recommendations.tsx
Normal file
26
app/home/(user)/_components/recommendations.tsx
Normal file
@@ -0,0 +1,26 @@
|
||||
'use client';
|
||||
|
||||
import React, { useEffect } from 'react';
|
||||
|
||||
import OpenAI from 'openai';
|
||||
|
||||
export default function Recommendations() {
|
||||
// const client = new OpenAI();
|
||||
|
||||
const getRecommendations = async () => {
|
||||
// const response = await client.responses.create({
|
||||
// model: 'gpt-5',
|
||||
// input: 'Write a short bedtime story about a unicorn.',
|
||||
// });
|
||||
// console.log(response.output_text);
|
||||
};
|
||||
|
||||
// useEffect(() => {
|
||||
// console.log('process.env', process.env);
|
||||
// if (process.env.OPENAI_API_KEY) {
|
||||
// getRecommendations();
|
||||
// }
|
||||
// }, []);
|
||||
|
||||
return <div>Recommendations</div>;
|
||||
}
|
||||
Reference in New Issue
Block a user