Skip to content

Commit

Permalink
Merge branch 'main' into feat/add-bookmark-button-improve-ux
Browse files Browse the repository at this point in the history
  • Loading branch information
quentingrchr committed Jun 13, 2024
2 parents feef1d2 + 4523dd7 commit 2db7fe6
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 19 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,8 @@ yarn dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

## Sponsors

This project is being developed by [Premier Octet](https://www.premieroctet.com), a Web and mobile agency specializing in React and React Native developments.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"@radix-ui/react-tabs": "^1.0.3",
"@radix-ui/react-tooltip": "^1.0.5",
"@react-icons/all-files": "^4.1.0",
"@redirection.io/vercel-middleware": "^0.1.4",
"@resvg/resvg-js": "^2.4.1",
"@sendinblue/client": "^3.3.1",
"@sentry/nextjs": "^7.51.2",
Expand Down
5 changes: 3 additions & 2 deletions src/app/(app)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import { getCurrentUser } from '@/lib/sessions';
export const dynamic = 'force-dynamic';

const Home = async () => {
await getCurrentUser();
return <Homepage />;
const user = await getCurrentUser();

return <Homepage user={user} />;
};

export default Home;
9 changes: 0 additions & 9 deletions src/middleware.ts

This file was deleted.

8 changes: 4 additions & 4 deletions src/pages/api/teams/[teamId]/bookmark/summary.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { openAiCompletion } from '@/utils/openai';
import { checkProAccount, checkTeam } from '@/lib/middleware';
import { AuthApiRequest, errorHandler } from '@/lib/router';
import { getTeamById } from '@/services/database/team';
import { openAiCompletion } from '@/utils/openai';
import Parser from '@postlight/parser';
import type { NextApiResponse } from 'next';
import { createRouter } from 'next-connect';
import Parser from '@postlight/parser';
import { getTeamById } from '@/services/database/team';

export const router = createRouter<AuthApiRequest, NextApiResponse>();

Expand Down Expand Up @@ -38,7 +38,7 @@ router
.slice(0, 5500)
.join(' ');

const response = await openAiCompletion({ prompt, model: 'gpt-4' });
const response = await openAiCompletion({ prompt });
const summary = response[0]?.message?.content;

return res.status(201).json(summary);
Expand Down
2 changes: 1 addition & 1 deletion src/services/database/link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export const generateLinksTags = async (
---
`;

const response = await openAiCompletion({ prompt, model: 'gpt-4' });
const response = await openAiCompletion({ prompt });

const data = response[0].message.content;
if (data === 'NONE' || !data) return [];
Expand Down
4 changes: 2 additions & 2 deletions src/utils/openai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ const openai = new OpenAI({

export const openAiCompletion = async ({
prompt,
model = 'gpt-3.5-turbo',
model = 'gpt-4o',
}: {
prompt: string;
model?: 'gpt-3.5-turbo' | 'gpt-4';
model?: 'gpt-4o' | 'gpt-4-turbo';
}) => {
const chatCompletion = await openai.chat.completions.create({
messages: [{ role: 'user', content: prompt }],
Expand Down

0 comments on commit 2db7fe6

Please sign in to comment.