Using `PromptTemplate.from_template()` for Simple Templates
LangChain provides several ways to construct prompt templates, catering to varying levels of complexity and control. For straightforward scenarios where your prompt is a single string with clearly defined placeholders, the `PromptTemplate.from_template()` class method offers the most direct and concise approach.
This method takes a single argument: the template string itself. Within this string, you define variables using curly braces `{}`. These variables act as placeholders that will be replaced with actual values when the template is later formatted.
To use `from_template()`, you first need to import the `PromptTemplate` class from the `langchain_core.prompts` module. Once imported, you can call the method directly on the class, passing your template string.