instructor
instructor copied to clipboard
feat: add markdown yaml input mode to optimize input tokens
Addresses #654
| :rocket: This description was created by Ellipsis for commit 7c668e09d6597ce7ef6316bebed658031f2b3f52 |
|---|
Summary:
Introduces MD_YAML mode to parse YAML inputs within markdown, updating necessary files and tests to support this new functionality.
Key points:
- Added
MD_YAMLmode to handle YAML inputs in markdown. - Updated
instructor/client.py,instructor/function_calls.py,instructor/mode.py,instructor/process_response.py, andinstructor/retry.pyto support new mode. - Added new utility function
extract_json_from_yaml_codeblockininstructor/utils.py. - Included tests for
MD_YAMLmode intests/llm/test_openai/test_modes.py.
Generated with :heart: by ellipsis.dev
Sweep: PR Review
Sweep is currently reviewing your pr...
please add documentation on YAML in patching
can you add the docs in patch.md? @ellipsis-dev
@jxnl, I have addressed your comments in pull request https://github.com/jxnl/instructor/pull/688