quackamollie.core.meta.model.meta_quackamollie_model module

class quackamollie.core.meta.model.meta_quackamollie_model.MetaQuackamollieModel[source]

Bases: object

Metaclass for models managed by model managers

_abc_impl = <_abc._abc_data object>
abstract classmethod astream_answer(content: str, chat_history: List, model_config: str | None = None, **kwargs) AsyncIterable[Tuple[str, bool]][source]

Asynchronous iterator to stream the answer from a LLM model

Parameters:
  • content (str) – The new message content

  • chat_history (List) – A list of past messages formatted accordingly by model manager

  • model_config (Optional[str]) – Additional configuration given as a string through CLI or Telegram App Settings and retrieved from the database

  • kwargs (Dict) – Additional streaming arguments

Returns:

An asynchronous iterator giving a tuple containing the new chunk and a boolean indicating if the model is done or not

Return type:

AsyncIterable[Tuple[str, bool]]