Skip to content

Commit

Permalink
Merge pull request #18 from barun-saha/visual
Browse files Browse the repository at this point in the history
Update the prompts
  • Loading branch information
barun-saha authored May 5, 2024
2 parents 4c0ac93 + 257cfa2 commit c59fc17
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 35 deletions.
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Describe your topic and let SlideDeck AI generate a PowerPoint slide deck for yo
SlideDeck AI is powered by [Mistral 7B Instruct](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2).
Originally, it was built using the Llama 2 API provided by Clarifai.

*Update*: Legacy SlideDeck AI allowed one-shot generation of a slide deck based on the inputs.
*Update (v4.0)*: Legacy SlideDeck AI allowed one-shot generation of a slide deck based on the inputs.
In contrast, SlideDeck AI *Reloaded* enables an iterative workflow with a conversational interface,
where you can create and improve the presentation.

Expand All @@ -33,7 +33,7 @@ The output is generated as structured JSON data based on a pre-defined schema.
2. Subsequently, it uses the `python-pptx` library to generate the slides,
based on the JSON data from the previous step.
A user can choose from a set of three pre-defined presentation templates.
3. At this stage onward, a user can provide additional instructions to refine the content.
3. At this stage onward, a user can provide additional instructions to *refine* the content.
For example, one can ask to add another slide or modify an existing slide.
A history of instructions is maintained.
4. Every time SlideDeck AI generates a PowerPoint presentation, a download button is provided.
Expand All @@ -42,9 +42,6 @@ Clicking on the button will download the file.

# Known Issues

- **Incorrect JSON**: Sometimes the JSON generated could be syntactically incorrect.
You can try asking SlideDeck AI to regenerate the content and fix the JSON syntax error.
This, however, is not guaranteed to work. The alternative is to reload the website and try again.
- **Connection timeout**: Requests sent to the Hugging Face Inference endpoint might time out.
A maximum of five retries are attempted. If it still does not work, wait for a while and try again.

Expand Down
21 changes: 8 additions & 13 deletions langchain_templates/chat_prompts/initial_template_v3_two_cols.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
You are a helpful, intelligent chatbot. Create the slides for a presentation on the given topic.
Include main headings for each slide, detailed bullet points for each slide.
Add relevant content to each slide.
The content of each slide should be verbose, descriptive, and very detailed.
If relevant, add one or two examples to illustrate the concept.
Unless explicitly specified with the topic, create about 10 slides.
The content of each slide should be VERBOSE, DESCRIPTIVE, and very DETAILED.
If relevant, add one or two EXAMPLES to illustrate the concept.
For two or three important slides, generate the key message that those slides convey.
Identify if a slide describes a step-by-step/sequential process, then begin the bullet points with a special marker >>. Limit this to max two or three slides.
Also, add at least one slide with a double column layout by generating appropriate content based on the description in the JSON schema provided below.
ALWAYS add a concluding slide at the end, containing a list of the key takeways and an optional call-to-action if relevant to the context.
Unless explicitly instructed, create 10 TO 12 SLIDES in total.


### Topic:
Expand Down Expand Up @@ -45,7 +49,7 @@ The output must be only a valid and syntactically correct JSON adhering to the f
"key_message": ""
}},
{{
"heading": "A slide with a double column layout (useful for side-by-side comparison/contrasting of related concepts, e.g., pros & cons, advantages & risks, old approach vs. modern approach, and so on)",
"heading": "A slide with a double column layout (useful for side-by-side comparison/contrasting of two related concepts, e.g., pros & cons, advantages & risks, old approach vs. modern approach, and so on)",
"bullet_points": [
{{
"heading": "Heading of the left column",
Expand All @@ -70,14 +74,5 @@ The output must be only a valid and syntactically correct JSON adhering to the f
}}


### Some more hints on the slide content and JSON output format:
- For two or three important slides, generate the key message that those slides convey and assign
them to the `key_message` elements of JSON output.
- Identify if a slide describes a step-by-step/sequential process, then begin the bullet points
with a special marker >>. Limit this to max two or three slides.
- Add at least one slide with double column layout by generating appropriate content based on
the description in the above JSON schema.


### Output:
```json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ The previously generated content of the slide deck in JSON format is also provid
Follow the instructions to revise the content of the previously generated slides of the presentation on the given topic.
Include main headings for each slide, detailed bullet points for each slide.
Add relevant content to each slide.
The content of the slides should be descriptive, verbose, and detailed.
If relevant, add one or two examples to illustrate the concept.
Unless explicitly specified with the topic, create about 10 slides.
You also fix any syntax error that may be present in the JSON-formatted content.

A slide that describes a step-by-step/sequential process begins the bullet points
with a special marker >>
The content of each slide should be VERBOSE, DESCRIPTIVE, and very DETAILED.
If relevant, add one or two EXAMPLES to illustrate the concept.
For two or three important slides, generate the key message that those slides convey.
Identify if a slide describes a step-by-step/sequential process, then begin the bullet points with a special marker >>. Limit this to max two or three slides.
Also, add at least one slide with a double column layout by generating appropriate content based on the description in the JSON schema provided below.
ALWAYS add a concluding slide at the end, containing a list of the key takeways and an optional call-to-action if relevant to the context.
Unless explicitly instructed, create 10 TO 12 SLIDES in total.


### List of instructions:
Expand Down Expand Up @@ -56,7 +56,7 @@ The output must be only a valid and syntactically correct JSON adhering to the f
"key_message": ""
}},
{{
"heading": "A slide with a double column layout (useful for side-by-side comparison/contrasting of related concepts, e.g., pros & cons, advantages & risks, old approach vs. modern approach, and so on)",
"heading": "A slide with a double column layout (useful for side-by-side comparison/contrasting of two related concepts, e.g., pros & cons, advantages & risks, old approach vs. modern approach, and so on)",
"bullet_points": [
{{
"heading": "Heading of the left column",
Expand All @@ -81,14 +81,5 @@ The output must be only a valid and syntactically correct JSON adhering to the f
}}


### Some more hints on the slide content and JSON output format:
- For two or three important slides, generate the key message that those slides convey and assign
them to the `key_message` elements of JSON output.
- Identify if a slide describes a step-by-step/sequential process, then begin the bullet points
with a special marker >>. Limit this to max two or three slides.
- Add at least one slide with double column layout by generating appropriate content based on
the description in the above JSON schema.


### Output:
```json

0 comments on commit c59fc17

Please sign in to comment.