log recommendations
This commit is contained in:
@@ -7,6 +7,7 @@ import { createUserAnalysesApi } from '@/packages/features/user-analyses/src/ser
|
||||
import { getSupabaseServerClient } from '@/packages/supabase/src/clients/server-client';
|
||||
|
||||
import { PageBody, PageHeader } from '@kit/ui/page';
|
||||
import { Skeleton } from '@kit/ui/skeleton';
|
||||
import { Trans } from '@kit/ui/trans';
|
||||
|
||||
import { createI18nServerInstance } from '~/lib/i18n/i18n.server';
|
||||
@@ -16,7 +17,6 @@ import Dashboard from '../_components/dashboard';
|
||||
import DashboardCards from '../_components/dashboard-cards';
|
||||
import Recommendations from '../_components/recommendations';
|
||||
import { loadCurrentUserAccount } from '../_lib/server/load-user-account';
|
||||
import Loading from '../loading';
|
||||
|
||||
export const generateMetadata = async () => {
|
||||
const i18n = await createI18nServerInstance();
|
||||
@@ -52,7 +52,7 @@ async function UserHomePage() {
|
||||
/>
|
||||
<PageBody>
|
||||
<Dashboard account={account} bmiThresholds={bmiThresholds} />
|
||||
<Suspense fallback={null}>
|
||||
<Suspense fallback={<Skeleton className="h-10 w-100" />}>
|
||||
<Recommendations account={account} />
|
||||
</Suspense>
|
||||
</PageBody>
|
||||
|
||||
@@ -125,11 +125,10 @@ async function recommendationsLoader(
|
||||
weight: weight.toString(),
|
||||
},
|
||||
},
|
||||
max_output_tokens: 100,
|
||||
});
|
||||
|
||||
const json = JSON.parse(response.output_text);
|
||||
await supabaseClient
|
||||
const updateAiResponse = await supabaseClient
|
||||
.schema('medreport')
|
||||
.from('ai_responses')
|
||||
.insert({
|
||||
@@ -144,7 +143,7 @@ async function recommendationsLoader(
|
||||
weight,
|
||||
}),
|
||||
latest_data_change: latestISO,
|
||||
response: JSON.stringify(response.output_text),
|
||||
response: response.output_text,
|
||||
});
|
||||
|
||||
return json.recommended;
|
||||
|
||||
Reference in New Issue
Block a user