Merge branch 'main' into refactor/tool-calls

This commit is contained in:
sauravniraula 2025-08-28 14:01:40 +05:45
commit 0a23016d65
No known key found for this signature in database
GPG key ID: 60FCC1B5A5E83326
4 changed files with 36 additions and 11 deletions

View file

@ -160,9 +160,7 @@ Endpoint: `/api/v1/ppt/presentation/generate`
Method: `POST`
Content-Type: `multipart/form-data`
> **Note**: Make sure to set `Content-Type` as `multipart/form-data` and not `application/json`.
Content-Type: `application/json`
#### Request Body
@ -172,7 +170,6 @@ Content-Type: `multipart/form-data`
| n_slides | integer | No | Number of slides to generate (default: 8, min: 5, max: 15) |
| language | string | No | Language for the presentation (default: "English") |
| template | string | No | Presentation template (default: "general"). Available options: "classic", "general", "modern", "professional" + Custom templates |
| documents | File[] | No | Optional list of document files to include in the presentation. Supported file types: PDF, TXT, PPTX, DOCX |
| export_as | string | No | Export format ("pptx" or "pdf", default: "pptx") |
#### Response
@ -189,11 +186,14 @@ Content-Type: `multipart/form-data`
```bash
curl -X POST http://localhost:5000/api/v1/ppt/presentation/generate \
-F "prompt=Introduction to Machine Learning" \
-F "n_slides=5" \
-F "language=English" \
-F "template=general" \
-F "export_as=pptx"
-H "Content-Type: application/json" \
-d '{
"prompt": "Introduction to Machine Learning",
"n_slides": 5,
"language": "English",
"template": "general",
"export_as": "pptx"
}'
```
#### Example Response

View file

@ -122,7 +122,7 @@ const PresentationPage = ({ presentation_id }: { presentation_id: string }) => {
presentationData.slides.length > 0 &&
presentationData.slides.map((slide: any, index: number) => (
// [data-speaker-note] is used to extract the speaker note from the slide for export to pptx
<div key={index} className="w-full" data-speaker-note={slide.note}>
<div key={index} className="w-full" data-speaker-note={slide.speaker_note}>
{renderSlideContent(slide, true)}
</div>
))}

View file

@ -1,5 +1,5 @@
import React, { useEffect, useState, useMemo } from "react";
import { Loader2, PlusIcon, Trash2, WandSparkles } from "lucide-react";
import { Loader2, PlusIcon, Trash2, WandSparkles, StickyNote } from "lucide-react";
import {
Popover,
PopoverContent,
@ -174,6 +174,7 @@ const SlideContent = ({ slide, index, presentationId }: SlideContentProps) => {
presentationId={presentationId}
/>
)}
{!isStreaming && !loading && (
<ToolTip content="Delete slide">
<div
@ -245,6 +246,28 @@ const SlideContent = ({ slide, index, presentationId }: SlideContentProps) => {
</Popover>
</div>
)}
{/* Speaker Notes */}
{!isStreaming && slide?.speaker_note && (
<div className="absolute top-2 z-20 sm:top-4 right-8 sm:right-12 hidden md:block transition-transform">
<Popover>
<PopoverTrigger asChild>
<div className=" cursor-pointer ">
<ToolTip content="Show speaker notes">
<StickyNote className="text-xl text-gray-500" />
</ToolTip>
</div>
</PopoverTrigger>
<PopoverContent side="left" align="start" sideOffset={10} className="w-[320px] z-30">
<div className="space-y-2">
<p className="text-xs font-semibold text-gray-600">Speaker notes</p>
<div className="text-sm text-gray-800 whitespace-pre-wrap max-h-64 overflow-auto">
{slide.speaker_note}
</div>
</div>
</PopoverContent>
</Popover>
</div>
)}
</div>
</div>
</>

View file

@ -32,5 +32,7 @@ export interface Slide {
icons: string[] | null;
graph_id: string | null;
presentation?: string;
speaker_note?: string;
content: SlideContent;
}