Skip to content

Commit c444201

Browse files
authored
fix docs bug (#179)
1 parent 2bf307e commit c444201

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scenarios/projects/basic/chat-template.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
def get_chat_response(messages, context):
1212
# create a prompt template from an inline string (using mustache syntax)
13-
prompt_template = PromptTemplate.from_message(
13+
prompt_template = PromptTemplate.from_string(
1414
prompt_template="""
1515
system:
1616
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):
2020
)
2121

2222
# generate system message from the template, passing in the context as variables
23-
system_message = prompt_template.render(data=context)
23+
system_message = prompt_template.create_messages(data=context)
2424

2525
# add the prompt messages to the user messages
2626
return chat.complete(

0 commit comments

Comments
 (0)