instructor icon indicating copy to clipboard operation
instructor copied to clipboard

feat: add markdown yaml input mode to optimize input tokens

Open ssonal opened this issue 1 year ago • 4 comments

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_YAML mode to handle YAML inputs in markdown.
  • Updated instructor/client.py, instructor/function_calls.py, instructor/mode.py, instructor/process_response.py, and instructor/retry.py to support new mode.
  • Added new utility function extract_json_from_yaml_codeblock in instructor/utils.py.
  • Included tests for MD_YAML mode in tests/llm/test_openai/test_modes.py.

Generated with :heart: by ellipsis.dev

ssonal avatar May 17 '24 06:05 ssonal

Sweep: PR Review

Sweep is currently reviewing your pr...

please add documentation on YAML in patching

jxnl avatar May 19 '24 23:05 jxnl

can you add the docs in patch.md? @ellipsis-dev

jxnl avatar May 20 '24 04:05 jxnl

@jxnl, I have addressed your comments in pull request https://github.com/jxnl/instructor/pull/688

ellipsis-dev[bot] avatar May 20 '24 04:05 ellipsis-dev[bot]