You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: