-
-
Notifications
You must be signed in to change notification settings - Fork 510
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…to optimize input tokens);
- Loading branch information
1 parent
7c668e0
commit f61fd78
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
|
||
## YAML in Patching | ||
|
||
The system now supports a new mode, `MD_YAML`, to handle YAML inputs within markdown. This mode allows the system to parse YAML inputs and convert them into JSON for further processing. | ||
|
||
To use this mode, you need to specify it when calling the `patch` function, like so: | ||
|
||
```python | ||
client = instructor.patch(client, mode=instructor.Mode.MD_YAML) | ||
``` | ||
|
||
You can then provide YAML inputs within markdown. Here's an example: | ||
|
||
```yaml | ||
Order Details: | ||
Customer: Jason | ||
Items: | ||
|
||
Name: Apple, Price: 0.50 | ||
Name: Bread, Price: 2.00 | ||
Name: Milk, Price: 1.50 | ||
``` | ||
|
||
The system will parse this input and convert it into a JSON object for further processing. |