Skip to content
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

[Bug]: Utilities' toString method should consistently go between yml and JSON #1350

Open
corinagum opened this issue Feb 27, 2024 · 0 comments
Labels
bug Something isn't working P2 Priority level 2 - Nice to have

Comments

@corinagum
Copy link
Collaborator

corinagum commented Feb 27, 2024

Related to #1171

Language

Javascript/Typescript

Version

latest

Description

Currently, Utilities.ts's toString method will (if toJSON is not specified) return whichever is shorter: yml or JSON. However, we think that the method should consistently return one or the other, not a (seemingly) arbitrary decision between the two, as this may confuse developers.

Instead of calculating which is shorter, toString should return yml. The current perception is that yml will normally be shorter than JSON and is more human readable, and LLM's seem to work a little more nicely with yml.

Reproduction Steps

run test: it('should convert a simple object to yaml', () => {
       const result = Utilities.toString(tokenizer, { a: 1 });
       assert.equal(result, 'a: 1\n');
 });

Note that this test fails; JSON is produced instead. Using gpt3.5/4 encoding, JSON and YML would be equal in token length.
@corinagum corinagum added the bug Something isn't working label Feb 27, 2024
@corinagum corinagum self-assigned this Feb 27, 2024
@corinagum corinagum removed their assignment Oct 24, 2024
@corinagum corinagum added the P2 Priority level 2 - Nice to have label Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P2 Priority level 2 - Nice to have
Projects
None yet
Development

No branches or pull requests

1 participant