slidedeckai.core#


Core functionality of SlideDeck AI.

SlideDeckAI

The main class for generating slide decks.

Core functionality of SlideDeck AI.

class slidedeckai.core.SlideDeckAI(model: str, topic: str, api_key: str | None = None, pdf_path_or_stream=None, pdf_page_range=None, template_idx: int = 0)[source]#

Bases: object

The main class for generating slide decks.

generate(progress_callback=None)[source]#

Generate the initial slide deck.

Parameters:

progress_callback – Optional callback function to report progress.

Returns:

The path to the generated .pptx file.

reset()[source]#

Reset the chat history and internal state.

revise(instructions: str, template_idx: int | None = None, progress_callback=None)[source]#

Revise the slide deck with new instructions.

Parameters:
  • instructions – The instructions for revising the slide deck.

  • template_idx – Optional index of the PowerPoint template to use for the revised deck.

  • progress_callback – Optional callback function to report progress.

Returns:

The path to the revised .pptx file.

Raises:

ValueError – If no slide deck exists or chat history is full.

set_model(model_name: str, api_key: str | None = None)[source]#

Set the LLM model (and API key) to use.

Parameters:
  • model_name – The name of the model to use.

  • api_key – The API key for the LLM provider.

Raises:

ValueError – If the model name is not in VALID_MODELS.

set_template(idx)[source]#

Set the PowerPoint template to use.

Parameters:

idx – The index of the template to use.