LLM Module

The rakam_systems.generation.llm module provides the LLM class for interacting with large language models (LLMs) such as OpenAI’s GPT models.

Classes

rakam_systems.generation.llm.LLM(model[, ...])

LLM

class rakam_systems.generation.llm.LLM(model: str, api_key: str | None = None)

Bases: object

The LLM class handles interactions with OpenAI models and provides methods for generating responses in both streaming and non-streaming modes.

call_llm(sys_prompt: str, prompt: str) str
call_llm_stream(sys_prompt: str, prompt: str)

Methods:

  • call_llm: Calls the LLM in non-streaming mode and returns the result.

  • call_llm_stream: Calls the LLM in streaming mode and yields response chunks.