evolving_ideas.strategies

Strategies for idea evolution.

Submodules

Classes

MethodStrategy

Abstract base class for strategy methods in the evolving ideas application.

ClassicMethod

A strategy for classic brainstorming techniques.

Registry

A registry for storing and managing strategies.

ScamperMethod

A strategy for the SCAMPER brainstorming technique.

Functions

select_method(→ str)

Selects a brainstorming method based on keywords in the task description.

Package Contents

class evolving_ideas.strategies.MethodStrategy(llm_responder: evolving_ideas.infra.responder.LLMResponder, builder: evolving_ideas.prompts.builder.PromptBuilder | None = None, chat_logger: evolving_ideas.interface.presenters.ChatLogger | None = None)

Bases: 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.

builder: evolving_ideas.prompts.builder.PromptBuilder
llm_responder
logger
abstract run(role: str, task: str, context: str) dict

Abstract method to run the strategy with the given parameters.

Parameters:
  • role (str) – The role of the AI.

  • task (str) – The task to be performed.

  • context (str) – Context for the idea.

Returns:

A dictionary containing the results of the strategy.

Return type:

dict

class evolving_ideas.strategies.ClassicMethod(llm_responder: evolving_ideas.infra.responder.LLMResponder, builder: evolving_ideas.prompts.builder.PromptBuilder | None = None, chat_logger: evolving_ideas.interface.presenters.ChatLogger | None = None)

Bases: evolving_ideas.strategies.base.MethodStrategy

A strategy for classic brainstorming techniques.

run(role: str, task: str, context: str) dict

Abstract method to run the strategy with the given parameters.

Parameters:
  • role (str) – The role of the AI.

  • task (str) – The task to be performed.

  • context (str) – Context for the idea.

Returns:

A dictionary containing the results of the strategy.

Return type:

dict

class evolving_ideas.strategies.Registry

A registry for storing and managing strategies.

strategies
classmethod register(name: str, strategy: Type)

Register a new strategy.

Parameters:
  • name – The name of the strategy.

  • strategy – The strategy class.

classmethod get(name: str, *args, **kwargs) Type | None

Get a registered strategy by name.

Parameters:

name – The name of the strategy.

Returns:

The strategy class or None if not found.

evolving_ideas.strategies.select_method(task: str) str

Selects a brainstorming method based on keywords in the task description.

Parameters:

task (str) – The task description to analyze.

Returns:

The name of the selected method.

Return type:

str

class evolving_ideas.strategies.ScamperMethod(llm_responder: evolving_ideas.infra.responder.LLMResponder, builder: evolving_ideas.prompts.builder.PromptBuilder | None = None, chat_logger: evolving_ideas.interface.presenters.ChatLogger | None = None)

Bases: evolving_ideas.strategies.base.MethodStrategy

A strategy for the SCAMPER brainstorming technique.

SCAMPER_STEPS = ['Substitute', 'Combine', 'Adapt', 'Modify', 'Put to another use', 'Eliminate', 'Reverse']
run(role: str, task: str, context: str) dict

Abstract method to run the strategy with the given parameters.

Parameters:
  • role (str) – The role of the AI.

  • task (str) – The task to be performed.

  • context (str) – Context for the idea.

Returns:

A dictionary containing the results of the strategy.

Return type:

dict