Skip to content

Commit

Permalink
address comments left by @jxnl on #674 (Add markdown yaml input mode …
Browse files Browse the repository at this point in the history
…to optimize input tokens);
  • Loading branch information
ellipsis-dev[bot] committed May 20, 2024
1 parent 7c668e0 commit f61fd78
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions patch.md
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.

0 comments on commit f61fd78

Please sign in to comment.