-
Notifications
You must be signed in to change notification settings - Fork 13.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document for a custom prompt template is outdated. #1754
Comments
This was referenced Mar 18, 2023
hwchase17
pushed a commit
that referenced
this issue
Mar 19, 2023
…omptTemplate`. (#1755) Regarding [this issue](#1754), `BasePromptTample` class docstring is a little outdated, thus it requires new method `format_prompt` for now. As such, I have made some modifications to the docstring to bring it up to date. I tried to adhere to the established document style, and would appreciate you for taking a look at this PR.
hwchase17
pushed a commit
that referenced
this issue
Mar 19, 2023
…e. (#1753) Regarding [this issue](#1754), the code in the document [Creating a custom prompt template](https://langchain.readthedocs.io/en/latest/modules/prompts/examples/custom_prompt_template.html) is no longer functional and outdated. To address this, I have made the following changes: 1. Updated the guide in the document to use `StringPromptTemplate` instead of `BasePromptTemplate`. 2. Exposed `StringPromptTemplate` in `prompts/__init__.py` for easier importing.
wertycn
pushed a commit
to wertycn/langchain-zh
that referenced
this issue
Apr 26, 2023
…e. (#1753) Regarding [this issue](langchain-ai/langchain#1754), the code in the document [Creating a custom prompt template](https://langchain.readthedocs.io/en/latest/modules/prompts/examples/custom_prompt_template.html) is no longer functional and outdated. To address this, I have made the following changes: 1. Updated the guide in the document to use `StringPromptTemplate` instead of `BasePromptTemplate`. 2. Exposed `StringPromptTemplate` in `prompts/__init__.py` for easier importing.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, the document on Creating a custom prompt template is outdated, as the code in the guide is no longer functional for the following reasons:
BasePromptTemplate
with only theformat
method. However, a new required methodformat_prompt
has been introduced as an interface for adapting chat-style prompt template usage.StringPromptTemplate
was created to absorb the change, but it is currently not exposed.Therefore, I suggest using
StringPromptTemplate
instead ofBasePromptTemplate
, and exposing it inlangchain.prompts
.I have created a PR#1753 for this, and would appreciate it if you could review it.
Additionally, I have created another PR to slightly modify the class docstring for both
BasePromptTemplate
andStringPromptTemplate
, as their current docstrings are outdated and require updating in relation to the issue at hand.The text was updated successfully, but these errors were encountered: