Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions scenarios/projects/basic/chat-template.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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(
Expand Down
Loading