-
-
Notifications
You must be signed in to change notification settings - Fork 641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add markdown yaml input mode to optimize input tokens #674
Conversation
Sweep: PR ReviewSweep is currently reviewing your pr... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Changes requested. Reviewed everything up to 7c668e0 in 1 minute and 39 seconds
More details
- Looked at
223
lines of code in7
files - Skipped
0
files when reviewing. - Skipped posting
0
drafted comments based on config settings.
Workflow ID: wflow_YXhckZ45Xh1hPqc8
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
@@ -70,6 +71,16 @@ def extract_json_from_codeblock(content: str) -> str: | |||
return content[first_paren : last_paren + 1] | |||
|
|||
|
|||
def extract_json_from_yaml_codeblock(content: str) -> str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function name extract_json_from_yaml_codeblock
is misleading as it performs YAML to JSON conversion. Consider renaming it to reflect its functionality more accurately, such as convert_yaml_to_json
.
please add documentation on YAML in patching |
can you add the docs in patch.md? @ellipsis-dev |
…to optimize input tokens);
Addresses #654
Summary:
Introduces
MD_YAML
mode to parse YAML inputs within markdown, updating necessary files and tests to support this new functionality.Key points:
MD_YAML
mode to handle YAML inputs in markdown.instructor/client.py
,instructor/function_calls.py
,instructor/mode.py
,instructor/process_response.py
, andinstructor/retry.py
to support new mode.extract_json_from_yaml_codeblock
ininstructor/utils.py
.MD_YAML
mode intests/llm/test_openai/test_modes.py
.Generated with ❤️ by ellipsis.dev