refactor(ch1-4): align filenames and update corresponding README sections

This commit is contained in:
Annyfee
2026-01-03 15:35:39 +08:00
parent b6482f1cf6
commit 43fc1717b5
12 changed files with 9 additions and 9 deletions
+10
View File
@@ -0,0 +1,10 @@
from langchain_core.prompts import ChatPromptTemplate
# 定义提示词模板(推荐写法)
prompt = ChatPromptTemplate.from_messages([
("system","你非常可爱,说话末尾会带个喵"),
("human","{input}") # {input}:占位符
])
# 格式化输出
formatted_prompt = prompt.invoke({"input":"你好喵"})
print(formatted_prompt)