Skip to content

Commit

Permalink
update summary prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
maheshj01 committed Jun 30, 2024
1 parent 67e5a21 commit 1d04443
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/app/(main)/_components/PreviewPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const PreviewPage = ({ logId }: { logId: string }) => {
const onSummarizeClicked = async () => {
try {
setSummaryLoading(true);
const summary = await logService.getSummary(apiKey!, previewLog?.data!)
const summary = await logService.getSummary(apiKey!, previewLog!)
previewLog!.summary = summary!;
logService.updateLog(logId, previewLog!);
} catch (error) {
Expand Down
4 changes: 2 additions & 2 deletions src/app/(main)/_services/logService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,13 @@ class LogService {
}
}

getSummary = async (apiKey: string, text: string) => {
getSummary = async (apiKey: string, log: Log) => {
try {
const genAI = new GoogleGenerativeAI(apiKey!);

const model = genAI.getGenerativeModel({ model: "gemini-pro" });

const prompt = "Summarize the following text: " + text;
const prompt = `Summarize the following text by taking the title: ${log.title} and its description:` + log.data;

const result = await model.generateContent(prompt);
const response = await result.response;
Expand Down

0 comments on commit 1d04443

Please sign in to comment.