Skip to content

Kurtis Lin - Adanomad OA #13

Open
Kurtis24 wants to merge 4 commits into
adanomad:mainfrom
Kurtis24:main
Open

Kurtis Lin - Adanomad OA #13
Kurtis24 wants to merge 4 commits into
adanomad:mainfrom
Kurtis24:main

Conversation

@Kurtis24

@Kurtis24 Kurtis24 commented Mar 20, 2025

Copy link
Copy Markdown

PDF Highlight OA

OA for Adanomad

Installation

To get started, install the required dependencies:

pip install groq
pip install axios
npm install pdfjs-dist

Usage

npm run dev
(Hosted on LocalHost:3000)

Link to Video

https://youtu.be/RfvuQFb6tzg

Let me know if you want me to refine it further! 🚀

Comment thread app/api/groq/route.ts
import { NextResponse } from "next/server";
import axios from "axios";

const API_KEY = "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";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be exposed

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, will fix that immediately


// Send the extracted text back to the parent as context.
if (onExtracted) {
onExtracted(fullText.trim());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How would you deal with pdf that has too much to fit the context window?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To handle a PDF with too many pages, I would add a buffer to load only five pages at a time, ensuring the context will fit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants