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

Feature Request: Improved logic for truncation of context #86

Open
psychedelicious opened this issue Jan 8, 2024 · 0 comments
Open

Comments

@psychedelicious
Copy link
Contributor

Would like to be able to configure these options or maybe have a different way to gauge the size of the context.

I see there's a commit to bump width to 30 (CI failed, maybe a release was intended?). Even then, 30 keys could be a totally reasonable context size.

Ideas

  • Make width and breadth configurable.
  • Make this opt-in/out, perhaps depending on logger instance or log level or something.
  • Use a more accurate measure of object size e.g. JSON.stringify(data).length > maxCharCount. I suppose that would require two stringifications. Could keep track of the size as you stringify, and only start truncating once you hit the limit. Not sure if there is any prior art here.

Alternatives

The implementation of the serializer in roarr is conveniently very minimal and it's trivial to set your own.

I think it makes sense to have very conservative defaults and maybe even leave the max breadth at 10.

So all that said, I'm happy for this to be immediately closed, unless you think it's worth more discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant