LLMFunctionWithPrompt#
- class council.llm.LLMFunctionWithPrompt(llm: LLMBase | LLMMiddlewareChain, response_parser: Callable[[LLMResponse], T_Response], prompt_config: LLMPromptConfigObject, max_retries: int = 3, system_prompt_params: Mapping[str, str] | None = None)[source]#
Bases:
LLMFunction[T_Response]Represents an LLMFunction created with LLMPrompt
- __init__(llm: LLMBase | LLMMiddlewareChain, response_parser: Callable[[LLMResponse], T_Response], prompt_config: LLMPromptConfigObject, max_retries: int = 3, system_prompt_params: Mapping[str, str] | None = None) None[source]#
Initializes the LLMFunctionWithPrompt with an ability to format system prompt.
- execute(user_message: str | LLMMessage | None = None, messages: Iterable[LLMMessage] | None = None, user_prompt_params: Mapping[str, str] | None = None, **kwargs: Any) T_Response[source]#
Execute LLMFunctionWithPrompt with an ability to format user prompt.