mirror of
https://github.com/hwchase17/langchain
synced 2024-11-08 07:10:35 +00:00
accept openai terms (#9826)
This commit is contained in:
parent
c1badc1fa2
commit
610f46d83a
@ -674,18 +674,18 @@ def _create_template_from_message_type(
|
||||
Returns:
|
||||
a message prompt template of the appropriate type.
|
||||
"""
|
||||
if message_type == "human":
|
||||
if message_type in ("human", "user"):
|
||||
message: BaseMessagePromptTemplate = HumanMessagePromptTemplate.from_template(
|
||||
template
|
||||
)
|
||||
elif message_type == "ai":
|
||||
elif message_type in ("ai", "assistant"):
|
||||
message = AIMessagePromptTemplate.from_template(template)
|
||||
elif message_type == "system":
|
||||
message = SystemMessagePromptTemplate.from_template(template)
|
||||
else:
|
||||
raise ValueError(
|
||||
f"Unexpected message type: {message_type}. Use one of 'human', 'ai', "
|
||||
f"or 'system'."
|
||||
f"Unexpected message type: {message_type}. Use one of 'human',"
|
||||
f" 'user', 'ai', 'assistant', or 'system'."
|
||||
)
|
||||
return message
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user