-
Notifications
You must be signed in to change notification settings - Fork 926
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: added a fix for
failed decoding error arguments
(#665)
<!-- ELLIPSIS_HIDDEN --> > [!IMPORTANT] > Fix decoding error by switching to `PyYAML` and updating cookbooks to use formatted strings for YAML loading. > > - **YAML Handling**: > - Replace `ruamel.yaml` with `PyYAML` in `yaml.py`, using `CSafeLoader` and `CSafeDumper` for `load()` and `dump()` functions. > - Remove `ruamel-yaml` dependency from `pyproject.toml`. > - **Cookbooks**: > - Update `06-Designing_Multi-Step_Tasks.py`, `07-Integrating_External_Tools_and_APIs.py`, `08-Managing_Persistent_Sessions.py`, `09-User_Management_and_Personalization.py`, `10-Document_Management_and_Search.py`, and `11-Advanced_Chat_Interactions.py` to use formatted strings in `yaml.safe_load()` calls. > - **Imports**: > - Add `msgpack` import under `workflow.unsafe.imports_passed_through()` in `__init__.py`. > > <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=julep-ai%2Fjulep&utm_source=github&utm_medium=referral)<sup> for b514c54. It will automatically update as commits are pushed.</sup> <!-- ELLIPSIS_HIDDEN --> --------- Co-authored-by: Vedantsahai18 <[email protected]>
- Loading branch information
1 parent
4bab852
commit f4f9b87
Showing
10 changed files
with
32 additions
and
113 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
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 |
---|---|---|
@@ -1,18 +1,12 @@ | ||
from io import StringIO | ||
from typing import Any | ||
|
||
from ruamel.yaml import YAML | ||
import yaml | ||
|
||
yaml = YAML(typ="safe", pure=True) # pure is needed for yaml 1.2 support | ||
yaml.version = (1, 2) | ||
|
||
|
||
def dump(value: Any) -> str: | ||
stream = StringIO() | ||
yaml.dump(value, stream) | ||
|
||
return stream.getvalue() | ||
def load(string: str) -> Any: | ||
return yaml.load(string, Loader=yaml.CSafeLoader) | ||
|
||
|
||
def load(string: str) -> Any: | ||
return yaml.load(string) | ||
def dump(value: Any) -> str: | ||
return yaml.dump(value, Dumper=yaml.CSafeDumper) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
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
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
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