mirror of
https://github.com/hwchase17/langchain
synced 2024-11-06 03:20:49 +00:00
Fixed 1 missing line in getting_started.md (#2107)
Seems like a copy paste error. The very next example does have this line. Please tell me if I missed something in the process and should have created an issue or something first!
This commit is contained in:
parent
9d6f649ba5
commit
ef25904ecb
@ -355,13 +355,15 @@ Similar to LLMs, you can make use of templating by using a `MessagePromptTemplat
|
|||||||
For convience, there is a `from_template` method exposed on the template. If you were to use this template, this is what it would look like:
|
For convience, there is a `from_template` method exposed on the template. If you were to use this template, this is what it would look like:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
|
from langchain.chat_models import ChatOpenAI
|
||||||
from langchain.prompts.chat import (
|
from langchain.prompts.chat import (
|
||||||
ChatPromptTemplate,
|
ChatPromptTemplate,
|
||||||
SystemMessagePromptTemplate,
|
SystemMessagePromptTemplate,
|
||||||
AIMessagePromptTemplate,
|
|
||||||
HumanMessagePromptTemplate,
|
HumanMessagePromptTemplate,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
chat = ChatOpenAI(temperature=0)
|
||||||
|
|
||||||
template="You are a helpful assistant that translates {input_language} to {output_language}."
|
template="You are a helpful assistant that translates {input_language} to {output_language}."
|
||||||
system_message_prompt = SystemMessagePromptTemplate.from_template(template)
|
system_message_prompt = SystemMessagePromptTemplate.from_template(template)
|
||||||
human_template="{text}"
|
human_template="{text}"
|
||||||
@ -380,11 +382,10 @@ The `LLMChain` discussed in the above section can be used with chat models as we
|
|||||||
|
|
||||||
```python
|
```python
|
||||||
from langchain.chat_models import ChatOpenAI
|
from langchain.chat_models import ChatOpenAI
|
||||||
from langchain import PromptTemplate, LLMChain
|
from langchain import LLMChain
|
||||||
from langchain.prompts.chat import (
|
from langchain.prompts.chat import (
|
||||||
ChatPromptTemplate,
|
ChatPromptTemplate,
|
||||||
SystemMessagePromptTemplate,
|
SystemMessagePromptTemplate,
|
||||||
AIMessagePromptTemplate,
|
|
||||||
HumanMessagePromptTemplate,
|
HumanMessagePromptTemplate,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user