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 ...

Get Enterprise GENERATIVE AI Well-Architected Framework & Patterns now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.