Prompt position#

This module provides utils for changing the default prompt positions.

class PositionConfig(**data)[source]#

Bases: BaseModel

Configuration for prompts position. Lower number prompts will go before higher number prompts in the LLM history.

system_prompt: float#
history: float#
misc_prompt: float#
call_prompt: float#
last_turn: float#
class Prompt(message, position=None)[source]#

Bases: BaseModel

LLM Prompt. Provides position config and allow validating prompts from message or string.

message: AnnotatedAlias[Union[ConstResponse, BaseResponse]]#
position: Optional[float]#

Position for this prompt. If set to None, will fallback to either system_prompt, misc_prompt, call_prompt depending on where the type of this prompt.

classmethod validate_from_message(data)[source]#