I use Gemini, which supports PDF File uploads, combined with structured outputs to generate Course Sections, Levels & Question JSON.
When you upload a PDF, it first gets uploaded to a S3 Database directly from the Browser, which then sends the Filename and other data to the Server. The Server then downloads that Document from the S3 and sends it to Gemini, which then streams JSON back to the Browser. After that, the PDF is permanently deleted from the S3.
Data Privacy wise, I wouldn't upload anything sensitive since idk what Google does with PDFs uploaded to Gemini.
The Prompts are in English, so the output language is English as well.
However, I actually only tested it with German Lecture PDFs myself.
So, yes, it probably works with any language that Gemini supports.
Here is the Source Code for the core function for this feature:
js
export async function createLevelFromDocument(
{ docName, apiKey, numLevels, courseSectionTitle, courseSectionDescription }:
{ docName: string, apiKey: string, numLevels: number, courseSectionTitle: string, courseSectionDescription: string })
{
const hasCourseSection = courseSectionTitle.length > 0 && courseSectionDescription.length > 0;
// Step 1: Download the PDF and get a buffer from it
const blob = await downloadObject({ filename: docName, path: "/", bucketName: "documents" });
const arrayBuffer = await blob.arrayBuffer();
// Step 2: call the model and pass the PDF
//const openai = createOpenAI({ apiKey: apiKey });
const gooogle = createGoogleGenerativeAI({ apiKey: apiKey });
const courseSectionsPrompt = createLevelPrompt({ hasCourseSection, title: courseSectionTitle, description: courseSectionDescription });
const isPDF = docName.endsWith(".pdf");
const content: UserContent = [];
if(isPDF) {
content.push(pdfUserMessage(numLevels, courseSectionsPrompt) as any);
content.push(pdfAttatchment(arrayBuffer) as any);
} else {
const html = await blob.text();
content.push(htmlUserMessage(numLevels, courseSectionsPrompt, html) as any);
}
const result = await streamObject({
model: gooogle("gemini-1.5-flash"),
schema: multipleLevelSchema,
messages: [
{
role: "user",
content: content
}
]
})
return result;
}
The UI mostly works offline once loaded in due to aggressive caching.
Downloading Course Content was on the initial Roadmap but I removed it since I wasn't sure if anyone would like the feature.
Syncing stuff is a real pain in the ass but I'll implement it if at least a couple people want it.
Thanks for the suggestion, I’ll definitely try to make the app as language inclusive as possible!
Also, sorry if I might’ve been too vague with the post title.
The app is just similar to Duolingo in terms of structure and the idea, however it’s not specific to language learning but supposed to cater to any subject, really.
For example, I personally use it to study for my university subjects.
I'm actually trying to solve this issue on my own Lemmy app. It automatically switches instances when the requested one is down. Works only in the Feed right now and, of course, accounts are still instance-bound - but I will fix that soon.
I always wonder when people say something like this. I also develop a Lemmy app myself and don't understand this point, like are you afraid people will complain about your code cleanliness or commenting techniques?
I mean what extra work is there really? Moving secrets to environment variables is annoying, I get that at least.
I mean no offense to you at all, really, but when I check out other Lemmy apps I don't even bother with closed source ones since I can't possibly know if you just steal login information. Especially since this is so immensely easy with Lemmy.
Again, I'm not saying you do these things but it's always better being able to check yourself, you know?
You could make like a circular shape on the screen with numbers correlating to the speed on different angles. Then maybe add some rectangle which points at the current speed and effectively changes the angle when the speed changes.
I'm a FSE and I use GitHub copilot and Perplexity. I wouldn't want to code without them anymore.
I want to get things done (especially when I'm at work) and not spent time reading docs or having 20 tabs of stackflow open. I've had enough of that lol.
I think everyone here knows copilot but perplexity is a lot smaller and newer.
It's basically like chatgpt but faster and it googles stuff, giving sources for each claim that I can read for myself.
For example, for my latest project I decided to give tailwind a try and instead of having to look through the docs for every little thing I just ask perplexity and it sums it up for me, even giving examples.
And I use copilot a lot for mundane tasks, for example when I write an API that takes an object of type Foo, Copilot auto Fills making variables and checking each for nulls and then I use that API in the frontend copilot already knows what I'm about to do and auto-fills the fetch.
Thanks :)