evolving_ideas.domain.repositories.idea_repository¶
evolving_ideas.domain.repositories.idea_repository
Classes¶
Repository for managing ideas and their versions. |
Module Contents¶
- class evolving_ideas.domain.repositories.idea_repository.IdeaRepository(store_path: pathlib.Path)¶
Repository for managing ideas and their versions. This class provides methods to add, load, and list ideas stored in a directory.
- store_path¶
- add(role: str, task: str, qna: List[evolving_ideas.domain.models.idea.QAPair], summary: str, author: str | None, method: str | None, method_metadata: dict | None) evolving_ideas.domain.services.idea_tree.IdeaTree ¶
Adds a new idea to the repository.
- Parameters:
role (str) – The role of the author (e.g., “developer”, “designer”).
task (str) – The task or idea description.
qna (List[QAPair]) – A list of question and answer pairs related to the idea.
summary (str) – A summary of the idea.
author (str) – The author of the idea (default is “santiago”).
- Returns:
An IdeaTree object representing the newly created idea.
- Return type:
- load(idea_id: str) evolving_ideas.domain.services.idea_tree.IdeaTree ¶
Loads an idea from the repository by its ID.
- Parameters:
idea_id (str) – The unique identifier of the idea to load.
- Returns:
An IdeaTree object representing the loaded idea.
- Return type:
- Raises:
FileNotFoundError – If the idea with the given ID does not exist.
- list() List[str] ¶
Lists all ideas stored in the repository.
- Returns:
A list of idea names (directories) in the store path.
- Return type:
List[str]