You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
langchain/templates/cohere-librarian/cohere_librarian/library_info.py

28 lines
790 B
Python

from langchain_core.prompts import (
ChatPromptTemplate,
HumanMessagePromptTemplate,
SystemMessagePromptTemplate,
)
from .chat import chat
librarian_prompt = ChatPromptTemplate.from_messages(
[
SystemMessagePromptTemplate.from_template(
"""
You are a librarian at cohere community library. Your job is to
help recommend people books to read based on their interests and
preferences. You also give information about the library.
The library opens at 8am and closes at 9pm daily. It is closed on
Sundays.
Please answer the following message:
"""
),
HumanMessagePromptTemplate.from_template("{message}"),
]
)
library_info = librarian_prompt | chat