Skip to main content
Helicone OSS LLM Observability

Use structured formats

Format the generated output to make it easier to interpret and parse the information.
2 min read

How to use structured formats#

  1. Provide a template or example output.
  2. Use clear delimiters and labels. For example, label sections and use delimiters to separate different parts of the response.
  3. Use formatting conventions. For example, "generate a Markdown-formatted summary with headings and bullet points".

Common structured formats#

  • JSON/XML: Ideal for data interchange between systems.
  • Bullet points/lists: Useful for summaries or step-by-step instructions.
  • Tables: Great for comparing data or presenting multiple related items.
  • Headings and subheadings: Organizes content for readability, especially in longer texts.
  • Custom templates: Tailored formats specific to your application's needs.

Examples#

Example 1: Customer support chatbot

A structured format allows the support team quickly identify the issue category (Billing), prioritize the request (High), and provides a ready-to-send response.

Prompt:

Example 2: Data entry automation

By specifying CSV format, the extracted data can be directly imported into databases or spreadsheets, saving time on data entry.

Prompt:

Example 3: Content creation for marketing

The structured prompt ensures all key marketing elements are included.

Prompt:

Example 4: Medical report summarization

The structured outputs help healthcare professionals quickly review critical patient information.

Prompt:

Tips for effective structured formatting#

  • Choose straightforward formats that the model can easily replicate.
  • Experiment with different prompts and refine them based on the model's outputs.
  • Include any necessary background information to aid model understanding.
  • Implement checks to validate that the responses meet your format requirements.