This commit is contained in:
zachary62 2025-01-02 16:31:52 +00:00
parent 97099a69f9
commit 3eda91c1e4
1 changed files with 3 additions and 3 deletions

View File

@ -12,7 +12,7 @@ In many use cases, you may want the LLM to output a specific structure, such as
There are several approaches to achieve a structured output:
- **Prompting** the LLM to strictly return a defined structure.
- Using LLMs that natively support **schema enforcement**.
- **Post-processing** the LLMs response to extract structured content.
- **Post-processing** the LLM's response to extract structured content.
In practice, **Prompting** is simple and reliable for modern LLMs.
@ -50,7 +50,7 @@ server:
## Prompt Engineering
When prompting the LLM to produce **structured** output:
1. **Wrap** the structure in code fences (e.g., ` ```yaml`).
1. **Wrap** the structure in code fences (e.g., `yaml`).
2. **Validate** that all required fields exist (and let `Node` handles retry).
### Example Text Summarization
@ -85,7 +85,7 @@ summary:
### Why YAML instead of JSON?
Current LLMs struggle with escaping. YAML is easier with strings since they dont always need quotes.
Current LLMs struggle with escaping. YAML is easier with strings since they don't always need quotes.
**In JSON**