Skip to content
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

Closed
hitoshi44 opened this issue Mar 18, 2023 · 0 comments
Closed

Document for a custom prompt template is outdated. #1754

hitoshi44 opened this issue Mar 18, 2023 · 0 comments

Comments

@hitoshi44
Copy link
Contributor

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:

  1. The document outlines creating a custom prompt template by inheriting from BasePromptTemplate with only the format method. However, a new required method format_prompt has been introduced as an interface for adapting chat-style prompt template usage.
  2. Maybe, the StringPromptTemplate was created to absorb the change, but it is currently not exposed.

Therefore, I suggest using StringPromptTemplate instead of BasePromptTemplate, and exposing it in langchain.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 and StringPromptTemplate, as their current docstrings are outdated and require updating in relation to the issue at hand.

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant