Skip to content

The agent engineering platform.

Slightly modified the docstring in `BasePromptTemplate` and `StringPromptTemplate`. (#1755)

hitoshi44e635c8614572
diff --git a/langchain/prompts/base.py b/langchain/prompts/base.py
index b85f31613a..af431373d8 100644
--- a/langchain/prompts/base.py
+++ b/langchain/prompts/base.py
@@ -72,7 +72,7 @@ class StringPromptValue(PromptValue):
class BasePromptTemplate(BaseModel, ABC):
- """Base prompt should expose the format method, returning a prompt."""
+ """Base class for all prompt templates, returning a prompt."""
input_variables: List[str]
"""A list of the names of the variables the prompt template expects."""
@@ -196,6 +196,8 @@ class BasePromptTemplate(BaseModel, ABC):
class StringPromptTemplate(BasePromptTemplate, ABC):
+ """String prompt should expose the format method, returning a prompt."""
+
def format_prompt(self, **kwargs: Any) -> PromptValue:
"""Create Chat Messages."""
return StringPromptValue(text=self.format(**kwargs))