Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ ReadmeGenAI eliminates this friction by leveraging advanced AI to automatically
<img src="assets/mainpage.png" alt="Main Page" width="600"/>
<br>
<br>
<img src="assets/fearture-page.png" alt="Feature Page" width="600"/>
<img src="assets/feature-page.png" alt="Feature Page" width="600"/>
</p>

## Technical Architecture
Expand Down
File renamed without changes
7 changes: 5 additions & 2 deletions src/app/api/generate/route.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { NextResponse } from "next/server";
import { getGeminiModel } from "@/lib/gemini";
import { getRepoData, getRepoContents } from "@/lib/octokit";
import { SUPPORTED_LANGUAGES } from "@/constants/languages";

Check warning on line 4 in src/app/api/generate/route.ts

View workflow job for this annotation

GitHub Actions / autofix

'SUPPORTED_LANGUAGES' is defined but never used

Check warning on line 4 in src/app/api/generate/route.ts

View workflow job for this annotation

GitHub Actions / build-and-lint

'SUPPORTED_LANGUAGES' is defined but never used

export const dynamic = "force-dynamic";

Expand Down Expand Up @@ -157,9 +157,12 @@

const result = await model.generateContent(prompt);
const response = await result.response;
const markdown = response.text();
const markdown = response.text().trim();
const cleanMarkdown = markdown
.replace(/^```(markdown|md)?\n/, "")
.replace(/\n```$/, "");

return NextResponse.json({ markdown });
return NextResponse.json({ markdown: cleanMarkdown });
} catch (error: unknown) {
const message =
error instanceof Error ? error.message : "Internal Server Error";
Expand Down
2 changes: 1 addition & 1 deletion src/lib/gemini.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function getGeminiModel(): GenerativeModel {
const genAI = new GoogleGenerativeAI(apiKey);

_model = genAI.getGenerativeModel({
model: "gemini-2.5-flash",
model: "gemini-1.5-flash",
safetySettings: [
{
category: HarmCategory.HARM_CATEGORY_HARASSMENT,
Expand Down
Loading