Skip to content

InputModelConfig

Base classes

Name Children Inherits
BaseModelConfig
llmling_models_config.configs
Base for model configurations.

⋔ Inheritance diagram

graph TD
  1454558168["configs.InputModelConfig"]
  3497727833["configs.BaseModelConfig"]
  330168112["schema.Schema"]
  3879467795["main.BaseModel"]
  2751680898["builtins.object"]
  3497727833 --> 1454558168
  330168112 --> 3497727833
  3879467795 --> 330168112
  2751680898 --> 3879467795

🛈 DocStrings

Bases: BaseModelConfig

Configuration for human input model.

Source code in src/llmling_models_config/configs.py
class InputModelConfig(BaseModelConfig):
    """Configuration for human input model."""

    model_config = ConfigDict(json_schema_extra={"x-doc-title": "Input model"})

    type: Literal["input"] = Field(default="input", init=False)
    """Type identifier for input model."""

    prompt_template: str = Field(
        default="👤 Please respond to: {prompt}",
        examples=["👤 Please respond to: {prompt}", "User input required: {prompt}"],
        title="Prompt display template",
    )
    """Template for displaying the prompt to the user."""

    show_system: bool = Field(default=True, title="Show system messages")
    """Whether to show system messages."""

    input_prompt: str = Field(
        default="Your response: ",
        examples=["Your response: ", "Enter reply: "],
        title="Input request text",
    )
    """Text displayed when requesting input."""

    handler: ImportString[Any] = Field(
        default="llmling_models:DefaultInputHandler",
        validate_default=True,
        title="Input handler",
    )
    """Handler for processing user input."""

    def get_model(self) -> InputModel:
        from llmling_models.models.input_model import InputModel

        return InputModel(
            prompt_template=self.prompt_template,
            show_system=self.show_system,
            input_prompt=self.input_prompt,
            handler=self.handler,
        )

handler class-attribute instance-attribute

handler: ImportString[Any] = Field(
    default="llmling_models:DefaultInputHandler", validate_default=True, title="Input handler"
)

Handler for processing user input.

input_prompt class-attribute instance-attribute

input_prompt: str = Field(
    default="Your response: ",
    examples=["Your response: ", "Enter reply: "],
    title="Input request text",
)

Text displayed when requesting input.

prompt_template class-attribute instance-attribute

prompt_template: str = Field(
    default="👤 Please respond to: {prompt}",
    examples=["👤 Please respond to: {prompt}", "User input required: {prompt}"],
    title="Prompt display template",
)

Template for displaying the prompt to the user.

show_system class-attribute instance-attribute

show_system: bool = Field(default=True, title='Show system messages')

Whether to show system messages.

type class-attribute instance-attribute

type: Literal['input'] = Field(default='input', init=False)

Type identifier for input model.

:fa-brands-github: Show source on GitHub