Some Best Practices for Effective Prompts:
Prompt engineering does not have a set of rigid, pre-established rules. There is no official rulebook available that specifies some guidelines for prompt engineering. However, by adhering to certain best practices and principles, we can enhance the likelihood of obtaining optimal output from the LLM, leading to customer satisfaction.
a) Provide Instructions which is CLEAR & SPECIFIC:
Let's see a couple of example code-snippets and the output.
In the 1st example we will provide some content to the LLM to summarize. The content has been copied from Wikipedia. The model is instructed to summarize the texts within the triple backticks (```)
|
from langchain import PromptTemplate ... |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access