input_model
Class info¶
Re-exported classes¶
| Class | Module | Description |
|---|---|---|
| DefaultInputHandler | llmling_models.models.input_model.input_handlers | Default input handler using standard input. |
| InputHandler | llmling_models.models.input_model.input_handlers | Protocol for input handlers. |
| InputModel | llmling_models.models.input_model.model | Model that delegates responses to human input. |
🛈 DocStrings¶
Input model.
DefaultInputHandler
¶
Bases: InputHandler
Default input handler using standard input.
Source code in src/llmling_models/models/input_model/input_handlers.py
format_messages
¶
Format messages for display.
Source code in src/llmling_models/models/input_model/input_handlers.py
get_input
¶
stream_input
async
¶
Simulate streaming input using standard input.
Source code in src/llmling_models/models/input_model/input_handlers.py
InputHandler
¶
Bases: Protocol
Protocol for input handlers.
Source code in src/llmling_models/models/input_model/input_handlers.py
InputModel
dataclass
¶
Bases: Model
Model that delegates responses to human input.
Source code in src/llmling_models/models/input_model/model.py
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | |
handler
class-attribute
instance-attribute
¶
handler: InputHandler | type[InputHandler] = field(default=DefaultInputHandler)
Input handler class to use.
input_prompt
class-attribute
instance-attribute
¶
Prompt to show when requesting input.
prompt_template
class-attribute
instance-attribute
¶
Template for showing the prompt to the human.
show_system
class-attribute
instance-attribute
¶
Whether to show system messages to the human.
request
async
¶
request(
messages: list[ModelMessage],
model_settings: ModelSettings | None,
model_request_parameters: ModelRequestParameters,
) -> ModelResponse
Get response from human input.
Source code in src/llmling_models/models/input_model/model.py
request_stream
async
¶
request_stream(
messages: list[ModelMessage],
model_settings: ModelSettings | None,
model_request_parameters: ModelRequestParameters,
run_context: RunContext[Any] | None = None,
) -> AsyncGenerator[StreamedResponse]
Stream responses character by character.