Initialize Response Generators#

Initializes and returns an instance of a Response Generator.

src.openCHA.response_generators.initialize_response_generator.initialize_response_generator(llm: str = LLMType.OPENAI, response_generator: str = ResponseGeneratorType.BASE_GENERATOR, prefix: str = '', **kwargs: Any) BaseResponseGenerator[source]

This method provides a convenient way to initialize a response generator based on the specified language model type and response generator type. It handles the instantiation of the language model and the response generator class.

Parameters:
  • llm (str) – Type of language model type to be used.

  • response_generator (str) – Type of response generator to be initialized.

  • prefix (str) – Prefix to be added to generated responses.

  • **kwargs (Any) – Additional keyword arguments.

Returns:

Initialized instance of the response generator.

Return type:

BaseResponseGenerator

Example

from openCHA.llms import LLMType
from openCHA.response_generators import ResponseGeneratorType
response_generators = initialize_planner(llm=LLMType.OPENAI, response_generator=ResponseGeneratorType.BASE_GENERATOR)