tools
This commit is contained in:
parent
97099a69f9
commit
3eda91c1e4
|
|
@ -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:
|
There are several approaches to achieve a structured output:
|
||||||
- **Prompting** the LLM to strictly return a defined structure.
|
- **Prompting** the LLM to strictly return a defined structure.
|
||||||
- Using LLMs that natively support **schema enforcement**.
|
- Using LLMs that natively support **schema enforcement**.
|
||||||
- **Post-processing** the LLM’s 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.
|
In practice, **Prompting** is simple and reliable for modern LLMs.
|
||||||
|
|
||||||
|
|
@ -50,7 +50,7 @@ server:
|
||||||
## Prompt Engineering
|
## Prompt Engineering
|
||||||
|
|
||||||
When prompting the LLM to produce **structured** output:
|
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).
|
2. **Validate** that all required fields exist (and let `Node` handles retry).
|
||||||
|
|
||||||
### Example Text Summarization
|
### Example Text Summarization
|
||||||
|
|
@ -85,7 +85,7 @@ summary:
|
||||||
|
|
||||||
### Why YAML instead of JSON?
|
### Why YAML instead of JSON?
|
||||||
|
|
||||||
Current LLMs struggle with escaping. YAML is easier with strings since they don’t always need quotes.
|
Current LLMs struggle with escaping. YAML is easier with strings since they don't always need quotes.
|
||||||
|
|
||||||
**In JSON**
|
**In JSON**
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue