liveBook · Manning

Prompt

As explained in Snowflake Data Engineering

A prompt is a set of questions or instructions and supporting context supplied to a generative model to guide its output.

A prompt is a set of questions or instructions plus supporting context that guides a generative model's output. In a data pipeline, it can direct an LLM to read customer email, extract order details, format them as CSV, and support storage in a Snowflake table. section 7.4 section 7.5

Construct an effective prompt by:

  • State the task and intended output unambiguously. section 7.4.2
  • Include enough background, such as the email content and permitted item values. section 7.4.2
  • Specify the output structure, column names, and formatting rules, including YYYY-MM-DD dates. section 7.4.2
  • Refine the instructions across iterations when the model produces unsatisfactory results. section 7.4.2

Email-to-order extraction

A bakery prompt asks the model to read a delivery email and return customer, order date, delivery date, item, and quantity as CSV. The resulting data can be converted to a data frame and saved to Snowflake. section 7.4 section 7.4.2

  prompt = f"""You are a bakery employee, reading customer emails asking
   for deliveries. Please read the email at the end of this text and
   extract information about the ordered items. Format the information in
   CSV using the following columns: customer, order_date, delivery_date,
   item, and quantity. Format the date as YYYY-MM-DD. If no year is given,
   assume the current year. Use the current date in the format YYYY-MM-DD
   for the order date. Items should be in this list: [white loaf, rye loaf,
   baguette, bagel, croissant, chocolate muffin, blueberry muffin]. The
   content of the email follows this line. \n {email_content}"""

Runnable prompt construction combines task instructions, schema, date rules, allowed values, and the email content. section 7.4.2

  csv_output = Complete('snowflake-arctic', prompt)

The constructed prompt is passed to Snowflake Cortex COMPLETE with the snowflake-arctic model. section 7.4.2

How Snowflake Data Engineering covers it

How deep it goes
Defines prompt engineering and demonstrates iterative, schema-constrained construction, but does not explain LLM internals.
Examples
Uses bakery delivery emails, constrained bakery items, five CSV columns, and YYYY-MM-DD date formatting.
What it assumes
Assumes familiarity with customer email content and structured records while teaching explicit instructions, context, and output formatting.
What you can do after
Build it from scratch by writing prompts that produce structured LLM output for downstream transformation and storage.
How it connects
Connects generative AI, LLMs, Snowflake Cortex COMPLETE, stored procedures, CSV, data frames, and Snowflake tables.

Also explained in

Compare how 50 books explain prompt →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Snowflake Data Engineering. The section links point to the parts of the book it draws on.