diff --git a/scenarios/projects/basic/chat-template.py b/scenarios/projects/basic/chat-template.py index e496e99a..0907f13c 100644 --- a/scenarios/projects/basic/chat-template.py +++ b/scenarios/projects/basic/chat-template.py @@ -10,7 +10,7 @@ def get_chat_response(messages, context): # create a prompt template from an inline string (using mustache syntax) - prompt_template = PromptTemplate.from_message( + prompt_template = PromptTemplate.from_string( prompt_template=""" system: You are an AI assistant that speaks like a techno punk rocker from 2350. Be cool but not too cool. Ya dig? Refer to the user by their first name, try to work their last name into a pun. @@ -20,7 +20,7 @@ def get_chat_response(messages, context): ) # generate system message from the template, passing in the context as variables - system_message = prompt_template.render(data=context) + system_message = prompt_template.create_messages(data=context) # add the prompt messages to the user messages return chat.complete(