|
|
|
@ -109,11 +109,13 @@ class FewShotPromptTemplate(BasePromptTemplate, BaseModel):
|
|
|
|
|
# Format the template with the input variables.
|
|
|
|
|
return DEFAULT_FORMATTER_MAPPING[self.template_format](template, **kwargs)
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
|
def _prompt_type(self) -> str:
|
|
|
|
|
"""Return the prompt type key."""
|
|
|
|
|
return "few_shot"
|
|
|
|
|
|
|
|
|
|
def dict(self, **kwargs: Any) -> Dict:
|
|
|
|
|
"""Return a dictionary of the prompt."""
|
|
|
|
|
if self.example_selector:
|
|
|
|
|
raise ValueError("Saving an example selector is not currently supported")
|
|
|
|
|
|
|
|
|
|
prompt_dict = super().dict()
|
|
|
|
|
prompt_dict["_type"] = "few_shot"
|
|
|
|
|
return prompt_dict
|
|
|
|
|
return super().dict(**kwargs)
|
|
|
|
|