Return a partial of the prompt template.
(self, **kwargs: Union[str, Callable[[], str]])
| 179 | return self.format_prompt(**kwargs) |
| 180 | |
| 181 | def partial(self, **kwargs: Union[str, Callable[[], str]]) -> BasePromptTemplate: |
| 182 | """Return a partial of the prompt template.""" |
| 183 | prompt_dict = self.__dict__.copy() |
| 184 | prompt_dict["input_variables"] = list( |
| 185 | set(self.input_variables).difference(kwargs) |
| 186 | ) |
| 187 | prompt_dict["partial_variables"] = {**self.partial_variables, **kwargs} |
| 188 | return type(self)(**prompt_dict) |
| 189 | |
| 190 | def _merge_partial_and_user_variables(self, **kwargs: Any) -> Dict[str, Any]: |
| 191 | # Get partial params: |