evolving_ideas.strategies ========================= .. py:module:: evolving_ideas.strategies .. autoapi-nested-parse:: Strategies for idea evolution. Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/evolving_ideas/strategies/base/index /autoapi/evolving_ideas/strategies/classic/index /autoapi/evolving_ideas/strategies/lotus_blossom/index /autoapi/evolving_ideas/strategies/registry/index /autoapi/evolving_ideas/strategies/router/index /autoapi/evolving_ideas/strategies/scamper/index /autoapi/evolving_ideas/strategies/six_hats/index Classes ------- .. autoapisummary:: evolving_ideas.strategies.MethodStrategy evolving_ideas.strategies.ClassicMethod evolving_ideas.strategies.Registry evolving_ideas.strategies.ScamperMethod Functions --------- .. autoapisummary:: evolving_ideas.strategies.select_method Package Contents ---------------- .. py:class:: MethodStrategy(llm_responder: evolving_ideas.infra.responder.LLMResponder, builder: Optional[evolving_ideas.prompts.builder.PromptBuilder] = None, chat_logger: Optional[evolving_ideas.interface.presenters.ChatLogger] = None) Bases: :py:obj:`abc.ABC` Abstract base class for strategy methods in the evolving ideas application. This class defines the interface for all strategy methods that can be implemented for generating and evolving ideas. .. py:attribute:: builder :type: evolving_ideas.prompts.builder.PromptBuilder .. py:attribute:: llm_responder .. py:attribute:: logger .. py:method:: run(role: str, task: str, context: str) -> dict :abstractmethod: Abstract method to run the strategy with the given parameters. :param role: The role of the AI. :type role: str :param task: The task to be performed. :type task: str :param context: Context for the idea. :type context: str :return: A dictionary containing the results of the strategy. :rtype: dict .. py:class:: ClassicMethod(llm_responder: evolving_ideas.infra.responder.LLMResponder, builder: Optional[evolving_ideas.prompts.builder.PromptBuilder] = None, chat_logger: Optional[evolving_ideas.interface.presenters.ChatLogger] = None) Bases: :py:obj:`evolving_ideas.strategies.base.MethodStrategy` A strategy for classic brainstorming techniques. .. py:method:: run(role: str, task: str, context: str) -> dict Abstract method to run the strategy with the given parameters. :param role: The role of the AI. :type role: str :param task: The task to be performed. :type task: str :param context: Context for the idea. :type context: str :return: A dictionary containing the results of the strategy. :rtype: dict .. py:class:: Registry A registry for storing and managing strategies. .. py:attribute:: strategies .. py:method:: register(name: str, strategy: Type) :classmethod: Register a new strategy. :param name: The name of the strategy. :param strategy: The strategy class. .. py:method:: get(name: str, *args, **kwargs) -> Optional[Type] :classmethod: Get a registered strategy by name. :param name: The name of the strategy. :return: The strategy class or None if not found. .. py:function:: select_method(task: str) -> str Selects a brainstorming method based on keywords in the task description. :param task: The task description to analyze. :type task: str :return: The name of the selected method. :rtype: str .. py:class:: ScamperMethod(llm_responder: evolving_ideas.infra.responder.LLMResponder, builder: Optional[evolving_ideas.prompts.builder.PromptBuilder] = None, chat_logger: Optional[evolving_ideas.interface.presenters.ChatLogger] = None) Bases: :py:obj:`evolving_ideas.strategies.base.MethodStrategy` A strategy for the SCAMPER brainstorming technique. .. py:attribute:: SCAMPER_STEPS :value: ['Substitute', 'Combine', 'Adapt', 'Modify', 'Put to another use', 'Eliminate', 'Reverse'] .. py:method:: run(role: str, task: str, context: str) -> dict Abstract method to run the strategy with the given parameters. :param role: The role of the AI. :type role: str :param task: The task to be performed. :type task: str :param context: Context for the idea. :type context: str :return: A dictionary containing the results of the strategy. :rtype: dict