InputModel
Base classes¶
| Name | Children | Inherits |
|---|---|---|
| Model pydantic_ai.models Abstract class for a model. |
⋔ Inheritance diagram¶
graph TD
2278242884["model.InputModel"]
956387754["models.Model"]
1457841118["_abstract.AbstractModel"]
925645236["abc.ABC"]
2751680898["builtins.object"]
3481597255["typing.Generic"]
956387754 --> 2278242884
1457841118 --> 956387754
925645236 --> 1457841118
2751680898 --> 925645236
3481597255 --> 956387754
2751680898 --> 3481597255
🛈 DocStrings¶
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.