بتل کد Battle Codeدارد باز می‌شود…

Step 1: The Prompt with Borders چالش 1 از جلسه‌ی 72، آسان

تابع build_prompt(question, context) را بنویس که دقیقاً این چهار بخش را در چند خط برگرداند: خط دستور RULE، خط <context>، متن زمینه، خط </context>، و Question: <question>. خروجی:
Answer ONLY from the context below. If the answer is not there, say "I don't know".
<context>
Condensation is when the vapour cools high in the sky and forms clouds.
</context>
Question: What is condensation?

RULE = 'Answer ONLY from the context below. If the answer is not there, say "I don\'t know".'


def build_prompt(question, context):
    return question


chunk = "Condensation is when the vapour cools high in the sky and forms clouds."
print(build_prompt("What is condensation?", chunk))

راهنما و جواب این چالش · برگشت به درس جلسه‌ی 72: RAG کوچک (۲): از روی جزوه جواب بده · چالش بعدی: Step 2: Search, Ask, Cite

بیشتر بخوان: تابع در پایتون: آموزش def، پارامتر و return با مثال